Mercurial > emacs
annotate doc/misc/nxml-mode.texi @ 112314:b43e3dd4da2d
* lib/COPYING: New file, a copy of COPYING.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Sat, 08 Jan 2011 23:43:55 -0800 |
parents | c757f4efde4e |
children | 376148b31b5e |
rev | line source |
---|---|
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
1 \input texinfo @c -*- texinfo -*- |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
2 @c %**start of header |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
3 @setfilename ../../info/nxml-mode |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
4 @settitle nXML Mode |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
5 @c %**end of header |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
6 |
87658 | 7 @copying |
8 This manual documents nxml-mode, an Emacs major mode for editing | |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
9 XML with RELAX NG support. |
87658 | 10 |
111763
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
11 Copyright @copyright{} 2007, 2008, 2009, 2010 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
12 Free Software Foundation, Inc. |
87658 | 13 |
14 @quotation | |
15 Permission is granted to copy, distribute and/or modify this document | |
99709
6de181810d0f
Relicense all texi files under FDL 1.3 or later.
Glenn Morris <rgm@gnu.org>
parents:
95874
diff
changeset
|
16 under the terms of the GNU Free Documentation License, Version 1.3 or |
87658 | 17 any later version published by the Free Software Foundation; with no |
18 Invariant Sections, with the Front-Cover texts being ``A GNU | |
19 Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the | |
20 license is included in the section entitled ``GNU Free Documentation | |
21 License'' in the Emacs manual. | |
22 | |
95874
eafbd7a5c9be
Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents:
87658
diff
changeset
|
23 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and |
eafbd7a5c9be
Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents:
87658
diff
changeset
|
24 modify this GNU manual. Buying copies from the FSF supports it in |
eafbd7a5c9be
Update Back-Cover Text as per maintain.info.
Glenn Morris <rgm@gnu.org>
parents:
87658
diff
changeset
|
25 developing GNU and promoting software freedom.'' |
87658 | 26 |
27 This document is part of a collection distributed under the GNU Free | |
28 Documentation License. If you want to distribute this document | |
29 separately from the collection, you can do so by adding a copy of the | |
30 license to the document, as described in section 6 of the license. | |
31 @end quotation | |
32 @end copying | |
33 | |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
34 @dircategory Emacs |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
35 @direntry |
86402
aa024a0d77d4
Fix file name to match @setfilename.
Romain Francoise <romain@orebokech.com>
parents:
86401
diff
changeset
|
36 * nXML Mode: (nxml-mode). XML editing mode with RELAX NG support. |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
37 @end direntry |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
38 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
39 @node Top |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
40 @top nXML Mode |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
41 |
102059
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
100974
diff
changeset
|
42 @insertcopying |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
100974
diff
changeset
|
43 |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
100974
diff
changeset
|
44 This manual is not yet complete. |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
45 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
46 @menu |
111763
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
47 * Introduction:: |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
48 * Completion:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
49 * Inserting end-tags:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
50 * Paragraphs:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
51 * Outlining:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
52 * Locating a schema:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
53 * DTDs:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
54 * Limitations:: |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
55 @end menu |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
56 |
111763
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
57 @node Introduction |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
58 @chapter Introduction |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
59 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
60 nXML mode is an Emacs major-mode for editing XML documents. It supports |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
61 editing well-formed XML documents, and provides schema-sensitive editing |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
62 using RELAX NG Compact Syntax. To get started, visit a file containing an |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
63 XML document, and, if necessary, use @kbd{M-x nxml-mode} to switch to nXML |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
64 mode. By default, @code{auto-mode-alist} and @code{magic-fallback-alist} |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
65 put buffers in nXML mode if they have recognizable XML content or file |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
66 extensions. You may wish to customize the settings, for example to |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
67 recognize different file extensions. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
68 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
69 Once in nXML mode, you can type @kbd{C-h m} for basic information on the |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
70 mode. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
71 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
72 The @file{etc/nxml} directory in the Emacs distribution contains some data |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
73 files used by nXML mode, and includes two files (@file{test.valid.xml} and |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
74 @file{test.invalid.xml}) that provide examples of valid and invalid XML |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
75 documents. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
76 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
77 To get validation and schema-sensitive editing, you need a RELAX NG Compact |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
78 Syntax (RNC) schema for your document (@pxref{Locating a schema}). The |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
79 @file{etc/schema} directory includes some schemas for popular document |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
80 types. See @url{http://relaxng.org/} for more information on RELAX NG. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
81 You can use the @samp{Trang} program from |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
82 @url{http://www.thaiopensource.com/relaxng/trang.html} to |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
83 automatically create RNC schemas. This program can: |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
84 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
85 @itemize @bullet |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
86 @item |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
87 infer an RNC schema from an instance document; |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
88 @item |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
89 convert a DTD to an RNC schema; |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
90 @item |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
91 convert a RELAX NG XML syntax schema to an RNC schema. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
92 @end itemize |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
93 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
94 @noindent To convert a RELAX NG XML syntax (@samp{.rng}) schema to a RNC |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
95 one, you can also use the XSLT stylesheet from |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
96 @url{http://www.pantor.com/download.html}. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
97 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
98 To convert a W3C XML Schema to an RNC schema, you need first to convert it |
111764
c757f4efde4e
Tweak previous nxml doc change.
Glenn Morris <rgm@gnu.org>
parents:
111763
diff
changeset
|
99 to RELAX NG XML syntax using the RELAX NG converter tool @code{rngconv} |
111763
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
100 (built on top of MSV). See @url{https://github.com/kohsuke/msv} |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
101 and @url{https://msv.dev.java.net/}. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
102 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
103 For historical discussions only, see the mailing list archives at |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
104 @url{http://groups.yahoo.com/group/emacs-nxml-mode/}. Please make all new |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
105 discussions on the @samp{help-gnu-emacs} and @samp{emacs-devel} mailing |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
106 lists. Report any bugs with @kbd{M-x report-emacs-bug}. |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
107 |
bb7c95bbfada
* doc/misc/nxml-mode.texi (Introduction): New section.
Glenn Morris <rgm@gnu.org>
parents:
109343
diff
changeset
|
108 |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
109 @node Completion |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
110 @chapter Completion |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
111 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
112 Apart from real-time validation, the most important feature that |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
113 nxml-mode provides for assisting in document creation is "completion". |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
114 Completion assists the user in inserting characters at point, based on |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
115 knowledge of the schema and on the contents of the buffer before |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
116 point. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
117 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
118 The traditional GNU Emacs key combination for completion in a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
119 buffer is @kbd{M-@key{TAB}}. However, many window systems |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
120 and window managers use this key combination themselves (typically for |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
121 switching between windows) and do not pass it to applications. It's |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
122 hard to find key combinations in GNU Emacs that are both easy to type |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
123 and not taken by something else. @kbd{C-@key{RET}} (i.e. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
124 pressing the Enter or Return key, while the Ctrl key is held down) is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
125 available. It won't be available on a traditional terminal (because |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
126 it is indistinguishable from Return), but it will work with a window |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
127 system. Therefore we adopt the following solution by default: use |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
128 @kbd{C-@key{RET}} when there's a window system and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
129 @kbd{M-@key{TAB}} when there's not. In the following, I |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
130 will assume that a window system is being used and will therefore |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
131 refer to @kbd{C-@key{RET}}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
132 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
133 Completion works by examining the symbol preceding point. This |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
134 is the symbol to be completed. The symbol to be completed may be the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
135 empty. Completion considers what symbols starting with the symbol to |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
136 be completed would be valid replacements for the symbol to be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
137 completed, given the schema and the contents of the buffer before |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
138 point. These symbols are the possible completions. An example may |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
139 make this clearer. Suppose the buffer looks like this (where @point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
140 indicates point): |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
141 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
142 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
143 <html xmlns="http://www.w3.org/1999/xhtml"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
144 <h@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
145 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
146 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
147 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
148 and the schema is XHTML. In this context, the symbol to be completed |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
149 is @samp{h}. The possible completions consist of just |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
150 @samp{head}. Another example, is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
151 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
152 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
153 <html xmlns="http://www.w3.org/1999/xhtml"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
154 <head> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
155 <@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
156 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
157 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
158 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
159 In this case, the symbol to be completed is empty, and the possible |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
160 completions are @samp{base}, @samp{isindex}, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
161 @samp{link}, @samp{meta}, @samp{script}, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
162 @samp{style}, @samp{title}. Another example is: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
163 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
164 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
165 <html xmlns="@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
166 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
167 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
168 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
169 In this case, the symbol to be completed is empty, and the possible |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
170 completions are just @samp{http://www.w3.org/1999/xhtml}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
171 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
172 When you type @kbd{C-@key{RET}}, what happens depends |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
173 on what the set of possible completions are. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
174 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
175 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
176 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
177 If the set of completions is empty, nothing |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
178 happens. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
179 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
180 If there is one possible completion, then that completion is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
181 inserted, together with any following characters that are |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
182 required. For example, in this case: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
183 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
184 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
185 <html xmlns="http://www.w3.org/1999/xhtml"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
186 <@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
187 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
188 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
189 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
190 @kbd{C-@key{RET}} will yield |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
191 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
192 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
193 <html xmlns="http://www.w3.org/1999/xhtml"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
194 <head@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
195 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
196 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
197 If there is more than one possible completion, but all |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
198 possible completions share a common non-empty prefix, then that prefix |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
199 is inserted. For example, suppose the buffer is: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
200 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
201 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
202 <html x@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
203 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
204 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
205 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
206 The symbol to be completed is @samp{x}. The possible completions |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
207 are @samp{xmlns} and @samp{xml:lang}. These share a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
208 common prefix of @samp{xml}. Thus, @kbd{C-@key{RET}} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
209 will yield: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
210 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
211 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
212 <html xml@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
213 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
214 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
215 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
216 Typically, you would do @kbd{C-@key{RET}} again, which would |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
217 have the result described in the next item. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
218 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
219 If there is more than one possible completion, but the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
220 possible completions do not share a non-empty prefix, then Emacs will |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
221 prompt you to input the symbol in the minibuffer, initializing the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
222 minibuffer with the symbol to be completed, and popping up a buffer |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
223 showing the possible completions. You can now input the symbol to be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
224 inserted. The symbol you input will be inserted in the buffer instead |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
225 of the symbol to be completed. Emacs will then insert any required |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
226 characters after the symbol. For example, if it contains: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
227 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
228 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
229 <html xml@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
230 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
231 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
232 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
233 Emacs will prompt you in the minibuffer with |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
234 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
235 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
236 Attribute: xml@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
237 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
238 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
239 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
240 and the buffer showing possible completions will contain |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
241 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
242 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
243 Possible completions are: |
109270
a7253b87aad9
Remove remaining tabs from non-verbatim in doc/misc/*.texi.
Glenn Morris <rgm@gnu.org>
parents:
107156
diff
changeset
|
244 xml:lang xmlns |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
245 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
246 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
247 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
248 If you input @kbd{xmlns}, the result will be: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
249 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
250 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
251 <html xmlns="@point{} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
252 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
253 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
254 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
255 (If you do @kbd{C-@key{RET}} again, the namespace URI will |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
256 be inserted. Should that happen automatically?) |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
257 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
258 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
259 @node Inserting end-tags |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
260 @chapter Inserting end-tags |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
261 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
262 The main redundancy in XML syntax is end-tags. nxml-mode provides |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
263 several ways to make it easier to enter end-tags. You can use all of |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
264 these without a schema. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
265 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
266 You can use @kbd{C-@key{RET}} after @samp{</} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
267 to complete the rest of the end-tag. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
268 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
269 @kbd{C-c C-f} inserts an end-tag for the element containing |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
270 point. This command is useful when you want to input the start-tag, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
271 then input the content and finally input the end-tag. The @samp{f} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
272 is mnemonic for finish. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
273 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
274 If you want to keep tags balanced and input the end-tag at the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
275 same time as the start-tag, before inputting the content, then you can |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
276 use @kbd{C-c C-i}. This inserts a @samp{>}, then inserts |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
277 the end-tag and leaves point before the end-tag. @kbd{C-c C-b} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
278 is similar but more convenient for block-level elements: it puts the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
279 start-tag, point and the end-tag on successive lines, appropriately |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
280 indented. The @samp{i} is mnemonic for inline and the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
281 @samp{b} is mnemonic for block. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
282 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
283 Finally, you can customize nxml-mode so that @kbd{/} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
284 automatically inserts the rest of the end-tag when it occurs after |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
285 @samp{<}, by doing |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
286 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
287 @display |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
288 @kbd{M-x customize-variable @key{RET} nxml-slash-auto-complete-flag @key{RET}} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
289 @end display |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
290 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
291 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
292 and then following the instructions in the displayed buffer. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
293 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
294 @node Paragraphs |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
295 @chapter Paragraphs |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
296 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
297 Emacs has several commands that operate on paragraphs, most |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
298 notably @kbd{M-q}. nXML mode redefines these to work in a way |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
299 that is useful for XML. The exact rules that are used to find the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
300 beginning and end of a paragraph are complicated; they are designed |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
301 mainly to ensure that @kbd{M-q} does the right thing. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
302 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
303 A paragraph consists of one or more complete, consecutive lines. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
304 A group of lines is not considered a paragraph unless it contains some |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
305 non-whitespace characters between tags or inside comments. A blank |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
306 line separates paragraphs. A single tag on a line by itself also |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
307 separates paragraphs. More precisely, if one tag together with any |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
308 leading and trailing whitespace completely occupy one or more lines, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
309 then those lines will not be included in any paragraph. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
310 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
311 A start-tag at the beginning of the line (possibly indented) may |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
312 be treated as starting a paragraph. Similarly, an end-tag at the end |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
313 of the line may be treated as ending a paragraph. The following rules |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
314 are used to determine whether such a tag is in fact treated as a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
315 paragraph boundary: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
316 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
317 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
318 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
319 If the schema does not allow text at that point, then it |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
320 is a paragraph boundary. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
321 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
322 If the end-tag corresponding to the start-tag is not at |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
323 the end of its line, or the start-tag corresponding to the end-tag is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
324 not at the beginning of its line, then it is not a paragraph |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
325 boundary. For example, in |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
326 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
327 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
328 <p>This is a paragraph with an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
329 <emph>emphasized</emph> phrase. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
330 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
331 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
332 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
333 the @samp{<emph>} start-tag would not be considered as |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
334 starting a paragraph, because its corresponding end-tag is not at the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
335 end of the line. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
336 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
337 If there is text that is a sibling in element tree, then |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
338 it is not a paragraph boundary. For example, in |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
339 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
340 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
341 <p>This is a paragraph with an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
342 <emph>emphasized phrase that takes one source line</emph> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
343 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
344 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
345 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
346 the @samp{<emph>} start-tag would not be considered as |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
347 starting a paragraph, even though its end-tag is at the end of its |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
348 line, because there the text @samp{This is a paragraph with an} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
349 is a sibling of the @samp{emph} element. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
350 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
351 Otherwise, it is a paragraph boundary. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
352 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
353 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
354 @node Outlining |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
355 @chapter Outlining |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
356 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
357 nXML mode allows you to display all or part of a buffer as an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
358 outline, in a similar way to Emacs' outline mode. An outline in nXML |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
359 mode is based on recognizing two kinds of element: sections and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
360 headings. There is one heading for every section and one section for |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
361 every heading. A section contains its heading as or within its first |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
362 child element. A section also contains its subordinate sections (its |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
363 subsections). The text content of a section consists of anything in a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
364 section that is neither a subsection nor a heading. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
365 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
366 Note that this is a different model from that used by XHTML. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
367 nXML mode's outline support will not be useful for XHTML unless you |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
368 adopt a convention of adding a @code{div} to enclose each |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
369 section, rather than having sections implicitly delimited by different |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
370 @code{h@var{n}} elements. This limitation may be removed |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
371 in a future version. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
372 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
373 The variable @code{nxml-section-element-name-regexp} gives |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
374 a regexp for the local names (i.e. the part of the name following any |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
375 prefix) of section elements. The variable |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
376 @code{nxml-heading-element-name-regexp} gives a regexp for the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
377 local names of heading elements. For an element to be recognized |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
378 as a section |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
379 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
380 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
381 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
382 its start-tag must occur at the beginning of a line |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
383 (possibly indented); |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
384 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
385 its local name must match |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
386 @code{nxml-section-element-name-regexp}; |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
387 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
388 either its first child element or a descendant of that |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
389 first child element must have a local name that matches |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
390 @code{nxml-heading-element-name-regexp}; the first such element |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
391 is treated as the section's heading. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
392 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
393 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
394 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
395 You can customize these variables using @kbd{M-x |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
396 customize-variable}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
397 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
398 There are three possible outline states for a section: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
399 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
400 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
401 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
402 normal, showing everything, including its heading, text |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
403 content and subsections; each subsection is displayed according to the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
404 state of that subsection; |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
405 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
406 showing just its heading, with both its text content and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
407 its subsections hidden; all subsections are hidden regardless of their |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
408 state; |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
409 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
410 showing its heading and its subsections, with its text |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
411 content hidden; each subsection is displayed according to the state of |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
412 that subsection. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
413 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
414 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
415 In the last two states, where the text content is hidden, the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
416 heading is displayed specially, in an abbreviated form. An element |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
417 like this: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
418 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
419 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
420 <section> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
421 <title>Food</title> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
422 <para>There are many kinds of food.</para> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
423 </section> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
424 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
425 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
426 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
427 would be displayed on a single line like this: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
428 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
429 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
430 <-section>Food...</> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
431 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
432 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
433 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
434 If there are hidden subsections, then a @code{+} will be used |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
435 instead of a @code{-} like this: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
436 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
437 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
438 <+section>Food...</> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
439 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
440 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
441 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
442 If there are non-hidden subsections, then the section will instead be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
443 displayed like this: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
444 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
445 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
446 <-section>Food... |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
447 <-section>Delicious Food...</> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
448 <-section>Distasteful Food...</> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
449 </-section> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
450 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
451 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
452 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
453 The heading is always displayed with an indent that corresponds to its |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
454 depth in the outline, even it is not actually indented in the buffer. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
455 The variable @code{nxml-outline-child-indent} controls how much |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
456 a subheading is indented with respect to its parent heading when the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
457 heading is being displayed specially. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
458 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
459 Commands to change the outline state of sections are bound to |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
460 key sequences that start with @kbd{C-c C-o} (@kbd{o} is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
461 mnemonic for outline). The third and final key has been chosen to be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
462 consistent with outline mode. In the following descriptions |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
463 current section means the section containing point, or, more precisely, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
464 the innermost section containing the character immediately following |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
465 point. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
466 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
467 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
468 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
469 @kbd{C-c C-o C-a} shows all sections in the buffer |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
470 normally. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
471 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
472 @kbd{C-c C-o C-t} hides the text content |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
473 of all sections in the buffer. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
474 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
475 @kbd{C-c C-o C-c} hides the text content |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
476 of the current section. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
477 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
478 @kbd{C-c C-o C-e} shows the text content |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
479 of the current section. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
480 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
481 @kbd{C-c C-o C-d} hides the text content |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
482 and subsections of the current section. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
483 @item |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
484 @kbd{C-c C-o C-s} shows the current section |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
485 and all its direct and indirect subsections normally. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
486 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
487 @kbd{C-c C-o C-k} shows the headings of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
488 direct and indirect subsections of the current section. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
489 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
490 @kbd{C-c C-o C-l} hides the text content of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
491 current section and of its direct and indirect |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
492 subsections. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
493 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
494 @kbd{C-c C-o C-i} shows the headings of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
495 direct subsections of the current section. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
496 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
497 @kbd{C-c C-o C-o} hides as much as possible without |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
498 hiding the current section's text content; the headings of ancestor |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
499 sections of the current section and their child section sections will |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
500 not be hidden. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
501 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
502 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
503 When a heading is displayed specially, you can use |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
504 @key{RET} in that heading to show the text content of the section |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
505 in the same way as @kbd{C-c C-o C-e}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
506 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
507 You can also use the mouse to change the outline state: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
508 @kbd{S-mouse-2} hides the text content of a section in the same |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
509 way as@kbd{C-c C-o C-c}; @kbd{mouse-2} on a specially |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
510 displayed heading shows the text content of the section in the same |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
511 way as @kbd{C-c C-o C-e}; @kbd{mouse-1} on a specially |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
512 displayed start-tag toggles the display of subheadings on and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
513 off. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
514 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
515 The outline state for each section is stored with the first |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
516 character of the section (as a text property). Every command that |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
517 changes the outline state of any section updates the display of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
518 buffer so that each section is displayed correctly according to its |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
519 outline state. If the section structure is subsequently changed, then |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
520 it is possible for the display to no longer correctly reflect the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
521 stored outline state. @kbd{C-c C-o C-r} can be used to refresh |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
522 the display so it is correct again. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
523 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
524 @node Locating a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
525 @chapter Locating a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
526 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
527 nXML mode has a configurable set of rules to locate a schema for |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
528 the file being edited. The rules are contained in one or more schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
529 locating files, which are XML documents. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
530 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
531 The variable @samp{rng-schema-locating-files} specifies |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
532 the list of the file-names of schema locating files that nXML mode |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
533 should use. The order of the list is significant: when file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
534 @var{x} occurs in the list before file @var{y} then rules |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
535 from file @var{x} have precedence over rules from file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
536 @var{y}. A filename specified in |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
537 @samp{rng-schema-locating-files} may be relative. If so, it will |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
538 be resolved relative to the document for which a schema is being |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
539 located. It is not an error if relative file-names in |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
540 @samp{rng-schema-locating-files} do not exist. You can use |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
541 @kbd{M-x customize-variable @key{RET} rng-schema-locating-files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
542 @key{RET}} to customize the list of schema locating |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
543 files. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
544 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
545 By default, @samp{rng-schema-locating-files} list has two |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
546 members: @samp{schemas.xml}, and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
547 @samp{@var{dist-dir}/schema/schemas.xml} where |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
548 @samp{@var{dist-dir}} is the directory containing the nXML |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
549 distribution. The first member will cause nXML mode to use a file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
550 @samp{schemas.xml} in the same directory as the document being |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
551 edited if such a file exist. The second member contains rules for the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
552 schemas that are included with the nXML distribution. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
553 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
554 @menu |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
555 * Commands for locating a schema:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
556 * Schema locating files:: |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
557 @end menu |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
558 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
559 @node Commands for locating a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
560 @section Commands for locating a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
561 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
562 The command @kbd{C-c C-s C-w} will tell you what schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
563 is currently being used. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
564 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
565 The rules for locating a schema are applied automatically when |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
566 you visit a file in nXML mode. However, if you have just created a new |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
567 file and the schema cannot be inferred from the file-name, then this |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
568 will not locate the right schema. In this case, you should insert the |
107156
b57368a8e3fd
* nxml-mode.texi (Commands for locating a schema): Fix keybinding.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
569 start-tag of the root element and then use the command @kbd{C-c C-s |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
570 C-a}, which reapplies the rules based on the current content of |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
571 the document. It is usually not necessary to insert the complete |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
572 start-tag; often just @samp{<@var{name}} is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
573 enough. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
574 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
575 If you want to use a schema that has not yet been added to the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
576 schema locating files, you can use the command @kbd{C-c C-s C-f} |
109284
46d052bb8f04
*** empty log message ***
Juanma Barranquero <lekktu@gmail.com>
parents:
109270
diff
changeset
|
577 to manually select the file containing the schema for the document in |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
578 current buffer. Emacs will read the file-name of the schema from the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
579 minibuffer. After reading the file-name, Emacs will ask whether you |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
580 wish to add a rule to a schema locating file that persistently |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
581 associates the document with the selected schema. The rule will be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
582 added to the first file in the list specified |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
583 @samp{rng-schema-locating-files}; it will create the file if |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
584 necessary, but will not create a directory. If the variable |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
585 @samp{rng-schema-locating-files} has not been customized, this |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
586 means that the rule will be added to the file @samp{schemas.xml} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
587 in the same directory as the document being edited. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
588 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
589 The command @kbd{C-c C-s C-t} allows you to select a schema by |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
590 specifying an identifier for the type of the document. The schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
591 locating files determine the available type identifiers and what |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
592 schema is used for each type identifier. This is useful when it is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
593 impossible to infer the right schema from either the file-name or the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
594 content of the document, even though the schema is already in the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
595 schema locating file. A situation in which this can occur is when |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
596 there are multiple variants of a schema where all valid documents have |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
597 the same document element. For example, XHTML has Strict and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
598 Transitional variants. In a situation like this, a schema locating file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
599 can define a type identifier for each variant. As with @kbd{C-c |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
600 C-s C-f}, Emacs will ask whether you wish to add a rule to a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
601 locating file that persistently associates the document with the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
602 specified type identifier. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
603 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
604 The command @kbd{C-c C-s C-l} adds a rule to a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
605 locating file that persistently associates the document with |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
606 the schema that is currently being used. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
607 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
608 @node Schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
609 @section Schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
610 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
611 Each schema locating file specifies a list of rules. The rules |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
612 from each file are appended in order. To locate a schema each rule is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
613 applied in turn until a rule matches. The first matching rule is then |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
614 used to determine the schema. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
615 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
616 Schema locating files are designed to be useful for other |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
617 applications that need to locate a schema for a document. In fact, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
618 there is nothing specific to locating schemas in the design; it could |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
619 equally well be used for locating a stylesheet. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
620 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
621 @menu |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
622 * Schema locating file syntax basics:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
623 * Using the document's URI to locate a schema:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
624 * Using the document element to locate a schema:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
625 * Using type identifiers in schema locating files:: |
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
626 * Using multiple schema locating files:: |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
627 @end menu |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
628 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
629 @node Schema locating file syntax basics |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
630 @subsection Schema locating file syntax basics |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
631 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
632 There is a schema for schema locating files in the file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
633 @samp{locate.rnc} in the schema directory. Schema locating |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
634 files must be valid with respect to this schema. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
635 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
636 The document element of a schema locating file must be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
637 @samp{locatingRules} and the namespace URI must be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
638 @samp{http://thaiopensource.com/ns/locating-rules/1.0}. The |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
639 children of the document element specify rules. The order of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
640 children is the same as the order of the rules. Here's a complete |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
641 example of a schema locating file: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
642 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
643 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
644 <?xml version="1.0"?> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
645 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
646 <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
647 <documentElement localName="book" uri="docbook.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
648 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
649 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
650 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
651 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
652 This says to use the schema @samp{xhtml.rnc} for a document with |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
653 namespace @samp{http://www.w3.org/1999/xhtml}, and to use the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
654 schema @samp{docbook.rnc} for a document whose local name is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
655 @samp{book}. If the document element had both a namespace URI |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
656 of @samp{http://www.w3.org/1999/xhtml} and a local name of |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
657 @samp{book}, then the matching rule that comes first will be |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
658 used and so the schema @samp{xhtml.rnc} would be used. There is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
659 no precedence between different types of rule; the first matching rule |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
660 of any type is used. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
661 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
662 As usual with XML-related technologies, resources are identified |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
663 by URIs. The @samp{uri} attribute identifies the schema by |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
664 specifying the URI. The URI may be relative. If so, it is resolved |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
665 relative to the URI of the schema locating file that contains |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
666 attribute. This means that if the value of @samp{uri} attribute |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
667 does not contain a @samp{/}, then it will refer to a filename in |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
668 the same directory as the schema locating file. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
669 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
670 @node Using the document's URI to locate a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
671 @subsection Using the document's URI to locate a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
672 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
673 A @samp{uri} rule locates a schema based on the URI of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
674 document. The @samp{uri} attribute specifies the URI of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
675 schema. The @samp{resource} attribute can be used to specify |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
676 the schema for a particular document. For example, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
677 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
678 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
679 <uri resource="spec.xml" uri="docbook.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
680 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
681 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
682 @noindent |
102151
328f4b370b74
Remove duplicate words.
Juanma Barranquero <lekktu@gmail.com>
parents:
102059
diff
changeset
|
683 specifies that the schema for @samp{spec.xml} is |
86378
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
684 @samp{docbook.rnc}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
685 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
686 The @samp{pattern} attribute can be used instead of the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
687 @samp{resource} attribute to specify the schema for any document |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
688 whose URI matches a pattern. The pattern has the same syntax as an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
689 absolute or relative URI except that the path component of the URI can |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
690 use a @samp{*} character to stand for zero or more characters |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
691 within a path segment (i.e. any character other @samp{/}). |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
692 Typically, the URI pattern looks like a relative URI, but, whereas a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
693 relative URI in the @samp{resource} attribute is resolved into a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
694 particular absolute URI using the base URI of the schema locating |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
695 file, a relative URI pattern matches if it matches some number of |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
696 complete path segments of the document's URI ending with the last path |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
697 segment of the document's URI. For example, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
698 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
699 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
700 <uri pattern="*.xsl" uri="xslt.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
701 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
702 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
703 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
704 specifies that the schema for documents with a URI whose path ends |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
705 with @samp{.xsl} is @samp{xslt.rnc}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
706 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
707 A @samp{transformURI} rule locates a schema by |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
708 transforming the URI of the document. The @samp{fromPattern} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
709 attribute specifies a URI pattern with the same meaning as the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
710 @samp{pattern} attribute of the @samp{uri} element. The |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
711 @samp{toPattern} attribute is a URI pattern that is used to |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
712 generate the URI of the schema. Each @samp{*} in the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
713 @samp{toPattern} is replaced by the string that matched the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
714 corresponding @samp{*} in the @samp{fromPattern}. The |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
715 resulting string is appended to the initial part of the document's URI |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
716 that was not explicitly matched by the @samp{fromPattern}. The |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
717 rule matches only if the transformed URI identifies an existing |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
718 resource. For example, the rule |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
719 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
720 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
721 <transformURI fromPattern="*.xml" toPattern="*.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
722 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
723 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
724 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
725 would transform the URI @samp{file:///home/jjc/docs/spec.xml} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
726 into the URI @samp{file:///home/jjc/docs/spec.rnc}. Thus, this |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
727 rule specifies that to locate a schema for a document |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
728 @samp{@var{foo}.xml}, Emacs should test whether a file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
729 @samp{@var{foo}.rnc} exists in the same directory as |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
730 @samp{@var{foo}.xml}, and, if so, should use it as the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
731 schema. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
732 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
733 @node Using the document element to locate a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
734 @subsection Using the document element to locate a schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
735 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
736 A @samp{documentElement} rule locates a schema based on |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
737 the local name and prefix of the document element. For example, a rule |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
738 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
739 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
740 <documentElement prefix="xsl" localName="stylesheet" uri="xslt.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
741 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
742 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
743 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
744 specifies that when the name of the document element is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
745 @samp{xsl:stylesheet}, then @samp{xslt.rnc} should be used |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
746 as the schema. Either the @samp{prefix} or |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
747 @samp{localName} attribute may be omitted to allow any prefix or |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
748 local name. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
749 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
750 A @samp{namespace} rule locates a schema based on the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
751 namespace URI of the document element. For example, a rule |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
752 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
753 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
754 <namespace ns="http://www.w3.org/1999/XSL/Transform" uri="xslt.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
755 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
756 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
757 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
758 specifies that when the namespace URI of the document is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
759 @samp{http://www.w3.org/1999/XSL/Transform}, then |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
760 @samp{xslt.rnc} should be used as the schema. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
761 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
762 @node Using type identifiers in schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
763 @subsection Using type identifiers in schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
764 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
765 Type identifiers allow a level of indirection in locating the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
766 schema for a document. Instead of associating the document directly |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
767 with a schema URI, the document is associated with a type identifier, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
768 which is in turn associated with a schema URI. nXML mode does not |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
769 constrain the format of type identifiers. They can be simply strings |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
770 without any formal structure or they can be public identifiers or |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
771 URIs. Note that these type identifiers have nothing to do with the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
772 DOCTYPE declaration. When comparing type identifiers, whitespace is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
773 normalized in the same way as with the @samp{xsd:token} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
774 datatype: leading and trailing whitespace is stripped; other sequences |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
775 of whitespace are normalized to a single space character. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
776 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
777 Each of the rules described in previous sections that uses a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
778 @samp{uri} attribute to specify a schema, can instead use a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
779 @samp{typeId} attribute to specify a type identifier. The type |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
780 identifier can be associated with a URI using a @samp{typeId} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
781 element. For example, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
782 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
783 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
784 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
785 <namespace ns="http://www.w3.org/1999/xhtml" typeId="XHTML"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
786 <typeId id="XHTML" typeId="XHTML Strict"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
787 <typeId id="XHTML Strict" uri="xhtml-strict.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
788 <typeId id="XHTML Transitional" uri="xhtml-transitional.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
789 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
790 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
791 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
792 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
793 declares three type identifiers @samp{XHTML} (representing the |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
794 default variant of XHTML to be used), @samp{XHTML Strict} and |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
795 @samp{XHTML Transitional}. Such a schema locating file would |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
796 use @samp{xhtml-strict.rnc} for a document whose namespace is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
797 @samp{http://www.w3.org/1999/xhtml}. But it is considerably |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
798 more flexible than a schema locating file that simply specified |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
799 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
800 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
801 <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml-strict.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
802 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
803 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
804 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
805 A user can easily use @kbd{C-c C-s C-t} to select between XHTML |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
806 Strict and XHTML Transitional. Also, a user can easily add a catalog |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
807 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
808 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
809 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
810 <typeId id="XHTML" typeId="XHTML Transitional"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
811 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
812 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
813 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
814 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
815 that makes the default variant of XHTML be XHTML Transitional. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
816 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
817 @node Using multiple schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
818 @subsection Using multiple schema locating files |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
819 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
820 The @samp{include} element includes rules from another |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
821 schema locating file. The behavior is exactly as if the rules from |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
822 that file were included in place of the @samp{include} element. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
823 Relative URIs are resolved into absolute URIs before the inclusion is |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
824 performed. For example, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
825 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
826 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
827 <include rules="../rules.xml"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
828 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
829 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
830 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
831 includes the rules from @samp{rules.xml}. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
832 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
833 The process of locating a schema takes as input a list of schema |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
834 locating files. The rules in all these files and in the files they |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
835 include are resolved into a single list of rules, which are applied |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
836 strictly in order. Sometimes this order is not what is needed. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
837 For example, suppose you have two schema locating files, a private |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
838 file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
839 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
840 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
841 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
842 <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
843 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
844 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
845 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
846 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
847 followed by a public file |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
848 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
849 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
850 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
851 <transformURI pathSuffix=".xml" replacePathSuffix=".rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
852 <namespace ns="http://www.w3.org/1999/XSL/Transform" typeId="XSLT"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
853 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
854 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
855 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
856 @noindent |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
857 The effect of these two files is that the XHTML @samp{namespace} |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
858 rule takes precedence over the @samp{transformURI} rule, which |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
859 is almost certainly not what is needed. This can be solved by adding |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
860 an @samp{applyFollowingRules} to the private file. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
861 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
862 @example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
863 <locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0"> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
864 <applyFollowingRules ruleType="transformURI"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
865 <namespace ns="http://www.w3.org/1999/xhtml" uri="xhtml.rnc"/> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
866 </locatingRules> |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
867 @end example |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
868 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
869 @node DTDs |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
870 @chapter DTDs |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
871 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
872 nxml-mode is designed to support the creation of standalone XML |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
873 documents that do not depend on a DTD. Although it is common practice |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
874 to insert a DOCTYPE declaration referencing an external DTD, this has |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
875 undesirable side-effects. It means that the document is no longer |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
876 self-contained. It also means that different XML parsers may interpret |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
877 the document in different ways, since the XML Recommendation does not |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
878 require XML parsers to read the DTD. With DTDs, it was impractical to |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
879 get validation without using an external DTD or reference to an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
880 parameter entity. With RELAX NG and other schema languages, you can |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
881 simulataneously get the benefits of validation and standalone XML |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
882 documents. Therefore, I recommend that you do not reference an |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
883 external DOCTYPE in your XML documents. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
884 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
885 One problem is entities for characters. Typically, as well as |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
886 providing validation, DTDs also provide a set of character entities |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
887 for documents to use. Schemas cannot provide this functionality, |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
888 because schema validation happens after XML parsing. The recommended |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
889 solution is to either use the Unicode characters directly, or, if this |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
890 is impractical, use character references. nXML mode supports this by |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
891 providing commands for entering characters and character references |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
892 using the Unicode names, and can display the glyph corresponding to a |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
893 character reference. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
894 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
895 @node Limitations |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
896 @chapter Limitations |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
897 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
898 nXML mode has some limitations: |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
899 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
900 @itemize @bullet |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
901 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
902 DTD support is limited. Internal parsed general entities declared |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
903 in the internal subset are supported provided they do not contain |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
904 elements. Other usage of DTDs is ignored. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
905 @item |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
906 The restrictions on RELAX NG schemas in section 7 of the RELAX NG |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
907 specification are not enforced. |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
908 @end itemize |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
909 |
5d15069189ff
Fixups for nxml per Romain Francoise email.
Mark A. Hershberger <mah@everybody.org>
parents:
diff
changeset
|
910 @bye |
86379 | 911 |