Initial merge of nxml
[bpt/emacs.git] / lisp / nxml / README
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.
5
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.
8
9 To get started, do
10
11 M-x load-file <RET> rng-auto.el <RET>
12
13 This defines the necessary autoloads. Now, visit a file containing
14 an XML document, and do
15
16 M-x nxml-mode
17
18 Now do
19
20 C-h m
21
22 for information on how to use nxml-mode.
23
24 The beginnings of a manual are in nxml-mode.info. You can read this
25 using
26
27 C-u M-x info RET nxml-mode.info RET
28
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.
31
32 You can use test.valid.xml and test.invalid.xml as examples of valid
33 and invalid XML documents.
34
35 To get things automatically loaded each time you start Emacs, add
36
37 (load "~/nxml-mode-200YMMDD/rng-auto.el")
38
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.
44
45 To use nxml-mode automatically for files with an extension of xml,
46 xsl, rng or xhtml, add
47
48 (setq auto-mode-alist
49 (cons '("\\.\\(xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
50 auto-mode-alist))
51
52 to your .emacs.
53
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
57
58 (unify-8859-on-decoding-mode)
59
60 to you .emacs.
61
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.
65
66 For more on RELAX NG, see
67
68 http://relaxng.org
69
70 For a tutorial on RELAX NG Compact Syntax, see
71
72 http://relaxng.org/compact-tutorial.html
73
74 For automatically creating RNC schemas, I recommend my Trang program:
75
76 http://www.thaiopensource.com/relaxng/trang.html
77
78 You can use this to
79
80 - infer an RNC schema from an instance document;
81
82 - convert a DTD to an RNC schema;
83
84 - convert a RELAX NG XML syntax schema to an RNC schema.
85
86 To convert a RELAX NG XML syntax (.rng) schema to a RNC schema, you
87 can also use the XSLT stylesheet from
88
89 http://www.pantor.com/download.html
90
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
94
95 https://msv.dev.java.net/
96
97 The file NEWS describes recent changes.
98
99 Please use the list
100
101 http://groups.yahoo.com/group/emacs-nxml-mode/
102
103 for bug reports, discussion. I will announce all new versions there.
104
105 James Clark
106 http://www.jclark.com/contact.html