1 This is a new major mode for GNU Emacs for editing XML documents. It
2 supports editing well-formed XML documents and also provides
3 schema-sensitive editing of XML documents using RELAX NG Compact
6 To use this, you need GNU Emacs version 21.x, preferably 21.3. GNU
7 Emacs version 20 will not work properly, nor will XEmacs.
11 M-x load-file <RET> rng-auto.el <RET>
13 This defines the necessary autoloads. Now, visit a file containing
14 an XML document, and do
22 for information on how to use nxml-mode.
24 The beginnings of a manual are in nxml-mode.info. You can read this
27 C-u M-x info RET nxml-mode.info RET
29 It's also installed as an entry at the end of the top-level info
30 directory. So you can read it with C-h i as usual.
32 You can use test.valid.xml and test.invalid.xml as examples of valid
33 and invalid XML documents.
35 To get things automatically loaded each time you start Emacs, add
37 (load "~/nxml-mode-200YMMDD/rng-auto.el")
39 to your .emacs, where ~/nxml-mode-200YMMDD is the directory containing
40 the .elc files. Note that rng-auto.el does not load all of the
41 nxml-mode code; it merely sets things up so that all the features of
42 nxml-mode will be autoloaded properly. You should not try to autoload
45 To use nxml-mode automatically for files with an extension of xml,
46 xsl, rng or xhtml, add
49 (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
54 If you edit XML using iso-8859-N encodings other than iso-8859-1 and
55 you are running Emacs 21.3 or later, then I recommend enabling
56 unify-8859-on-decoding-mode, by adding
58 (unify-8859-on-decoding-mode)
62 To get validation and schema-sensitive editing, you need a RELAX NG
63 Compact Syntax (RNC) schema for you document. The schema directory
64 includes some schemas for popular document types.
66 For more on RELAX NG, see
70 For a tutorial on RELAX NG Compact Syntax, see
72 http://relaxng.org/compact-tutorial.html
74 For automatically creating RNC schemas, I recommend my Trang program:
76 http://www.thaiopensource.com/relaxng/trang.html
80 - infer an RNC schema from an instance document;
82 - convert a DTD to an RNC schema;
84 - convert a RELAX NG XML syntax schema to an RNC schema.
86 To convert a RELAX NG XML syntax (.rng) schema to a RNC schema, you
87 can also use the XSLT stylesheet from
89 http://www.pantor.com/download.html
91 To convert a W3C XML Schema to an RNC schema, you need first to
92 convert it to RELAX NG XML syntax using Sun's RELAX NG converter tool
93 rngconv (built on top of MSV). See
95 https://msv.dev.java.net/
97 The file NEWS describes recent changes.
101 http://groups.yahoo.com/group/emacs-nxml-mode/
103 for bug reports, discussion. I will announce all new versions there.
106 http://www.jclark.com/contact.html