/[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.12 - (hide annotations) (download) (as text)
Wed Nov 14 11:40:48 2007 UTC (16 years, 5 months ago) by wakaba
Branch: MAIN
Changes since 1.11: +44 -7 lines
File MIME type: text/html
Sections 2.3-2.5

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.12 <h1>manakai's <abbr>XML</abbr> Conformance Checking</h1>
21     <h2>Working Draft <time datetime=2007-11-14>14 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.12 <div class=section id=parsing-xml>
124     <h2>Parsing <abbr>XML</abbr> Document</h2>
125    
126     <ul>
127     <li>If the replacement text of an entity declaration is
128     <code>&lt;</code>, then raise an
129     <a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!--
130     "strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11].
131     --></li>
132     </ul>
133     </div>
134    
135 wakaba 1.9 <div class="section" id=checking-dom>
136     <h2>Checking <abbr>DOM</abbr></h2>
137 wakaba 1.1
138     <p>The following algorithms and definitions are applied to
139     <abbr>XML</abbr> documents; especially, they are not applied
140     to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>
141    
142 wakaba 1.9 <div class=section id=error-categories>
143     <h3>Error Classification</h3>
144    
145 wakaba 1.1 <p class=ed>If a <code>Document</code> node has no
146     xml-well-formedness-error, entity-error, and unknown-error,
147     then it is well-formed. If a well-formed <code>Document</code>
148     node has no xml-validity-error, it is valid.</p>
149    
150     <div class="note memo">
151     <p>A well$B!>(Bformed <code>Document</code> can be safely serialized
152     into a well$B!>(Bformed XML document. A valid <code>Document</code>
153     can be easily serialized into a valid XML document.</p>
154     </div>
155    
156     <p>Errors are classified into these
157     <dfn id=error-category title="error category">error categories</dfn>:</p>
158    
159     <dl id=errors>
160     <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>
161 wakaba 1.4 <dd>
162     <p class=ed>@@</p>
163     <div class="note memo">
164     <p>This <span class=ed>algorithm</span> does not support
165     <abbr>DOM</abbr> tree with one or more <code>EntityReference</code>
166     nodes. It is expected that any entity references are expanded
167     at the parse time and any unexpandable entity references
168     make parse time errors raised so that never result in
169     <abbr>DOM</abbr> tree with <code>EntityReference</code> nodes.</p>
170     </div>
171     </dd>
172 wakaba 1.1 <dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt>
173     <dd class=ed>@@</dd>
174 wakaba 1.12 <dt><dfn id=round-trip-warning><code>round-trip-warning</code></dfn></dt>
175     <dd>
176     <p>A <a href="#round-trip-warning"><code>round-trip-warning</code></a>
177     will be raised when a construct, which might not be restored to the same
178     construct when it is serialized and then re-parsed by a conforming
179     processor, is encountered.</p>
180     <div class="example memo">
181     <p>For a <code>Comment</code> node a
182     <a href="#round-trip-warning"><code>round-trip-warning</code></a> will
183     be raised, since <abbr>XML</abbr> processors are not required to
184     report texts of comments for applications.</p>
185     </div>
186     </dd>
187 wakaba 1.1 <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>
188     <dd class=ed>@@</dd>
189     <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>
190     <dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0
191     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>
192     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> /
193     <abbr>XML</abbr> 1.1
194     <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>
195     <a href="@@/#dt-error">error</a>)
196     that is not classified to any other <a href="#error-category">error
197     category</a>.</dd>
198     <dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt>
199     <dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0
200     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>
201     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal
202     error</a> / <abbr>XML</abbr> 1.1
203     <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>
204     <a href="@@/#dt-fatal">fatal error</a>)
205     that is not classified to any other <a href="#error-category">error
206     category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>
207     <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>
208     <dd>A violation of validity constraint in XML document.</dd>
209     <dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt>
210     <dd><p>If an <code>xml-well-formedness-error</code> is raised,
211     it would not be possible to generate an XML serialization that
212     would match to the appropriate production rule and that would not
213     violate to any well$B!>(Bformedness constraint in XML
214     specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
215     <a href="#ref-XML11">XML11</a>]</cite>.</p></dd>
216     </dl>
217    
218     <div class=ed><p>@@ TODO: #dt-atuseroption at user option
219     (MAY or MUST), #dt-compat for compatibility,
220     #dt-interop for interoperability</p></div>
221    
222 wakaba 1.9 </div>
223    
224     <div class=section id=definitions>
225     <h3>Definitions</h3>
226    
227 wakaba 1.1 <p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is
228     the <abbr>XML</abbr> version of the document to which the node belongs.
229     For a <code>Documemt</code> node, the <abbr>XML</abbr> version
230     of the document is the value of the <code>xmlVersion</code>
231 wakaba 1.9 attribute of the node. For a <code>DocumentType</code> node whose
232     <code>ownerDocument</code> attribute is set to <code>null</code>,
233     the <abbr>XML</abbr> version of the document is <code>1.0</code><!--
234     since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->.
235 wakaba 1.1 For any other node, the <abbr>XML</abbr> version of the document
236     is that of the <code>Document</code> node contained in the
237     <code>ownerDocument</code> attribute of the node.</p>
238    
239 wakaba 1.9 </div>
240    
241 wakaba 1.10
242     <div class=section id=checking-components>
243     <h3>Checking Components</h3>
244    
245     <p>The algorithm
246     <dfn id=algorithm-to-validate-an-xml-character-data title-"to validate an XML character data">to
247     validate an <abbr>XML</abbr> character data
248     (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>
249     <ol>
250 wakaba 1.11 <li>If <var>s</var> contains a character that is <em>not</em> in
251     the character class <a href="#class-Char10"><code>Char10</code></a>,
252     then raise an
253     <a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li>
254     <li>If <var>s</var> contains a character that is in the character
255     class <a href="#class-CompatChar10"><code>CompatChar10</code></a>,
256     then raise an
257     <a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li>
258     <li>If <var>s</var> contains a character that is in the character
259     class <a href="#class-ControlChar10"><code>ControlChar10</code></a>,
260     then raise an
261     <a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li>
262     <li class=ed>@@ XML 1.1 support</li>
263     <li class=ed>@@ If U+000D, round-trip-error</li>
264 wakaba 1.10 </ol>
265    
266     <p>The algorithm
267     <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
268 wakaba 1.12 <code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn> is defined
269 wakaba 1.10 as following:</p>
270     <ol>
271 wakaba 1.12 <li>If <var>s</var> begins with the string <code>xml</code> (in any
272     case combination), then raise an
273     <a href="#xml-misc-warning" id=xmw-reserved-name><code>xml-misc-warning</code></a>.
274     <span class=ed>@@ except for attribute names <code>xml:lang</code>,
275     <code>xml:space</code>, <code>xml:base</code>, <code>xml:id</code>,
276     <code>xmlns</code>, <code>xmlns:<var>*</var></code>,
277     pi name <code>xml-stylesheet</code>.</span></li>
278     <!-- COLON in Name is a lowercase "should not" in a Note of [XML10],
279     [XML11]. -->
280 wakaba 1.10 <li class=ed>@@</li>
281     </ol>
282    
283     <p>The algorithm
284     <dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to
285     validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn>
286     is defined as following:</p>
287     <ol>
288     <li class=ed>@@</li>
289     </ol>
290    
291     <p>To <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate
292     a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the
293     algorithm below <em class=rfc2119>MUST</em> be used:</p>
294     <ol>
295     <li>If <var>pid</var> contains any character
296     that is outside of the range of <code>#x20 | #xD | #xA |
297     [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,
298     then it is an
299     <a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li>
300     <li>If <var>pid</var> contains one of <code class=char>U+0009</code>
301     <code class=charname>CHARACTER TABULATION</code>,
302     <code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>,
303     and <code class=char>U+000D</code> <code class=charname>LINE FEED</code>
304     characters, if the first character of <var>pid</var> is
305     <code class=char>U+0020</code> <code class=charname>SPACE</code> character,
306     if the last character of <var>pid</var> is <code class=char>U+0020</code>
307     <code class=charname>SPACE</code> character, or if there is a
308     <code class=char>U+0020</code> <code class=charname>SPACE</code> character
309     immediately followed by another <code class=char>U+0020</code>
310     <code class=charname>SPACE</code> character in <var>pid</var>, then it is a
311     <a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>.</li>
312     <li class=ed>@@ Should we check formal-public-identifierness?</li>
313     </ol>
314    
315     </div>
316    
317 wakaba 1.9 <div class=section id=checking-node>
318     <h3>Checking <code>Node</code></h3>
319    
320 wakaba 1.1 <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to
321     check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as
322     following:</p>
323     <dl class=switch>
324     <dt>If <var>n</var> is an <code>Attr</code> node</dt>
325     <dd>
326     <ol>
327     <li><a href="#algorithm-to-validate-a-ncname">Validate the
328     <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
329     <li>If the <code>prefix</code> attribute value is different from
330     <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
331     the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
332 wakaba 1.8 <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the
333 wakaba 1.4 <code>childNodes</code> list of <var>n</var>,
334 wakaba 1.8 <ol>
335     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
336     <code>Text</code> or <code>EntityReference</code> node, then it is an
337     <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>
338     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
339     <code>EntityReference</code> node, then it is an
340     <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>
341     <li>Otherwise,
342     <a href="#algorithm-to-check-a-node" title="check a node">check
343     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
344     </ol></li>
345 wakaba 1.1 <li class=ed>@@ <code>specified</code>,
346     <code>manakaiAttributeType</code></li>
347     </ol>
348     </dd>
349     <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
350 wakaba 1.8 <dd>
351     <ol>
352     <li class=ed></li>
353     <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the
354     <code>childNodes</code> list of <var>n</var>,
355     <ol>
356     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
357     <code>Text</code> or <code>EntityReference</code> node, then it is an
358     <a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li>
359     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
360     <code>EntityReference</code> node, then it is an
361     <a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li>
362     <li>Otherwise,
363     <a href="#algorithm-to-check-a-node" title="check a node">check
364     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
365     </ol></li>
366     </ol>
367     </dd>
368 wakaba 1.1 <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>
369     <dd>
370     <ol>
371     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
372     <code>data</code> attribute value as an <abbr>XML</abbr> character
373     data</a>.</li>
374     <li>If the <code>data</code> attribute value contains
375 wakaba 1.12 a string <code>]]></code>, then raise an
376     <a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.<!-- "for compatibility" --></li>
377 wakaba 1.1 <li>If the <code>childNodes</code> list of <var>n</var> contains
378     any nodes, they are in
379 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>
380 wakaba 1.1 </ol>
381     </dd>
382     <dt>If <var>n</var> is a <code>Comment</code> node</dt>
383     <dd>
384     <ol>
385 wakaba 1.12 <li>Raise an
386     <a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li>
387 wakaba 1.1 <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
388     <code>data</code> attribute value as an <abbr>XML</abbr> character
389     data</a>.</li>
390     <li>If the <code>data</code> attribute value contains
391     a string <code>--</code>, or if it ends with a character
392 wakaba 1.12 <code>-</code>, then raise an
393     <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.<!--
394     "for compatibility" --></li>
395 wakaba 1.1 <li>If the <code>childNodes</code> list of <var>n</var> contains
396     any nodes, they are in
397 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>
398 wakaba 1.1 </ol>
399     </dd>
400     <dt>If <var>n</var> is a <code>Document</code> node</dt>
401     <dd>
402     <ol>
403     <li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var>
404     is different from <code>1.0</code> or <code>1.1</code>,
405     then it is an <code class=ed>unknown-error?</code>.</li>
406     <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>
407     match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>
408 wakaba 1.8 <span class=ed>@@ formal def</span>, then it is an
409 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li>
410     <li>The <code>childNodes</code> list of <var>n</var> have to
411     consist of zero or more <code>Comment</code> and/or
412     <code>ProcessingInstruction</code> nodes, followed by
413     an optional <code>DocumentType</code> node, followed
414     by zero or more <code>Comment</code> and/or
415     <code>ProcessingInstruction</code> nodes, followed by
416     an <code>Element</code> node, followed
417     by zero or more <code>Comment</code> and/or
418 wakaba 1.8 <code>ProcessingInstruction</code> nodes. Any violation to this is an
419 wakaba 1.1 <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>
420 wakaba 1.8 <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>
421     in the <code>childNodes</code> list of <var>n</var>,
422     <ol>
423     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
424     <code>EntityReference</code> node, then
425     <a href="#algorithm-to-check-a-node" title="check a node">check
426     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
427     </ol></li>
428 wakaba 1.1 <li class=ed>@@ <code>allDeclarationsProcessed</code></li>
429     </ol>
430     </dd>
431     <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>
432     <dd>
433     <ol>
434 wakaba 1.8 <li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn>
435     in the <code>childNodes</code> list of <var>n</var>,
436     <ol>
437     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
438     <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,
439     <code>Comment</code>, <code>ProcessingInstruction</code>, or
440     <code>EntityReference</code> node, then it is an
441     <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>
442     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
443     <code>EntityReference</code> node, then it is an
444     <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>
445     <li>Otherwise,
446     <a href="#algorithm-to-check-a-node" title="check a node">check
447     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
448     </ol></li>
449 wakaba 1.1 </ol>
450     </dd>
451     <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>
452     <dd>
453     <ol>
454     <li><a href="#algorithm-to-validate-a-ncname">Validate the
455     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
456 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
457     the <code>publicId</code> attribute value as a public identifier</a>.</li>
458 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
459     both <code>"</code> and <code>'</code> characters, it is a
460     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
461     <!-- publicId = non-null and systemId = null -->
462 wakaba 1.8 <li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn>
463     in the <code>childNodes</code> list of <var>n</var>,
464     <ol>
465     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
466     <code>ProcessingInstruction</code> node, then it is an
467     <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.
468     <span class=ed>@@ ref to manakai's extensions</span></li>
469     <li>Otherwise, <!-- if n_c is not an EntityReference node, -->
470     <a href="#algorithm-to-check-a-node" title="check a node">check
471     <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
472     </ol></li>
473 wakaba 1.1 <li class=ed>@@ <code>entities</code>, <code>notations</code>,
474     <code>elementTypes</code>, externally declared?</li>
475     </ol>
476     </dd>
477     <dt>If <var>n</var> is an <code>Element</code> node</dt>
478     <dd>
479     <ol>
480     <li><a href="#algorithm-to-validate-a-ncname">Validate the
481     <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
482     <li>If the <code>prefix</code> attribute value is different from
483     <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
484     the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
485 wakaba 1.8 <li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn>
486     in the <code>childNodes</code> list of <var>n</var>,
487     <ol>
488     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
489     <code>Element</code>,
490     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
491     <code>ProcessingInstruction</code>, or
492     <code>EntityReference</code> node, then it is an
493     <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>
494     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
495     <code>EntityReference</code> node, then it is an
496     <a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li>
497     <li>Otherwise,
498     <a href="#algorithm-to-check-a-node" title="check a node">check
499     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
500     </ol></li>
501     </ol>
502     </dd>
503     <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>
504     <dd>
505     <ol>
506     <li class=ed></li>
507 wakaba 1.1 <li>If the <code>childNodes</code> list of <var>n</var> contains
508 wakaba 1.8 any nodes, they are in
509     <a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li>
510 wakaba 1.1 </ol>
511     </dd>
512     <dt>If <var>n</var> is an <code>Entity</code> node</dt>
513     <dd>
514     <ol>
515     <li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li>
516     <li><a href="#algorithm-to-validate-a-ncname">Validate the
517     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
518 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
519     the <code>publicId</code> attribute value as a public identifier</a>.</li>
520 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
521     both <code>"</code> and <code>'</code> characters, it is a
522     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
523     <!-- publicId = non-null and systemId = null -->
524     <li class=ed>@@ <code>notationName</code></li>
525 wakaba 1.8 <li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn>
526     in the <code>childNodes</code> list of <var>n</var>,
527     <ol>
528     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
529     <code>Element</code>,
530     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
531     <code>ProcessingInstruction</code>, or <code>EntityReference</code>
532     node, then it is an
533     <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>
534     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
535     <code>EntityReference</code> node, then it is an
536     <a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li>
537     <li>Otherwise,
538     <a href="#algorithm-to-check-a-node" title="check a node">check
539     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
540     </ol></li>
541 wakaba 1.1 </ol>
542     </dd>
543     <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>
544     <dd>
545     <ol>
546     <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>
547     <li><a href="#algorithm-to-validate-a-ncname">Validate the
548     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
549 wakaba 1.8 <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>
550     in the <code>childNodes</code> list of <var>n</var>,
551     <ol>
552     <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
553     <code>Element</code>,
554     <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
555     <code>ProcessingInstruction</code>, or <code>EntityReference</code>
556     node, then it is an
557     <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>
558     <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an
559     <code>EntityReference</code> node, then it is an
560     <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>
561     <li>Otherwise,
562     <a href="#algorithm-to-check-a-node" title="check a node">check
563     <var>n<sub><var>c</var></sub></var></a> recursively.</li>
564     </ol></li>
565 wakaba 1.1 </ol>
566     </dd>
567     <dt>If <var>n</var> is a <code>Notation</code> node</dt>
568     <dd>
569     <ol>
570     <li><a href="#algorithm-to-validate-a-ncname">Validate the
571     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
572 wakaba 1.5 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
573     the <code>publicId</code> attribute value as a public identifier</a>.</li>
574 wakaba 1.1 <li>If the <code>systemId</code> attribute value contains
575     both <code>"</code> and <code>'</code> characters, it is a
576     <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
577     <li>If the <code>childNodes</code> list of <var>n</var> contains
578     any nodes, they are in
579 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>
580 wakaba 1.1 </ol>
581     </dd>
582     <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
583     <dd>
584     <ol>
585     <li><a href="#algorithm-to-validate-a-ncname">Validate the
586     <code>target</code> attribute value as an <code>NCName</code></a>.</li>
587     <li>If the <code>target</code> attribute value matches to
588     <code>XML</code> case-insensitively, then it is a
589     <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>
590     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
591     <code>data</code> attribute value as an <abbr>XML</abbr> character
592     data</a>.</li>
593     <li>If the <code>data</code> attribute value contains
594     a string <code>?></code>, or starts with either
595     <code class=char>U+0009</code>, <code class=char>U+000A</code>,
596     <code class=char>U+000D</code>, or <code class=char>U+0020</code>
597     character, then it is a
598     <a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li>
599     <li>If the <code>childNodes</code> list of <var>n</var> contains
600     any nodes, they are in
601 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>
602 wakaba 1.1 </ol>
603     </dd>
604     <dt>If <var>n</var> is a <code>Text</code> node</dt>
605     <dd>
606     <ol>
607     <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
608     <code>data</code> attribute value as an <abbr>XML</abbr> character
609     data</a>.</li>
610     <li>If the <code>childNodes</code> list of <var>n</var> contains
611     any nodes, they are in
612 wakaba 1.8 <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li>
613 wakaba 1.1 </ol>
614     </dd>
615     <dt>Otherwise</dt>
616     <dd><span class=ed>xml-well-formedness-error? unknown-error?</span></dd>
617     </dl>
618    
619 wakaba 1.11 </div>
620    
621     </div>
622    
623     <div id=classes class=section>
624     <h2>Character Classes</h2>
625    
626     <p>This section defines a couple of character classes.
627     These classes are referred to by algorithms specified above.</p>
628    
629     <p>Character class <dfn id=class-Char10><code>Char10</code></dfn>
630     contains the following characters:</p>
631     <ul>
632     <li><code class=char>U+0009</code> <code class=charname>CHARACTER
633     TABULATION</code></li>
634     <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>
635     <li><code class=char>U+000D</code> <code class=charname>CARRIAGE
636     RETURN</code></li>
637     <li><code class=char>U+0020</code> <code class=charname>SPACE</code>
638     .. <code class=char>U+D7FF</code></li>
639     <li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code>
640     <code class=charname>REPLACEMENT CHARACTER</code></li>
641     <li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li>
642     </ul>
643     <div class="note memo">
644     <p>This character class contains all characters allowed in the production rule
645     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>
646     of <abbr>XML</abbr> 1.0
647     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>
648     </div>
649    
650     <p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn>
651     contains the following characters:</p>
652     <ul>
653     <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>
654     </ul>
655    
656     <p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn>
657     contains the following characters:</p>
658     <ul>
659     <li><code class=char>U+007F</code> <code class=charname>DELETE</code> ..
660     <code class=char>U+0084</code> <code class=charname>INDEX</code></li>
661     <li><code class=char>U+0086</code> <code class=charname>START OF SELECTED
662     AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION
663     PROGRAM COMMAND</code></li>
664     <li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li>
665     <li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li>
666     <li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li>
667     <li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li>
668     <li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li>
669     <li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li>
670     <li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li>
671     <li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li>
672     <li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li>
673     <li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li>
674     <li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li>
675     <li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li>
676     <li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li>
677     <li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li>
678     <li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li>
679     <li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li>
680     <li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li>
681     </ul>
682     <div class="note memo">
683     <p>This character class contains the characters listed in the Note in
684     <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>
685     of <abbr>XML</abbr> 1.0
686     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,
687     as amended by
688     <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>
689 wakaba 1.1 </div>
690    
691     </div>
692    
693     <div id="references" class="section reference">
694     <h2>References</h2>
695    
696     <div id="normative-references" class="section normative reference">
697     <h3>Normative References</h3>
698    
699     <dl>
700 wakaba 1.3 <dt id=ref-DOM3CORE>DOM3CORE</dt>
701     <dd class=ed>@@ W3C DOM Level 3 Core</dd>
702     <dt id=ref-DOMDTDEF>DOMDTDEF</dt>
703     <dd class=ed>@@ manakai's extension to DOM for document type definitions</dd>
704 wakaba 1.1 <dt id="ref-KEYWORDS">KEYWORDS</dt>
705     <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
706     <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
707     <abbr title="Internet Engineering Task Force">IETF</abbr>
708     <a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr>
709     14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,
710     <time datetime=1997-03>March 1997</time>.
711     <em>This</em> version of the specification is referenced.</dd>
712     <dt id=ref-INFOSET>INFOSET</dt>
713     <dd class=ed>@@</dd>
714     <dt id=ref-XML10">XML10</dt>
715     <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible
716     Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,
717     <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
718     2006</time>, edited in place <time datetime=2006-09-29>29 September
719     2006</time>. Tje latest version of the specification is available at
720     <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.
721     <em>This</em> version of the specification is referenced.</dd>
722     <dt id=ref-XML11>XML11</dt>
723     <dd class=ed>@@</dd>
724     </dl>
725     </div>
726    
727     <div id="informative-references" class="section informative reference">
728     <h3>Non$B!>(Bnormative References</h3>
729    
730     <dl class=ed>
731     <dt id=ref-CSS>CSS</dt>
732     <dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading
733     Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1)
734     Specification</a></cite>,
735     <abbr title="World Wide Web Consortium">W3C</abbr> Candidate
736     Recommendation, <time datetime=2007-07-19>19 July 2007</time>.
737     Work in progress. The latest version of the specification is
738     available at
739     <code class=URI>&lt;<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd>
740     <dt id=ref-CSSOM>CSSOM</dt>
741     <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
742     Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>,
743     <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
744     <time datetime=2007-06-18>18 June 2007</time>. Work in progress.
745     The latest Editor's Draft of the specification is available at
746     <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>
747     <dt id=ref-HTML5>HTML5</dt>
748     <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,
749     <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
750     Working Draft. Work in progress.</dd>
751     <dt id=ref-SAPI>SAPI</dt>
752     <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>,
753     <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
754     <time datetime=2007-08-29>29 August 2007</time>. Work in progress.
755     The latest Editor's Draft of the specification is available at
756     <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>.
757     The latest published version of the specification is available at
758     <code class=URI>&lt;<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd>
759     <dt id=XBL2>XBL2</dt>
760     <dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr>
761     2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>.
762     Work in progress. The latest
763     <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished
764     version of the specification is available at
765     <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>
766 wakaba 1.3 <dt id=ref-XML5>XML5</dt>
767     <dd class=ed>@@</dd>
768 wakaba 1.1 </dl>
769     </div>
770    
771     </div>
772    
773     </body>
774     </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24