*** empty log message ***
[emacs.git] / lisp / nxml / README
blob4f3fc96c0f4490a882d764ec6c55692b326b3efe
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
4 Syntax.
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.
9 To get started, do
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
16   M-x nxml-mode
18 Now do
20   C-h m
22 for information on how to use nxml-mode.
24 The beginnings of a manual are in nxml-mode.info.  You can read this
25 using
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
43 rng-auto.el itself.
45 To use nxml-mode automatically for files with an extension of xml,
46 xsl, rng or xhtml, add
48   (setq auto-mode-alist
49         (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
50               auto-mode-alist))
52 to your .emacs.
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)
60 to you .emacs.
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
68   http://relaxng.org
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
78 You can use this to
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.
99 Please use the list
101   http://groups.yahoo.com/group/emacs-nxml-mode/
103 for bug reports, discussion. I will announce all new versions there.
105 James Clark
106 http://www.jclark.com/contact.html