/[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.10 - (show annotations) (download) (as text)
Tue Nov 13 01:12:26 2007 UTC (17 years ago) by wakaba
Branch: MAIN
Changes since 1.9: +54 -53 lines
File MIME type: text/html
subsections rearranged

1 <!DOCTYPE html>
2 <html lang="en" class="formal-specification status-work-in-progress">
3 <head>
4 <title>manakai's XML Conformance Checking</title>
5 <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 <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 </head>
17 <body class="has-abstract">
18
19 <div class="header">
20 <h1>manakai's XML Conformance Checking</h1>
21 <h2>Working Draft <time datetime=2007-11-13>13 November 2007</time></h2>
22
23 <dl class="versions-uri">
24 <dt>This Version</dt>
25 <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 <dt>Latest Version</dt>
28 <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 <dt>Latest Working Draft</dt>
31 <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 <!-- <dt>Previous Version</dt> -->
34 <dt>Version History</dt>
35 <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 </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 <div class="section" id=checking-dom>
124 <h2>Checking <abbr>DOM</abbr></h2>
125
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 <div class=section id=error-categories>
131 <h3>Error Classification</h3>
132
133 <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 <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 <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 </div>
198
199 <div class=section id=definitions>
200 <h3>Definitions</h3>
201
202 <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 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 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 </div>
215
216
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 <li class=ed>@@</li>
226 </ol>
227
228 <p>The algorithm
229 <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
230 <code>Name</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> is defined
231 as following:</p>
232 <ol>
233 <li class=ed>@@</li>
234 </ol>
235
236 <p>The algorithm
237 <dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to
238 validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn>
239 is defined as following:</p>
240 <ol>
241 <li class=ed>@@</li>
242 </ol>
243
244 <p>To <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate
245 a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the
246 algorithm below <em class=rfc2119>MUST</em> be used:</p>
247 <ol>
248 <li>If <var>pid</var> contains any character
249 that is outside of the range of <code>#x20 | #xD | #xA |
250 [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,
251 then it is an
252 <a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li>
253 <li>If <var>pid</var> contains one of <code class=char>U+0009</code>
254 <code class=charname>CHARACTER TABULATION</code>,
255 <code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>,
256 and <code class=char>U+000D</code> <code class=charname>LINE FEED</code>
257 characters, if the first character of <var>pid</var> is
258 <code class=char>U+0020</code> <code class=charname>SPACE</code> character,
259 if the last character of <var>pid</var> is <code class=char>U+0020</code>
260 <code class=charname>SPACE</code> character, or if there is a
261 <code class=char>U+0020</code> <code class=charname>SPACE</code> character
262 immediately followed by another <code class=char>U+0020</code>
263 <code class=charname>SPACE</code> character in <var>pid</var>, then it is a
264 <a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>.</li>
265 <li class=ed>@@ Should we check formal-public-identifierness?</li>
266 </ol>
267
268 </div>
269
270 <div class=section id=checking-node>
271 <h3>Checking <code>Node</code></h3>
272
273 <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to
274 check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as
275 following:</p>
276 <dl class=switch>
277 <dt>If <var>n</var> is an <code>Attr</code> node</dt>
278 <dd>
279 <ol>
280 <li><a href="#algorithm-to-validate-a-ncname">Validate the
281 <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
282 <li>If the <code>prefix</code> attribute value is different from
283 <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
284 the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
285 <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the
286 <code>childNodes</code> list of <var>n</var>,
287 <ol>
288 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
289 <code>Text</code> or <code>EntityReference</code> node, then it is an
290 <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>
291 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
292 <code>EntityReference</code> node, then it is an
293 <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>
294 <li>Otherwise,
295 <a href="#algorithm-to-check-a-node" title="check a node">check
296 <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
297 </ol></li>
298 <li class=ed>@@ <code>specified</code>,
299 <code>manakaiAttributeType</code></li>
300 </ol>
301 </dd>
302 <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
303 <dd>
304 <ol>
305 <li class=ed></li>
306 <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the
307 <code>childNodes</code> list of <var>n</var>,
308 <ol>
309 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
310 <code>Text</code> or <code>EntityReference</code> node, then it is an
311 <a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li>
312 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
313 <code>EntityReference</code> node, then it is an
314 <a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li>
315 <li>Otherwise,
316 <a href="#algorithm-to-check-a-node" title="check a node">check
317 <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
318 </ol></li>
319 </ol>
320 </dd>
321 <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>
322 <dd>
323 <ol>
324 <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
325 <code>data</code> attribute value as an <abbr>XML</abbr> character
326 data</a>.</li>
327 <li>If the <code>data</code> attribute value contains
328 a string <code>]]></code>, then it is an
329 <a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.</li>
330 <li>If the <code>childNodes</code> list of <var>n</var> contains
331 any nodes, they are in
332 <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>
333 </ol>
334 </dd>
335 <dt>If <var>n</var> is a <code>Comment</code> node</dt>
336 <dd>
337 <ol>
338 <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
339 <code>data</code> attribute value as an <abbr>XML</abbr> character
340 data</a>.</li>
341 <li>If the <code>data</code> attribute value contains
342 a string <code>--</code>, or if it ends with a character
343 <code>-</code>, then it is an
344 <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.</li>
345 <li>If the <code>childNodes</code> list of <var>n</var> contains
346 any nodes, they are in
347 <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>
348 </ol>
349 </dd>
350 <dt>If <var>n</var> is a <code>Document</code> node</dt>
351 <dd>
352 <ol>
353 <li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var>
354 is different from <code>1.0</code> or <code>1.1</code>,
355 then it is an <code class=ed>unknown-error?</code>.</li>
356 <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>
357 match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>
358 <span class=ed>@@ formal def</span>, then it is an
359 <a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li>
360 <li>The <code>childNodes</code> list of <var>n</var> have to
361 consist of zero or more <code>Comment</code> and/or
362 <code>ProcessingInstruction</code> nodes, followed by
363 an optional <code>DocumentType</code> node, followed
364 by zero or more <code>Comment</code> and/or
365 <code>ProcessingInstruction</code> nodes, followed by
366 an <code>Element</code> node, followed
367 by zero or more <code>Comment</code> and/or
368 <code>ProcessingInstruction</code> nodes. Any violation to this is an
369 <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>
370 <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>
371 in the <code>childNodes</code> list of <var>n</var>,
372 <ol>
373 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
374 <code>EntityReference</code> node, then
375 <a href="#algorithm-to-check-a-node" title="check a node">check
376 <var>n<sub><var>c</var></sub></var></a> recursively.</li>
377 </ol></li>
378 <li class=ed>@@ <code>allDeclarationsProcessed</code></li>
379 </ol>
380 </dd>
381 <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>
382 <dd>
383 <ol>
384 <li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn>
385 in the <code>childNodes</code> list of <var>n</var>,
386 <ol>
387 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
388 <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,
389 <code>Comment</code>, <code>ProcessingInstruction</code>, or
390 <code>EntityReference</code> node, then it is an
391 <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>
392 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
393 <code>EntityReference</code> node, then it is an
394 <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>
395 <li>Otherwise,
396 <a href="#algorithm-to-check-a-node" title="check a node">check
397 <var>n<sub><var>c</var></sub></var></a> recursively.</li>
398 </ol></li>
399 </ol>
400 </dd>
401 <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>
402 <dd>
403 <ol>
404 <li><a href="#algorithm-to-validate-a-ncname">Validate the
405 <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
406 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
407 the <code>publicId</code> attribute value as a public identifier</a>.</li>
408 <li>If the <code>systemId</code> attribute value contains
409 both <code>"</code> and <code>'</code> characters, it is a
410 <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
411 <!-- publicId = non-null and systemId = null -->
412 <li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn>
413 in the <code>childNodes</code> list of <var>n</var>,
414 <ol>
415 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
416 <code>ProcessingInstruction</code> node, then it is an
417 <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.
418 <span class=ed>@@ ref to manakai's extensions</span></li>
419 <li>Otherwise, <!-- if n_c is not an EntityReference node, -->
420 <a href="#algorithm-to-check-a-node" title="check a node">check
421 <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
422 </ol></li>
423 <li class=ed>@@ <code>entities</code>, <code>notations</code>,
424 <code>elementTypes</code>, externally declared?</li>
425 </ol>
426 </dd>
427 <dt>If <var>n</var> is an <code>Element</code> node</dt>
428 <dd>
429 <ol>
430 <li><a href="#algorithm-to-validate-a-ncname">Validate the
431 <code>localName</code> attribute value as an <code>NCName</code></a>.</li>
432 <li>If the <code>prefix</code> attribute value is different from
433 <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
434 the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
435 <li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn>
436 in the <code>childNodes</code> list of <var>n</var>,
437 <ol>
438 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
439 <code>Element</code>,
440 <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
441 <code>ProcessingInstruction</code>, or
442 <code>EntityReference</code> node, then it is an
443 <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>
444 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
445 <code>EntityReference</code> node, then it is an
446 <a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li>
447 <li>Otherwise,
448 <a href="#algorithm-to-check-a-node" title="check a node">check
449 <var>n<sub><var>c</var></sub></var></a> recursively.</li>
450 </ol></li>
451 </ol>
452 </dd>
453 <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>
454 <dd>
455 <ol>
456 <li class=ed></li>
457 <li>If the <code>childNodes</code> list of <var>n</var> contains
458 any nodes, they are in
459 <a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li>
460 </ol>
461 </dd>
462 <dt>If <var>n</var> is an <code>Entity</code> node</dt>
463 <dd>
464 <ol>
465 <li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li>
466 <li><a href="#algorithm-to-validate-a-ncname">Validate the
467 <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
468 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
469 the <code>publicId</code> attribute value as a public identifier</a>.</li>
470 <li>If the <code>systemId</code> attribute value contains
471 both <code>"</code> and <code>'</code> characters, it is a
472 <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
473 <!-- publicId = non-null and systemId = null -->
474 <li class=ed>@@ <code>notationName</code></li>
475 <li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn>
476 in the <code>childNodes</code> list of <var>n</var>,
477 <ol>
478 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
479 <code>Element</code>,
480 <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
481 <code>ProcessingInstruction</code>, or <code>EntityReference</code>
482 node, then it is an
483 <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>
484 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
485 <code>EntityReference</code> node, then it is an
486 <a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li>
487 <li>Otherwise,
488 <a href="#algorithm-to-check-a-node" title="check a node">check
489 <var>n<sub><var>c</var></sub></var></a> recursively.</li>
490 </ol></li>
491 </ol>
492 </dd>
493 <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>
494 <dd>
495 <ol>
496 <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>
497 <li><a href="#algorithm-to-validate-a-ncname">Validate the
498 <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
499 <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>
500 in the <code>childNodes</code> list of <var>n</var>,
501 <ol>
502 <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
503 <code>Element</code>,
504 <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
505 <code>ProcessingInstruction</code>, or <code>EntityReference</code>
506 node, then it is an
507 <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>
508 <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an
509 <code>EntityReference</code> node, then it is an
510 <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>
511 <li>Otherwise,
512 <a href="#algorithm-to-check-a-node" title="check a node">check
513 <var>n<sub><var>c</var></sub></var></a> recursively.</li>
514 </ol></li>
515 </ol>
516 </dd>
517 <dt>If <var>n</var> is a <code>Notation</code> node</dt>
518 <dd>
519 <ol>
520 <li><a href="#algorithm-to-validate-a-ncname">Validate the
521 <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
522 <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
523 the <code>publicId</code> attribute value as a public identifier</a>.</li>
524 <li>If the <code>systemId</code> attribute value contains
525 both <code>"</code> and <code>'</code> characters, it is a
526 <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>
527 <li>If the <code>childNodes</code> list of <var>n</var> contains
528 any nodes, they are in
529 <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>
530 </ol>
531 </dd>
532 <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
533 <dd>
534 <ol>
535 <li><a href="#algorithm-to-validate-a-ncname">Validate the
536 <code>target</code> attribute value as an <code>NCName</code></a>.</li>
537 <li>If the <code>target</code> attribute value matches to
538 <code>XML</code> case-insensitively, then it is a
539 <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>
540 <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
541 <code>data</code> attribute value as an <abbr>XML</abbr> character
542 data</a>.</li>
543 <li>If the <code>data</code> attribute value contains
544 a string <code>?></code>, or starts with either
545 <code class=char>U+0009</code>, <code class=char>U+000A</code>,
546 <code class=char>U+000D</code>, or <code class=char>U+0020</code>
547 character, then it is a
548 <a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li>
549 <li>If the <code>childNodes</code> list of <var>n</var> contains
550 any nodes, they are in
551 <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>
552 </ol>
553 </dd>
554 <dt>If <var>n</var> is a <code>Text</code> node</dt>
555 <dd>
556 <ol>
557 <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
558 <code>data</code> attribute value as an <abbr>XML</abbr> character
559 data</a>.</li>
560 <li>If the <code>childNodes</code> list of <var>n</var> contains
561 any nodes, they are in
562 <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li>
563 </ol>
564 </dd>
565 <dt>Otherwise</dt>
566 <dd><span class=ed>xml-well-formedness-error? unknown-error?</span></dd>
567 </dl>
568
569 </div>
570
571 </div>
572
573 <div id="references" class="section reference">
574 <h2>References</h2>
575
576 <div id="normative-references" class="section normative reference">
577 <h3>Normative References</h3>
578
579 <dl>
580 <dt id=ref-DOM3CORE>DOM3CORE</dt>
581 <dd class=ed>@@ W3C DOM Level 3 Core</dd>
582 <dt id=ref-DOMDTDEF>DOMDTDEF</dt>
583 <dd class=ed>@@ manakai's extension to DOM for document type definitions</dd>
584 <dt id="ref-KEYWORDS">KEYWORDS</dt>
585 <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
586 <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
587 <abbr title="Internet Engineering Task Force">IETF</abbr>
588 <a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr>
589 14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,
590 <time datetime=1997-03>March 1997</time>.
591 <em>This</em> version of the specification is referenced.</dd>
592 <dt id=ref-INFOSET>INFOSET</dt>
593 <dd class=ed>@@</dd>
594 <dt id=ref-XML10">XML10</dt>
595 <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible
596 Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,
597 <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
598 2006</time>, edited in place <time datetime=2006-09-29>29 September
599 2006</time>. Tje latest version of the specification is available at
600 <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.
601 <em>This</em> version of the specification is referenced.</dd>
602 <dt id=ref-XML11>XML11</dt>
603 <dd class=ed>@@</dd>
604 </dl>
605 </div>
606
607 <div id="informative-references" class="section informative reference">
608 <h3>Non$B!>(Bnormative References</h3>
609
610 <dl class=ed>
611 <dt id=ref-CSS>CSS</dt>
612 <dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading
613 Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1)
614 Specification</a></cite>,
615 <abbr title="World Wide Web Consortium">W3C</abbr> Candidate
616 Recommendation, <time datetime=2007-07-19>19 July 2007</time>.
617 Work in progress. The latest version of the specification is
618 available at
619 <code class=URI>&lt;<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd>
620 <dt id=ref-CSSOM>CSSOM</dt>
621 <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
622 Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>,
623 <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
624 <time datetime=2007-06-18>18 June 2007</time>. Work in progress.
625 The latest Editor's Draft of the specification is available at
626 <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>
627 <dt id=ref-HTML5>HTML5</dt>
628 <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,
629 <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
630 Working Draft. Work in progress.</dd>
631 <dt id=ref-SAPI>SAPI</dt>
632 <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>,
633 <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,
634 <time datetime=2007-08-29>29 August 2007</time>. Work in progress.
635 The latest Editor's Draft of the specification is available at
636 <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>.
637 The latest published version of the specification is available at
638 <code class=URI>&lt;<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd>
639 <dt id=XBL2>XBL2</dt>
640 <dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr>
641 2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>.
642 Work in progress. The latest
643 <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished
644 version of the specification is available at
645 <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>
646 <dt id=ref-XML5>XML5</dt>
647 <dd class=ed>@@</dd>
648 </dl>
649 </div>
650
651 </div>
652
653 </body>
654 </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24