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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by wakaba, Mon Nov 12 12:53:50 2007 UTC revision 1.12 by wakaba, Wed Nov 14 11:40:48 2007 UTC
# Line 4  Line 4 
4  <title>manakai's XML Conformance Checking</title>  <title>manakai's XML Conformance Checking</title>
5  <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec">  <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec">
6  <link rel="license" href="http://suika.fam.cx/c/gnu/fdl">  <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>  </head>
17  <body class="has-abstract">  <body class="has-abstract">
18    
19  <div class="header">  <div class="header">
20  <h1>manakai's XML Conformance Checking</h1>  <h1>manakai's <abbr>XML</abbr> Conformance Checking</h1>
21  <h2>Working Draft <time datetime=2007-11-12>12 November 2007</time></h2>  <h2>Working Draft <time datetime=2007-11-14>14 November 2007</time></h2>
22    
23  <dl class="versions-uri">  <dl class="versions-uri">
24  <dt>This Version</dt>  <dt>This Version</dt>
# Line 111  In addition, the order in which <a href= Line 120  In addition, the order in which <a href=
120  raised is undefined.</p>  raised is undefined.</p>
121  </div>  </div>
122    
123  <div class="section">  <div class=section id=parsing-xml>
124  <h2 class=ed>Algorithms</h2>  <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    <div class="section" id=checking-dom>
136    <h2>Checking <abbr>DOM</abbr></h2>
137    
138  <p>The following algorithms and definitions are applied to  <p>The following algorithms and definitions are applied to
139  <abbr>XML</abbr> documents; especially, they are not applied  <abbr>XML</abbr> documents; especially, they are not applied
140  to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>  to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>
141    
142    <div class=section id=error-categories>
143    <h3>Error Classification</h3>
144    
145  <p class=ed>If a <code>Document</code> node has no  <p class=ed>If a <code>Document</code> node has no
146  xml-well-formedness-error, entity-error, and unknown-error,  xml-well-formedness-error, entity-error, and unknown-error,
147  then it is well-formed.  If a well-formed <code>Document</code>  then it is well-formed.  If a well-formed <code>Document</code>
# Line 147  can be easily serialized into a valid XM Line 171  can be easily serialized into a valid XM
171    </dd>    </dd>
172  <dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt>  <dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt>
173    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
174    <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  <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>  <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>
188    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
189  <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>  <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>
# Line 182  can be easily serialized into a valid XM Line 219  can be easily serialized into a valid XM
219  (MAY or MUST), #dt-compat for compatibility,  (MAY or MUST), #dt-compat for compatibility,
220  #dt-interop for interoperability</p></div>  #dt-interop for interoperability</p></div>
221    
222    </div>
223    
224    <div class=section id=definitions>
225    <h3>Definitions</h3>
226    
227  <p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is  <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.  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  For a <code>Documemt</code> node, the <abbr>XML</abbr> version
230  of the document is the value of the <code>xmlVersion</code>  of the document is the value of the <code>xmlVersion</code>
231  attribute.  For a <code>DocumentType</code> node whose  attribute of the node.  For a <code>DocumentType</code> node whose
232  <code>ownerDocument</code> is set to <code>null</code>,  <code>ownerDocument</code> attribute is set to <code>null</code>,
233  the <abbr>XML</abbr> version of the document is <code>1.0</code>.  the <abbr>XML</abbr> version of the document is <code>1.0</code><!--
234    since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->.
235  For any other node, the <abbr>XML</abbr> version of the document  For any other node, the <abbr>XML</abbr> version of the document
236  is that of the <code>Document</code> node contained in the  is that of the <code>Document</code> node contained in the
237  <code>ownerDocument</code> attribute of the node.</p>  <code>ownerDocument</code> attribute of the node.</p>
238    
239    </div>
240    
241    
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    <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    </ol>
265    
266    <p>The algorithm
267    <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
268    <code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn> is defined
269    as following:</p>
270    <ol>
271    <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    <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    <div class=section id=checking-node>
318    <h3>Checking <code>Node</code></h3>
319    
320  <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to  <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  check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as
322  following:</p>  following:</p>
# Line 205  following:</p> Line 329  following:</p>
329      <li>If the <code>prefix</code> attribute value is different from      <li>If the <code>prefix</code> attribute value is different from
330      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate      <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>      the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
332      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the
     a node which is <em>not</em> <code>Text</code> or  
     <code>EntityReference</code> node, then it is a  
     <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>  
     <li>If the <code>childNodes</code> list of <var>n</var> contains  
     an <code>EntityReference</code> node, it is an  
     <a href="#entity-error" id=ee-er-in-attr><code>entity-error</code></a>.</li>  
     <li><a href="#algorithm-to-check-a-node">Check each node</a>, in  
