/[suikacvs]/markup/xml/xmlcc/xmlcc-work.en.html
Suika

Contents of /markup/xml/xmlcc/xmlcc-work.en.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download) (as text)
Tue Nov 13 13:00:14 2007 UTC (16 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.10: +84 -1 lines
File MIME type: text/html
XML 1.0 Section 2.2

1 wakaba 1.1 <!DOCTYPE html>
2     <html lang="en" class="formal-specification status-work-in-progress">
3     <head>
4 wakaba 1.2 <title>manakai's XML Conformance Checking</title>
5 wakaba 1.1 <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec">
6     <link rel="license" href="http://suika.fam.cx/c/gnu/fdl">
7 wakaba 1.6 <style>
8     a[id]::before {
9     content: "[" attr(id) "]";
10     color: gray;
11     font-size: 70%;
12     font-family: Courier New, monospace;
13     vertical-align: 60%;
14     }
15     </style>
16 wakaba 1.1 </head>
17     <body class="has-abstract">
18    
19     <div class="header">
20 wakaba 1.2 <h1>manakai's XML Conformance Checking</h1>
21 wakaba 1.9 <h2>Working Draft <time datetime=2007-11-13>13 November 2007</time></h2>
22 wakaba 1.1
23 wakaba 1.2 <dl class="versions-uri">
24 wakaba 1.1 <dt>This Version</dt>
25 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work"
26     >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>&gt;</code></dd>
27 wakaba 1.1 <dt>Latest Version</dt>
28 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc"
29     >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc</a>&gt;</code></dd>
30 wakaba 1.1 <dt>Latest Working Draft</dt>
31 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work"
32     >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>&gt;</code></dd>
33 wakaba 1.1 <!-- <dt>Previous Version</dt> -->
34     <dt>Version History</dt>
35 wakaba 1.2 <dd><code class=URI>&lt;<a href="http://suika.fam.cx/gate/cvs/markup/xml/xmlcc/xmlcc-work.en.html">http://suika.fam.cx/gate/cvs/markup/xml/xmlcc/xmlcc-work.en.html</a>&gt;</code></dd>
36 wakaba 1.1 </dl>
37     <dl class="authors" id="author">
38     <dt>Author</dt>
39     <dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author"
40     lang=ja>Wakaba</a>
41     <code class="mail">&lt;<a href="mailto:w@suika.fam.cx" rel="author"
42     >w@suika.fam.cx</a>&gt;</code></dd>
43     </dl>
44    
45     <p class="copyright" lang="en">&#xA9; <time>2007</time> <a
46     href="http://suika.fam.cx/~wakaba/who?" rel="author">Wakaba</a>.
47     Permission is granted to copy, distribute and/or modify this document
48     under the terms of the <a rel="license"
49     href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>,
50     Version 1.2
51     or any later version published by the <a
52     href="http://www.fsf.org/">Free Software Foundation</a>;
53     with no Invariant Sections, no Front$B!>(BCover Texts, and no Back$B!>(BCover
54     Texts. A copy of the license is
55     available at <code class="URI">&lt;<a
56     href="http://www.gnu.org/copyleft/fdl.html"
57     rel="license">http://www.gnu.org/copyleft/fdl.html</a>&gt;</code>.</p>
58     </div>
59    
60     <div id="abstract" class="section">
61     <h2>Abstract</h2>
62    
63     <div class="ed issue">...</div>
64    
65     </div>
66    
67     <div id="status" class="section">
68     <h2>Status of This Document</h2>
69    
70     <p class=section-info><em>This section describes the status of this document
71     at the time of its publication. Other documents
72     might supersede this document.</em></p>
73    
74     <p>This document is a working draft, produced as part of the
75     <a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a>
76     subproject of the
77     <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a>
78     project. It might be updated, replaced, or obsoleted by
79     other documents at any time. It is inappropriate to
80     cite this document as other than <q>work in progress</q>.</p>
81    
82     <p>Comments on this document are welcome and
83     may be sent to the <a href="#author">author</a>.</p>
84    
85     <p>Translations of thie document might be available.
86     The English version of the document is the only
87     normative version.</p>
88     </div>
89    
90     <div id="introduction" class="section">
91     <h2>Introduction</h2>
92    
93     <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>
94    
95     <div class="issue ed">...</div>
96    
97    
98     </div>
99    
100     <div class="section" id="terminology">
101     <h2>Terminology</h2>
102    
103     <p>The key words <q><em class="rfc2119">MUST</em></q>,
104     <q><em class="rfc2119">MUST NOT</em></q>,
105     <q><em class="rfc2119">SHOULD</em></q>,
106     <q><em class="rfc2119">SHOULD NOT</em></q>, and
107     <q><em class=rfc2119>MAY</em></q> in this
108     document are to be interpreted as described in
109     <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>
110     2119</a>
111     <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>
112    
113     <!-- Strictly speaking the paragraph below is not part of terminology. -->
114     <p>All examples and notes in this specification are non$B!>(Bnormative,
115     as are all sections explicitly marked non$B!>(Bnormative. Everything
116     else in this specification is normative.</p>
117    
118     <p><span class=ed>Algorithm is normative but non-normative</span>.
119     In addition, the order in which <a href="#errors">errors</a> are
120     raised is undefined.</p>
121     </div>
122    
123 wakaba 1.9 <div class="section" id=checking-dom>
124     <h2>Checking <abbr>DOM</abbr></h2>
125 wakaba 1.1
126     <p>The following algorithms and definitions are applied to
127     <abbr>XML</abbr> documents; especially, they are not applied
128     to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>
129    
130 wakaba 1.9 <div class=section id=error-categories>
131     <h3>Error Classification</h3>
132    
133 wakaba 1.1 <p class=ed>If a <code>Document</code> node has no
134     xml-well-formedness-error, entity-error, and unknown-error,
135     then it is well-formed. If a well-formed <code>Document</code>
136     node has no xml-validity-error, it is valid.</p>
137    
138     <div class="note memo">
139     <p>A well$B!>(Bformed <code>Document</code> can be safely serialized
140     into a well$B!>(Bformed XML document. A valid <code>Document</code>
141     can be easily serialized into a valid XML document.</p>
142     </div>
143    
144     <p>Errors are classified into these
145     <dfn id=error-category title="error category">error categories</dfn>:</p>
146    
147     <dl id=errors>
148     <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>
149 wakaba 1.4 <dd>
150     <p class=ed>@@</p>
151     <div class="note memo">
152     <p>This <span class=ed>algorithm</span> does not support
153     <abbr>DOM</abbr> tree with one or more <code>EntityReference</code>
154     nodes. It is expected that any entity references are expanded
155     at the parse time and any unexpandable entity references
156     make parse time errors raised so that never result in
157     <abbr>DOM</abbr> tree with <code>EntityReference</code> nodes.</p>
158     </div>
159     </dd>
160 wakaba 1.1 <dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt>
161     <dd class=ed>@@</dd>
162     <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>
163     <dd class=ed>@@</dd>
164     <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>
165     <dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0
166     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>
167     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> /
168     <abbr>XML</abbr> 1.1
169     <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>
170     <a href="@@/#dt-error">error</a>)
171     that is not classified to any other <a href="#error-category">error
172     category</a>.</dd>
173     <dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt>
174     <dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0
175     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>
176     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal
177     error</a> / <abbr>XML</abbr> 1.1
178     <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>
179     <a href="@@/#dt-fatal">fatal error</a>)
180     that is not classified to any other <a href="#error-category">error
181     category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>
182     <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>
183     <dd>A violation of validity constraint in XML document.</dd>
184     <dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt>
185     <dd><p>If an <code>xml-well-formedness-error</code> is raised,
186     it would not be possible to generate an XML serialization that
187     would match to the appropriate production rule and that would not
188     violate to any well$B!>(Bformedness constraint in XML
189     specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
190     <a href="#ref-XML11">XML11</a>]</cite>.</p></dd>
191     </dl>
192    
193     <div class=ed><p>@@ TODO: #dt-atuseroption at user option
194     (MAY or MUST), #dt-compat for compatibility,
195     #dt-interop for interoperability</p></div>
196    
197 wakaba 1.9 </div>
198    
199     <div class=section id=definitions>
200     <h3>Definitions</h3>
201    
202 wakaba 1.1 <p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is
203     the <abbr>XML</abbr> version of the document to which the node belongs.
204     For a <code>Documemt</code> node, the <abbr>XML</abbr> version
205     of the document is the value of the <code>xmlVersion</code>
206 wakaba 1.9 attribute of the node. For a <code>DocumentType</code> node whose
207     <code>ownerDocument</code> attribute is set to <code>null</code>,
208     the <abbr>XML</abbr> version of the document is <code>1.0</code><!--
209     since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->.
210 wakaba 1.1 For any other node, the <abbr>XML</abbr> version of the document
211     is that of the <code>Document</code> node contained in the
212     <code>ownerDocument</code> attribute of the node.</p>
213    
214 wakaba 1.9 </div>
215    
216 wakaba 1.10
217     <div class=section id=checking-components>
218     <h3>Checking Components</h3>
219    
220     <p>The algorithm
221     <dfn id=algorithm-to-validate-an-xml-character-data title-"to validate an XML character data">to
222     validate an <abbr>XML</abbr> character data
223     (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>
224     <ol>
225 wakaba 1.11 <li>If <var>s</var> contains a character that is <em>not</em> in
226     the character class <a href="#class-Char10"><code>Char10</code></a>,
227     then raise an
228     <a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li>
229     <li>If <var>s</var> contains a character that is in the character
230     class <a href="#class-CompatChar10"><code>CompatChar10</code></a>,
231     then raise an
232     <a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li>
233     <li>If <var>s</var> contains a character that is in the character
234     class <a href="#class-ControlChar10"><code>ControlChar10</code></a>,
235     then raise an
236     <a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li>
237     <li class=ed>@@ XML 1.1 support</li>
238     <li class=ed>@@ If U+000D, round-trip-error</li>
239 wakaba 1.10 </ol>
240    
241     <p>The algorithm
242     <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
243     <code>Name</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> is defined
244     as following:</p>
245     <ol>
246     <li class=ed>@@</li>
247     </ol>
248    
249     <p>The algorithm
250     <dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to
251     validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn>
252     is defined as following:</p>
253     <ol>
254     <li class=ed>@@</li>
255     </ol>
256    
257     <p>To <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate
258     a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the
259     algorithm below <em class=rfc2119>MUST</em> be used:</p>
260     <ol>
261     <li>If <var>pid</var> contains any character
262     that is outside of the range of <code>#x20 | #xD | #xA |
263     [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,
264     then it is an
265     <a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li>
266     <li>If <var>pid</var> contains one of <code class=char>U+0009</code>
267     <code class=charname>CHARACTER TABULATION</code>,
268     <code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>,
269     and <code class=char>U+000D</code> <code class=charname>LINE FEED</code>
270     characters, if the first character of <var>pid</var> is
271     <code class=char>U+0020</code> <code class=charname>SPACE</code> character,
272     if the last character of <var>pid</var> is <code class=char>U+0020</code>
273     <code class=charname>SPACE</code> character, or if there is a
274     <code class=char>U+0020</code> <code class=charname>SPACE</code> character
275     immediately followed by another <code class=char>U+0020</code>
276     <code class=charname>SPACE</code> character in <var>pid</var>, then it is a
277     <a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>.</li>
278     <li class=ed>@@ Should we check formal-public-identifierness?</li>
279     </ol>
280    
281     </div>
282    
283 wakaba 1.9 <div class=section id=checking-node>
284     <h3>Checking <code>Node</code></h3>
285    
286 wakaba 1.1 <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to
287     check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as
288     following:</p>
289     <dl class=switch>
290     <dt>If <var>n</var> is an <code>Attr</code> node</dt>
291     <dd>
292     <ol>
293     <li><a href="#algorithm-to-validate-a-ncname">Validate the
294     <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
295     <li>If the <code>prefix</code> attribute value is different from
296     <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
297     the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
298 wakaba 1.8 <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the
299 wakaba 1.4 <code>childNodes</code> list of <var>n</var>,
300 wakaba 1.8 <ol>
301     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
302     <code>Text</code> or <code>EntityReference</code> node, then it is an
303     <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>
304     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
305     <code>EntityReference</code> node, then it is an
306     <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>
307     <li>Otherwise,
308     <a href="#algorithm-to-check-a-node" title="check a node">check
309     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
310     </ol></li>
311 wakaba 1.1 <li class=ed>@@ <code>specified</code>,
312     <code>manakaiAttributeType</code></li>
313     </ol>
314     </dd>
315     <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
316 wakaba 1.8 <dd>
317     <ol>
318     <li class=ed></li>
319     <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the
320     <code>childNodes</code> list of <var>n</var>,
321     <ol>
322     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
323     <code>Text</code> or <code>EntityReference</code> node, then it is an
324     <a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li>
325     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
326     <code>EntityReference</code> node, then it is an
327     <a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li>
328     <li>Otherwise,
329     <a href="#algorithm-to-check-a-node" title="check a node">check
330     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
331     </ol></li>
332     </ol>
333     </dd>
334 wakaba 1.1 <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>
335     <dd>
336     <ol>
337     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
338     <code>data</code> attribute value as an <abbr>XML</abbr> character
339     data</a>.</li>
340     <li>If the <code>data</code> attribute value contains
341 wakaba 1.8 a string <code>]]></code>, then it is an
342 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.</li>
343     <li>If the <code>childNodes</code> list of <var>n</var> contains
344     any nodes, they are in
345 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>
346 wakaba 1.1 </ol>
347     </dd>
348     <dt>If <var>n</var> is a <code>Comment</code> node</dt>
349     <dd>
350     <ol>
351     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
352     <code>data</code> attribute value as an <abbr>XML</abbr> character
353     data</a>.</li>
354     <li>If the <code>data</code> attribute value contains
355     a string <code>--</code>, or if it ends with a character
356 wakaba 1.8 <code>-</code>, then it is an
357 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.</li>
358     <li>If the <code>childNodes</code> list of <var>n</var> contains
359     any nodes, they are in
360 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>
361 wakaba 1.1 </ol>
362     </dd>
363     <dt>If <var>n</var> is a <code>Document</code> node</dt>
364     <dd>
365     <ol>
366     <li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var>
367     is different from <code>1.0</code> or <code>1.1</code>,
368     then it is an <code class=ed>unknown-error?</code>.</li>
369     <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>
370     match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>
371 wakaba 1.8 <span class=ed>@@ formal def</span>, then it is an
372 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li>
373     <li>The <code>childNodes</code> list of <var>n</var> have to
374     consist of zero or more <code>Comment</code> and/or
375     <code>ProcessingInstruction</code> nodes, followed by
376     an optional <code>DocumentType</code> node, followed
377     by zero or more <code>Comment</code> and/or
378     <code>ProcessingInstruction</code> nodes, followed by
379     an <code>Element</code> node, followed
380     by zero or more <code>Comment</code> and/or
381 wakaba 1.8 <code>ProcessingInstruction</code> nodes. Any violation to this is an
382 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>
383 wakaba 1.8 <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>
384     in the <code>childNodes</code> list of <var>n</var>,
385     <ol>
386     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
387     <code>EntityReference</code> node, then
388     <a href="#algorithm-to-check-a-node" title="check a node">check
389     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
390     </ol></li>
391 wakaba 1.1 <li class=ed>@@ <code>allDeclarationsProcessed</code></li>
392     </ol>
393     </dd>
394     <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>
395     <dd>
396     <ol>
397 wakaba 1.8 <li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn>
398     in the <code>childNodes</code> list of <var>n</var>,
399     <ol>
400     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
401     <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,
402     <code>Comment</code>, <code>ProcessingInstruction</code>, or
403     <code>EntityReference</code> node, then it is an
404     <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>
405     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
406     <code>EntityReference</code> node, then it is an
407     <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>
408     <li>Otherwise,
409     <a href="#algorithm-to-check-a-node" title="check a node">check
410     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
411     </ol></li>
412 wakaba 1.1 </ol>
413     </dd>
414     <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>
415     <dd>
416     <ol>
417     <li><a href="#algorithm-to-validate-a-ncname">Validate the
418     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
419 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
420     the <code>publicId</code> attribute value as a public identifier</a>.</li>
421 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
422     both <code>"</code> and <code>'</code> characters, it is a
423     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
424     <!-- publicId = non-null and systemId = null -->
425 wakaba 1.8 <li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn>
426     in the <code>childNodes</code> list of <var>n</var>,
427     <ol>
428     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
429     <code>ProcessingInstruction</code> node, then it is an
430     <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.
431     <span class=ed>@@ ref to manakai's extensions</span></li>
432     <li>Otherwise, <!-- if n_c is not an EntityReference node, -->
433     <a href="#algorithm-to-check-a-node" title="check a node">check
434     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
435     </ol></li>
436 wakaba 1.1 <li class=ed>@@ <code>entities</code>, <code>notations</code>,
437     <code>elementTypes</code>, externally declared?</li>
438     </ol>
439     </dd>
440     <dt>If <var>n</var> is an <code>Element</code> node</dt>
441     <dd>
442     <ol>
443     <li><a href="#algorithm-to-validate-a-ncname">Validate the
444     <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
445     <li>If the <code>prefix</code> attribute value is different from
446     <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
447     the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
448 wakaba 1.8 <li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn>
449     in the <code>childNodes</code> list of <var>n</var>,
450     <ol>
451     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
452     <code>Element</code>,
453     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
454     <code>ProcessingInstruction</code>, or
455     <code>EntityReference</code> node, then it is an
456     <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>
457     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
458     <code>EntityReference</code> node, then it is an
459     <a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li>
460     <li>Otherwise,
461     <a href="#algorithm-to-check-a-node" title="check a node">check
462     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
463     </ol></li>
464     </ol>
465     </dd>
466     <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>
467     <dd>
468     <ol>
469     <li class=ed></li>
470 wakaba 1.1 <li>If the <code>childNodes</code> list of <var>n</var> contains
471 wakaba 1.8 any nodes, they are in
472     <a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li>
473 wakaba 1.1 </ol>
474     </dd>
475     <dt>If <var>n</var> is an <code>Entity</code> node</dt>
476     <dd>
477     <ol>
478     <li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li>
479     <li><a href="#algorithm-to-validate-a-ncname">Validate the
480     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
481 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
482     the <code>publicId</code> attribute value as a public identifier</a>.</li>
483 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
484     both <code>"</code> and <code>'</code> characters, it is a
485     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
486     <!-- publicId = non-null and systemId = null -->
487     <li class=ed>@@ <code>notationName</code></li>
488 wakaba 1.8 <li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn>
489     in the <code>childNodes</code> list of <var>n</var>,
490     <ol>
491     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
492     <code>Element</code>,
493     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
494     <code>ProcessingInstruction</code>, or <code>EntityReference</code>
495     node, then it is an
496     <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>
497     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
498     <code>EntityReference</code> node, then it is an
499     <a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li>
500     <li>Otherwise,
501     <a href="#algorithm-to-check-a-node" title="check a node">check
502     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
503     </ol></li>
504 wakaba 1.1 </ol>
505     </dd>
506     <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>
507     <dd>
508     <ol>
509     <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>
510     <li><a href="#algorithm-to-validate-a-ncname">Validate the
511     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
512 wakaba 1.8 <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>
513     in the <code>childNodes</code> list of <var>n</var>,
514     <ol>
515     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
516     <code>Element</code>,
517     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
518     <code>ProcessingInstruction</code>, or <code>EntityReference</code>
519     node, then it is an
520     <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>
521     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an
522     <code>EntityReference</code> node, then it is an
523     <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>
524     <li>Otherwise,
525     <a href="#algorithm-to-check-a-node" title="check a node">check
526     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
527     </ol></li>
528 wakaba 1.1 </ol>
529     </dd>
530     <dt>If <var>n</var> is a <code>Notation</code> node</dt>
531     <dd>
532     <ol>
533     <li><a href="#algorithm-to-validate-a-ncname">Validate the
534     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
535 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
536     the <code>publicId</code> attribute value as a public identifier</a>.</li>
537 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
538     both <code>"</code> and <code>'</code> characters, it is a
539     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
540     <li>If the <code>childNodes</code> list of <var>n</var> contains
541     any nodes, they are in
542 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>
543 wakaba 1.1 </ol>
544     </dd>
545     <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
546     <dd>
547     <ol>
548     <li><a href="#algorithm-to-validate-a-ncname">Validate the
549     <code>target</code> attribute value as an <code>NCName</code></a>.</li>
550     <li>If the <code>target</code> attribute value matches to
551     <code>XML</code> case-insensitively, then it is a
552     <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>
553     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
554     <code>data</code> attribute value as an <abbr>XML</abbr> character
555     data</a>.</li>
556     <li>If the <code>data</code> attribute value contains
557     a string <code>?></code>, or starts with either
558     <code class=char>U+0009</code>, <code class=char>U+000A</code>,
559     <code class=char>U+000D</code>, or <code class=char>U+0020</code>
560     character, then it is a
561     <a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li>
562     <li>If the <code>childNodes</code> list of <var>n</var> contains
563     any nodes, they are in
564 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>
565 wakaba 1.1 </ol>
566     </dd>
567     <dt>If <var>n</var> is a <code>Text</code> node</dt>
568     <dd>
569     <ol>
570     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
571     <code>data</code> attribute value as an <abbr>XML</abbr> character
572     data</a>.</li>
573     <li>If the <code>childNodes</code> list of <var>n</var> contains
574     any nodes, they are in
575 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li>
576 wakaba 1.1 </ol>
577     </dd>
578     <dt>Otherwise</dt>
579     <dd><span class=ed>xml-well-formedness-error? unknown-error?</span></dd>
580     </dl>
581    
582 wakaba 1.11 </div>
583    
584     </div>
585    
586     <div id=classes class=section>
587     <h2>Character Classes</h2>
588    
589     <p>This section defines a couple of character classes.
590     These classes are referred to by algorithms specified above.</p>
591    
592     <p>Character class <dfn id=class-Char10><code>Char10</code></dfn>
593     contains the following characters:</p>
594     <ul>
595     <li><code class=char>U+0009</code> <code class=charname>CHARACTER
596     TABULATION</code></li>
597     <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>
598     <li><code class=char>U+000D</code> <code class=charname>CARRIAGE
599     RETURN</code></li>
600     <li><code class=char>U+0020</code> <code class=charname>SPACE</code>
601     .. <code class=char>U+D7FF</code></li>
602     <li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code>
603     <code class=charname>REPLACEMENT CHARACTER</code></li>
604     <li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li>
605     </ul>
606     <div class="note memo">
607     <p>This character class contains all characters allowed in the production rule
608     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>
609     of <abbr>XML</abbr> 1.0
610     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>
611     </div>
612    
613     <p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn>
614     contains the following characters:</p>
615     <ul>
616     <li class=ed>@@ <q>Document authors are encouraged to avoid "compatibility characters", as defined in section 6.8 of [Unicode @@ Unicode 2.0 @@] (see also D21 in section 3.6 of [Unicode3]).</q></li>
617     </ul>
618    
619     <p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn>
620     contains the following characters:</p>
621     <ul>
622     <li><code class=char>U+007F</code> <code class=charname>DELETE</code> ..
623     <code class=char>U+0084</code> <code class=charname>INDEX</code></li>
624     <li><code class=char>U+0086</code> <code class=charname>START OF SELECTED
625     AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION
626     PROGRAM COMMAND</code></li>
627     <li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li>
628     <li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li>
629     <li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li>
630     <li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li>
631     <li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li>
632     <li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li>
633     <li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li>
634     <li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li>
635     <li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li>
636     <li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li>
637     <li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li>
638     <li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li>
639     <li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li>
640     <li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li>
641     <li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li>
642     <li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li>
643     <li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li>
644     </ul>
645     <div class="note memo">
646     <p>This character class contains the characters listed in the Note in
647     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>
648     of <abbr>XML</abbr> 1.0
649     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,
650     as amended by
651     <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>
652 wakaba 1.1 </div>
653    
654     </div>
655    
656     <div id="references" class="section reference">
657     <h2>References</h2>
658    
659     <div id="normative-references" class="section normative reference">
660     <h3>Normative References</h3>
661    
662     <dl>
663 wakaba 1.3 <dt id=ref-DOM3CORE>DOM3CORE</dt>
664     <dd class=ed>@@ W3C DOM Level 3 Core</dd>
665     <dt id=ref-DOMDTDEF>DOMDTDEF</dt>
666     <dd class=ed>@@ manakai's extension to DOM for document type definitions</dd>
667 wakaba 1.1 <dt id="ref-KEYWORDS">KEYWORDS</dt>
668     <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
669     <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
670     <abbr title="Internet Engineering Task Force">IETF</abbr>
671     <a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr>
672     14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,
673     <time datetime=1997-03>March 1997</time>.
674     <em>This</em> version of the specification is referenced.</dd>
675     <dt id=ref-INFOSET>INFOSET</dt>
676     <dd class=ed>@@</dd>
677     <dt id=ref-XML10">XML10</dt>
678     <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible
679     Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,
680     <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
681     2006</time>, edited in place <time datetime=2006-09-29>29 September
682     2006</time>. Tje latest version of the specification is available at
683     <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.
684     <em>This</em> version of the specification is referenced.</dd>
685     <dt id=ref-XML11>XML11</dt>
686     <dd class=ed>@@</dd>
687     </dl>
688     </div>
689    
690     <div id="informative-references" class="section informative reference">
691     <h3>Non$B!>(Bnormative References</h3>
692    
693     <dl class=ed>
694     <dt id=ref-CSS>CSS</dt>
695     <dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading
696     Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1)
697     Specification</a></cite>,
698     <abbr title="World Wide Web Consortium">W3C</abbr> Candidate
699     Recommendation, <time datetime=2007-07-19>19 July 2007</time>.
700     Work in progress. The latest version of the specification is
701     available at
702     <code class=URI>&lt;<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd>
703     <dt id=ref-CSSOM>CSSOM</dt>
704     <dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&amp;content-type=text/html;%20charset=utf-8">Cascading
705     Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>,
706     <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
707     <time datetime=2007-06-18>18 June 2007</time>. Work in progress.
708     The latest Editor's Draft of the specification is available at
709     <code class=URI>&lt;<a href="http://dev.w3.org/csswg/cssom/Overview.html">http://dev.w3.org/csswg/cssom/Overview.html</a>></code>.</dd>
710     <dt id=ref-HTML5>HTML5</dt>
711     <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,
712     <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
713     Working Draft. Work in progress.</dd>
714     <dt id=ref-SAPI>SAPI</dt>
715     <dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&amp;content-type=text/html;%20charset=utf-8">Selectors <abbr>API</abbr></a></cite>,
716     <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
717     <time datetime=2007-08-29>29 August 2007</time>. Work in progress.
718     The latest Editor's Draft of the specification is available at
719     <code class=URI>&lt;<a href="http://dev.w3.org/2006/webapi/selectors-api/Overview.html">http://dev.w3.org/2006/webapi/selectors-api/Overview.html</a>></code>.
720     The latest published version of the specification is available at
721     <code class=URI>&lt;<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd>
722     <dt id=XBL2>XBL2</dt>
723     <dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr>
724     2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>.
725     Work in progress. The latest
726     <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished
727     version of the specification is available at
728     <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>
729 wakaba 1.3 <dt id=ref-XML5>XML5</dt>
730     <dd class=ed>@@</dd>
731 wakaba 1.1 </dl>
732     </div>
733    
734     </div>
735    
736     </body>
737     </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24