333      <code>childNodes</code> list of <var>n</var>,      <code>childNodes</code> list of <var>n</var>,
334      which is different from <code>EntityReference</code> recursively.</li>        <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      <li class=ed>@@ <code>specified</code>,      <li class=ed>@@ <code>specified</code>,
346      <code>manakaiAttributeType</code></li>      <code>manakaiAttributeType</code></li>
347      </ol>      </ol>
348    </dd>    </dd>
349  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
350    <dd class=ed></dd>    <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  <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>  <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>
369    <dd>    <dd>
370      <ol>      <ol>
# Line 228  following:</p> Line 372  following:</p>
372      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
373      data</a>.</li>      data</a>.</li>
374      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
375      a string <code>]]></code>, then it is a      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>.</li>      <a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.<!-- "for compatibility" --></li>
377      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
378      any nodes, they are in      any nodes, they are in
379      <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>s.</li>      <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>
380      </ol>      </ol>
381    </dd>    </dd>
382  <dt>If <var>n</var> is a <code>Comment</code> node</dt>  <dt>If <var>n</var> is a <code>Comment</code> node</dt>
383    <dd>    <dd>
384      <ol>      <ol>
385        <li>Raise an
386        <a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li>
387      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
388      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
389      data</a>.</li>      data</a>.</li>
390      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
391      a string <code>--</code>, or if it ends with a character      a string <code>--</code>, or if it ends with a character
392      <code>-</code>, then it is a      <code>-</code>, then raise an
393      <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.<!--
394        "for compatibility" --></li>
395      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
396      any nodes, they are in      any nodes, they are in
397      <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>s.</li>      <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>
398      </ol>      </ol>
399    </dd>    </dd>
400  <dt>If <var>n</var> is a <code>Document</code> node</dt>  <dt>If <var>n</var> is a <code>Document</code> node</dt>
# Line 258  following:</p> Line 405  following:</p>
405      then it is an <code class=ed>unknown-error?</code>.</li>      then it is an <code class=ed>unknown-error?</code>.</li>
406      <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>      <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>
407      match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>      match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>
408      <span class=ed>@@ formal def</span>, then it is a      <span class=ed>@@ formal def</span>, then it is an
409      <a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li>      <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      <li>The <code>childNodes</code> list of <var>n</var> have to
411      consist of zero or more <code>Comment</code> and/or      consist of zero or more <code>Comment</code> and/or
# Line 268  following:</p> Line 415  following:</p>
415      <code>ProcessingInstruction</code> nodes, followed by      <code>ProcessingInstruction</code> nodes, followed by
416      an <code>Element</code> node, followed      an <code>Element</code> node, followed
417      by zero or more <code>Comment</code> and/or      by zero or more <code>Comment</code> and/or
418      <code>ProcessingInstruction</code> nodes.  Any violation to this is a      <code>ProcessingInstruction</code> nodes.  Any violation to this is an
419      <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>
420      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in      <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>
421      <code>childNodes</code> list of <var>n</var>,      in the <code>childNodes</code> list of <var>n</var>,
422      which is different from <code>EntityReference</code> recursively.</li>        <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      <li class=ed>@@ <code>allDeclarationsProcessed</code></li>      <li class=ed>@@ <code>allDeclarationsProcessed</code></li>
429      </ol>      </ol>
430    </dd>    </dd>
431  <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>  <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>
432    <dd>    <dd>
433      <ol>      <ol>
434      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn>
435      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
436      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
437      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
438      <code>EntityReference</code> node, then it is a        <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,
439      <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>        <code>Comment</code>, <code>ProcessingInstruction</code>, or
440      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>EntityReference</code> node, then it is an
441      an <code>EntityReference</code> node, it is an        <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>
442      <a href="#entity-error" id=ee-er-in-df><code>entity-error</code></a>.</li>        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
443      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in        <code>EntityReference</code> node, then it is an
444      <code>childNodes</code> list of <var>n</var>        <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>
445      which is different from <code>EntityReference</code> recursively.</li>        <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      </ol>      </ol>
450    </dd>    </dd>
451  <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>  <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>
# Line 304  following:</p> Line 459  following:</p>
459      both <code>"</code> and <code>'</code> characters, it is a      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>      <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 -->      <!-- publicId = non-null and systemId = null -->
462      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn>
463      a node which is <em>not</em> <code>ProcessingInstruction</code> node,      in the <code>childNodes</code> list of <var>n</var>,
464      then it is a        <ol>
465      <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
466      <span class=ed>@@ ref to manakai's extensions</span></li>        <code>ProcessingInstruction</code> node, then it is an
467      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in        <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.
468      <code>childNodes</code> list of <var>n</var>,        <span class=ed>@@ ref to manakai's extensions</span></li>
469      which is different from <code>EntityReference</code> recursively.</li>        <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      <li class=ed>@@ <code>entities</code>, <code>notations</code>,      <li class=ed>@@ <code>entities</code>, <code>notations</code>,
474      <code>elementTypes</code>, externally declared?</li>      <code>elementTypes</code>, externally declared?</li>
475      </ol>      </ol>
# Line 324  following:</p> Line 482  following:</p>
482      <li>If the <code>prefix</code> attribute value is different from      <li>If the <code>prefix</code> attribute value is different from
483      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate      <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>      the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>
485      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn>
486      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
487      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
488      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
489      <code>EntityReference</code> node, then it is a        <code>Element</code>,
490      <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
491      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or
492      an <code>EntityReference</code> node, it is an        <code>EntityReference</code> node, then it is an
493      <a href="#entity-error" id=ee-er-in-element><code>entity-error</code></a>.</li>        <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>
494      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
495      <code>childNodes</code> list of <var>n</var>,        <code>EntityReference</code> node, then it is an
496      which is different from <code>EntityReference</code> recursively.</li>        <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>      </ol>
502    </dd>    </dd>
503  <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>  <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>
504    <dd class=ed></dd>    <dd>
505        <ol>
506        <li class=ed></li>
507        <li>If the <code>childNodes</code> list of <var>n</var> contains
508        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        </ol>
511      </dd>
512  <dt>If <var>n</var> is an <code>Entity</code> node</dt>  <dt>If <var>n</var> is an <code>Entity</code> node</dt>
513    <dd>    <dd>
514      <ol>      <ol>
# Line 353  following:</p> Line 522  following:</p>
522      <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>      <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 -->      <!-- publicId = non-null and systemId = null -->
524      <li class=ed>@@ <code>notationName</code></li>      <li class=ed>@@ <code>notationName</code></li>
525      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn>
526      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
527      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
528      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
529      <code>EntityReference</code> node, then it is a        <code>Element</code>,
530      <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
531      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or <code>EntityReference</code>
532      an <code>EntityReference</code> node, it is an        node, then it is an
533      <a href="#entity-error" id=ee-er-in-er><code>entity-error</code></a>.</li>        <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>
534      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
535      <code>childNodes</code> list of <var>n</var>,        <code>EntityReference</code> node, then it is an
536      which is different from <code>EntityReference</code> recursively.</li>        <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      </ol>      </ol>
542    </dd>    </dd>
543  <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>  <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>
# Line 373  following:</p> Line 546  following:</p>
546      <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>      <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      <li><a href="#algorithm-to-validate-a-ncname">Validate the
548      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
549      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>
550      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
551      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
552      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
553      <code>EntityReference</code> node, then it is a        <code>Element</code>,
554      <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,
555      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or <code>EntityReference</code>
556      an <code>EntityReference</code> node, it is an        node, then it is an
557      <a href="#entity-error" id=ee-er-in-entity><code>entity-error</code></a>.</li>        <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>
558      <li><a href="#algorithm-to-check-a-node">Check each node</a>, in        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an
559      <code>childNodes</code> list of <var>n</var>,        <code>EntityReference</code> node, then it is an
560      which is different from <code>EntityReference</code> recursively.</li>        <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      </ol>      </ol>
566    </dd>    </dd>
567  <dt>If <var>n</var> is a <code>Notation</code> node</dt>  <dt>If <var>n</var> is a <code>Notation</code> node</dt>
# Line 399  following:</p> Line 576  following:</p>
576      <a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li>      <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      <li>If the <code>childNodes</code> list of <var>n</var> contains
578      any nodes, they are in      any nodes, they are in
579      <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>s.</li>      <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>
580      </ol>      </ol>
581    </dd>    </dd>
582  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
# Line 421  following:</p> Line 598  following:</p>
598      <a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li>      <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      <li>If the <code>childNodes</code> list of <var>n</var> contains
600      any nodes, they are in      any nodes, they are in
601      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>s.</li>      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>
602      </ol>      </ol>
603    </dd>    </dd>
604  <dt>If <var>n</var> is a <code>Text</code> node</dt>  <dt>If <var>n</var> is a <code>Text</code> node</dt>
# Line 432  following:</p> Line 609  following:</p>
609      data</a>.</li>      data</a>.</li>
610      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
611      any nodes, they are in      any nodes, they are in
612      <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>s.</li>      <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li>
613      </ol>      </ol>
614    </dd>    </dd>
615  <dt>Otherwise</dt>  <dt>Otherwise</dt>
616    <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>    <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>
617  </dl>  </dl>
618    
 <p>The algorithm  
 <dfn id=algorithm-to-validate-an-xml-character-data title-"to validate an XML character data">to  
 validate an <abbr>XML</abbr> character data  
 (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>  
 <ol>  
 <li class=ed>@@</li>  
 </ol>  
   
 <p>The algorithm  
 <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a  
 <code>Name</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> is defined  
 as following:</p>  
 <ol>  
 <li class=ed>@@</li>  
 </ol>  
   
 <p>The algorithm  
 <dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to  
 validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn>  
 is defined as following:</p>  
 <ol>  
 <li class=ed>@@</li>  
 </ol>  
   
 <p>To <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate  
 a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the  
 algorithm below <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
     <li>If <var>pid</var> contains any character  
     that is outside of the range of <code>#x20 | <!--#xD | #xA |-->  
     [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,  
     or contains a leading <code class=char>U+0020</code> character,  
     a trailing <code class=char>U+0020</code> character, or a  
     sequence of two or more <code class=char>U+0020</code> characters,  
     then it is a  
     <a href="#xml-well-formedness-error" id=wfe-dt-public-id><code>xml-well-formedness-error</code></a>.</li>  
 </ol>  
   
619  </div>  </div>
620    
621  <div class="section" id="examples">  </div>
 <h2>Examples</h2>  
   
 <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>  
622    
623  <div class="ed issue">  <div id=classes class=section>
624    <h2>Character Classes</h2>
625    
626  <div class="example figure block">  <p>This section defines a couple of character classes.
627  <div class="caption">...</div>  These classes are referred to by algorithms specified above.</p>
628    
629  <pre><code>...</code></pre>  <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>  </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  </div>  </div>
690    
691  </div>  </div>

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.12

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24