/[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.1 by wakaba, Mon Nov 12 12:22:48 2007 UTC revision 1.16 by wakaba, Mon Nov 26 12:38:53 2007 UTC
# Line 1  Line 1 
1  <!DOCTYPE html>  <!DOCTYPE html>
2  <html lang="en" class="formal-specification status-work-in-progress">  <html lang="en" class="formal-specification status-work-in-progress">
3  <head>  <head>
4  <title class=ed>DOM XML 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 class=ed>DOM XML Checking</h1>  <h1>manakai's <abbr>XML</abbr> Conformance Checking</h1>
21  <h2>Working Draft <time datetime=2007-10-27>27 October 2007</time></h2>  <h2>Working Draft <time datetime=2007-11-26>26 November 2007</time></h2>
22    
23  <dl class="versions-uri ed">  <dl class="versions-uri">
24  <dt>This Version</dt>  <dt>This Version</dt>
25    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft"    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work"
26        >http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>&gt;</code></dd>        >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>&gt;</code></dd>
27  <dt>Latest Version</dt>  <dt>Latest Version</dt>
28    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/selectors/ssft/ssft"    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc"
29        >http://suika.fam.cx/www/markup/selectors/ssft/ssft</a>&gt;</code></dd>        >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc</a>&gt;</code></dd>
 <!--  
30  <dt>Latest Working Draft</dt>  <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> -->  <!-- <dt>Previous Version</dt> -->
34  <dt>Version History</dt>  <dt>Version History</dt>
35    <dd><code class=URI>&lt;<a href="http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft.en.html">http://suika.fam.cx/gate/cvs/markup/selectors/ssft/ssft.en.html</a>&gt;</code></dd>    <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>  </dl>
37  <dl class="authors" id="author">  <dl class="authors" id="author">
38  <dt>Author</dt>  <dt>Author</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    
 <div class="section">  
 <h2 class=ed>Algorithms</h2>  
123    
124  <p>The following algorithms and definitions are applied to  <div class=section id=error-categories>
125  <abbr>XML</abbr> documents; especially, they are not applied  <h2>Error Classification</h2>
 to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>  
126    
127  <p class=ed>If a <code>Document</code> node has no  <p class=ed>If a <code>Document</code> node has no
128  xml-well-formedness-error, entity-error, and unknown-error,  xml-well-formedness-error, entity-error, and unknown-error,
# Line 134  can be easily serialized into a valid XM Line 140  can be easily serialized into a valid XM
140    
141  <dl id=errors>  <dl id=errors>
142  <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>  <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>
143    <dd class=ed>@@</dd>    <dd>
144        <p class=ed>@@</p>
145        <div class="note memo">
146          <p>This <span class=ed>algorithm</span> does not support
147          <abbr>DOM</abbr> tree with one or more <code>EntityReference</code>
148          nodes.  It is expected that any entity references are expanded
149          at the parse time and any unexpandable entity references
150          make parse time errors raised so that never result in
151          <abbr>DOM</abbr> tree with <code>EntityReference</code> nodes.</p>
152        </div>
153      </dd>
154  <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>
155    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
156    <dt><dfn id=round-trip-warning><code>round-trip-warning</code></dfn></dt>
157      <dd>
158        <p>A <a href="#round-trip-warning"><code>round-trip-warning</code></a>
159        will be raised when a construct, which might not be restored to the same
160        construct when it is serialized and then re-parsed by a conforming
161        processor, is encountered.</p>
162        <div class="example memo">
163          <p>For a <code>Comment</code> node a
164          <a href="#round-trip-warning"><code>round-trip-warning</code></a> will
165          be raised, since <abbr>XML</abbr> processors are not required to
166          report texts of comments for applications.</p>
167        </div>
168      </dd>
169  <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>
170    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
171  <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 157  can be easily serialized into a valid XM Line 186  can be easily serialized into a valid XM
186    <a href="@@/#dt-fatal">fatal error</a>)    <a href="@@/#dt-fatal">fatal error</a>)
187    that is not classified to any other <a href="#error-category">error    that is not classified to any other <a href="#error-category">error
188    category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>    category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>
189    <dt><dfn id=xml-misc-recommendation><code>xml-misc-recommendation</code></dfn></dt>
190      <dd>
191        <p>An
192        <a href="#xml-misc-recommendation"><code>xml-misc-recommendation</code></a>
193        will be raised if a <em class=rfc2119>SHOULD</em>$B!>(Blevel requirement
194        in <abbr>XML</abbr> specification is not met.</p>
195      </dd>
196  <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>  <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>
197    <dd>A violation of validity constraint in XML document.</dd>    <dd>A violation of validity constraint in XML document.</dd>
198  <dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt>  <dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt>
# Line 172  can be easily serialized into a valid XM Line 208  can be easily serialized into a valid XM
208  (MAY or MUST), #dt-compat for compatibility,  (MAY or MUST), #dt-compat for compatibility,
209  #dt-interop for interoperability</p></div>  #dt-interop for interoperability</p></div>
210    
211    </div>
212    
213    <div class=section id=parsing-xml>
214    <h2>Parsing <abbr>XML</abbr> Document</h2>
215    
216    <ul>
217    <li>If the <abbr>XML</abbr> document does not begin with an
218    <abbr>XML</abbr> declaration, then raise an
219    <a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>.</li>
220    <li>If the replacement text of an entity declaration is
221    <code>&lt;</code>, then raise an
222    <a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!--
223    "strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11].
224    --></li>
225    <li>If there is an element type declaration whose <code>Name</code>
226    value is already declared, then raise an
227    <a href="#xml-validity-error" id=vc-edunique><code>xml-validity-error</code></a>.</li>
228    <li>If attribute definition whose <code>Name</code> is
229    <code>xml:space</code> has <span class=ed>declared type different from
230    (default|preserve), (default), or (preserve)</span>, then raise an
231    <a href="#xml-misc-error" id=xme-ad-xml-space><code>xml-misc-error</code></a>.
232    <span class=ed>@@ duplication with
233    <a href="#xml-at-xml-space">#xml-at-xml-space</a>.<!--
234    <!ATTLIST e xml:space CDATA #IMPLIED xml:space CDATA #IMPLIED> --></span></li>
235    <li>If an empty-element tag is used for an element which is <em>not</em>
236    declared <code>EMPTY</code>, then raise an
237    <a href="#xml-misc-recommentation" id=xmr-emptyelemtag-not-empty><code>xml-misc-recommendation</code></a>.</li>
238    <li>If an empty-element tag is <em>not</em> used for an element which is
239    declared <code>EMPTY</code>, then raise an
240    <a href="#xml-misc-recommentation" id=xmr-empty-not-emptyelemtag><code>xml-misc-recommendation</code></a>.</li>
241    <!--
242    
243    #vc-PEinMarkupDecl Validity constraint: Proper Declaration/PE Nesting
244    #wfc-PEinInternalSubset Well-formedness constraint: PEs in Internal Subset
245    #ExtSubset Well-formedness constraint: External Subset
246    #PE-between-Decls Well-formedness constraint: PE Between Declarations
247    #GIMatch Well-formedness constraint: Element Type Match
248    #uniqattspec Well-formedness constraint: Unique Att Spec
249    #NoExternalRefs Well-formedness constraint: No External Entity References
250    #CleanAttrVals Well-formedness constraint: No < in Attribute Values
251    #vc-PEinGroup Validity constraint: Proper Group/PE Nesting
252    "For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text SHOULD contain at least one non-blank character, and neither the first nor last non-blank character of the replacement text SHOULD be a connector (| or ,)."
253    "For interoperability, an XML processor MAY at user option issue a warning when more than one attribute-list declaration is provided for a given element type, or more than one attribute definition is provided for a given attribute, but this is not an error."
254    
255    @@ Need detailed review, but maybe should be in parsing phase
256    
257    #vc-check-rmd Validity constraint: Standalone Document Declaration
258    
259    -->
260    </ul>
261    </div>
262    
263    <div class="section" id=checking-dom>
264    <h2>Checking <abbr>DOM</abbr></h2>
265    
266    <p>The following algorithms and definitions are applied to
267    <abbr>XML</abbr> documents; especially, they are not applied
268    to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>
269    
270    <div class=section id=definitions>
271    <h3>Definitions</h3>
272    
273  <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
274  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.
275  For a <code>Documemt</code> node, the <abbr>XML</abbr> version  For a <code>Documemt</code> node, the <abbr>XML</abbr> version
276  of the document is the value of the <code>xmlVersion</code>  of the document is the value of the <code>xmlVersion</code>
277  attribute.  For a <code>DocumentType</code> node whose  attribute of the node.  For a <code>DocumentType</code> node whose
278  <code>ownerDocument</code> is set to <code>null</code>,  <code>ownerDocument</code> attribute is set to <code>null</code>,
279  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><!--
280    since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->.
281  For any other node, the <abbr>XML</abbr> version of the document  For any other node, the <abbr>XML</abbr> version of the document
282  is that of the <code>Document</code> node contained in the  is that of the <code>Document</code> node contained in the
283  <code>ownerDocument</code> attribute of the node.</p>  <code>ownerDocument</code> attribute of the node.</p>
284    
285    </div>
286    
287    
288    <div class=section id=checking-components>
289    <h3>Checking Components</h3>
290    
291    <p>The algorithm
292    <dfn id=algorithm-to-validate-an-xml-character-data title-"to validate an XML character data">to
293    validate an <abbr>XML</abbr> character data
294    (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>
295    <ol>
296    <li>If <var>s</var> contains a character that is <em>not</em> in
297    the character class <a href="#class-Char10"><code>Char10</code></a>,
298    then raise an
299    <a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li>
300    <li>If <var>s</var> contains a character that is in the character
301    class <a href="#class-CompatChar10"><code>CompatChar10</code></a>,
302    then raise an
303    <a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li>
304    <li>If <var>s</var> contains a character that is in the character
305    class <a href="#class-ControlChar10"><code>ControlChar10</code></a>,
306    then raise an
307    <a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li>
308    <li class=ed>@@ XML 1.1 support</li>
309    <li>If <var>s</var> contains a <code class=char>U+000D</code>
310    <code class=charname>CARRIAGE RETURN</code> character, then
311    raise a
312    <a href="#round-trip-error" id=rte-cr><code>round-trip-error</code></a>.
313    <span class=ed>@@ We should not raise duplicate errors for U+000D
314    in attribute values.  In addition, we should support a mode where
315    U+000D will be serialized as &#x000D; (so that no round-trip-error
316    will be raised).</span></li>
317    </ol>
318    
319    <p>The algorithm
320    <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
321    <code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn> is defined
322    as following:</p>
323    <ol>
324    <li>If <var>s</var> begins with the string <code>xml</code> (in any
325    case combination), then raise an
326    <a href="#xml-misc-warning" id=xmw-reserved-name><code>xml-misc-warning</code></a>.
327    <span class=ed>@@ except for attribute names <code>xml:lang</code>,
328    <code>xml:space</code>, <code>xml:base</code>, <code>xml:id</code>,
329    <code>xmlns</code>, <code>xmlns:<var>*</var></code>,
330    pi name <code>xml-stylesheet</code>.</span><!--
331    "names beginning with a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization in this or future versions of this specification.":
332    xml:base and xml:id specifications violate to this sentense!
333    --></li>
334    <!-- COLON in Name is a lowercase "should not" in a Note of [XML10],
335    [XML11]. -->
336    <li class=ed>@@</li>
337    </ol>
338    
339    <p>The algorithm
340    <dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to
341    validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn>
342    is defined as following:</p>
343    <ol>
344    <li class=ed>@@</li>
345    </ol>
346    
347    <p>To <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate
348    a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the
349    algorithm below <em class=rfc2119>MUST</em> be used:</p>
350    <ol>
351      <li>If <var>pid</var> contains any character
352      that is outside of the range of <code>#x20 | #xD | #xA |
353      [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,
354      then it is an
355      <a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li>
356      <li>If <var>pid</var> contains one of <code class=char>U+0009</code>
357      <code class=charname>CHARACTER TABULATION</code>,
358      <code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>,
359      and <code class=char>U+000D</code> <code class=charname>LINE FEED</code>
360      characters, if the first character of <var>pid</var> is
361      <code class=char>U+0020</code> <code class=charname>SPACE</code> character,
362      if the last character of <var>pid</var> is <code class=char>U+0020</code>
363      <code class=charname>SPACE</code> character, or if there is a
364      <code class=char>U+0020</code> <code class=charname>SPACE</code> character
365      immediately followed by another <code class=char>U+0020</code>
366      <code class=charname>SPACE</code> character in <var>pid</var>, then it is a
367      <a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>.</li>
368      <li class=ed>@@ Should we check formal-public-identifierness?</li>
369    </ol>
370    
371    </div>
372    
373    <div class=section id=checking-node>
374    <h3>Checking <code>Node</code></h3>
375    
376  <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
377  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
378  following:</p>  following:</p>
# Line 195  following:</p> Line 385  following:</p>
385      <li>If the <code>prefix</code> attribute value is different from      <li>If the <code>prefix</code> attribute value is different from
386      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
387      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>
388      <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
389      a node which is <em>not</em> <code>Text</code> or      <code>childNodes</code> list of <var>n</var>,
390      <code>EntityReference</code> node, then it is a        <ol>
391      <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
392      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>Text</code> or <code>EntityReference</code> node, then it is an
393      an <code>EntityReference</code> node, it is an        <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>
394      <a href="#entity-error" id=ee-er-in-attr><code>entity-error</code></a>.</li>        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
395      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <code>EntityReference</code> node, then it is an
396      which is different from <code>EntityReference</code> in        <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>
397      <code>childNodes</code> list of <var>n</var> recursively.</li>        <li>Otherwise,
398          <a href="#algorithm-to-check-a-node" title="check a node">check
399          <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
400          </ol></li>
401        <li>If <code>nodeName</code> attribute of <var>n</var> is
402        <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>
403        and <code>value</code> attribute of <var>n</var> is neither
404        <code>default</code> nor <code>preserve</code>, then it is an
405        <a href="#xml-misc-error" id=xme-attr-xml-space><code>xml-misc-error</code></a>.<!--
406        Note that <!ATTLIST e xml:space (default|preserve) "a">...
407        <e xml:space="default"/> is conforming and valid. --></li>
408        <li class=ed>@@ xml:lang value is not a language tag [RFC 3066 or its
409        successor] or an empty string, then xml-misc-warning
410        (a "fact"-level error; not an XML error).</li>
411      <li class=ed>@@ <code>specified</code>,      <li class=ed>@@ <code>specified</code>,
412      <code>manakaiAttributeType</code></li>      <code>manakaiAttributeType</code> (#ValueType Validity constraint: Attribute Value Type)</li>
413        <!-- xml:space MUST be declared to be valid. -->
414        <li>Let <dfn id=var-v><var>v</var></dfn> be the value of the
415        attribute <code>value</code> of <var>n</var>.</li>
416        <li>Validate the <var>n</var> against the <span class=ed>declared
417        type</span> as following:
418          <dl class=switch>
419          <dt class=ed><code>ID_ATTR</code></dt>
420            <dd>
421              <ol>
422              <li><span class=ed>Validate <var>v</var> as an
423              <code>Name</code>.</span>  If it fails, then raise an
424              <a href="#xml-validity-error" id=vc-id-name><code>xml-validity-error</code></a>.</li>
425              <li><span class=ed>If <code>ID</code> <var>v</var> is defined,</span>
426              then raise an  
427              <a href="#xml-validity-error" id=vc-id-duplication><code>xml-validity-error</code></a>.</li>
428              </ol>
429            </dd>
430          <dt class=ed>IDREF_ATTR</dt>
431            <dd>
432              <ol>
433              <li><span class=ed>Validate <var>v</var> as an
434              <code>Name</code>.</span>  If it fails, then raise an
435              <a href="#xml-validity-error" id=vc-idref-name><code>xml-validity-error</code></a>.</li>
436              <li><span class=ed>If <code>ID</code> <var>v</var> is NOT
437              defined,</span> then raise an  
438              <a href="#xml-validity-error" id=vc-idref-match><code>xml-validity-error</code></a>.</li>
439              </ol>
440            </dd>
441          <dt class=ed>IDREFS_ATTR</dt>
442            <dd class=ed>@@</dd>
443          <dt class=ed>ENTITY_ATTR</dt>
444            <dd>
445              <ol>
446              <li><span class=ed>Validate <var>v</var> as an
447              <code>Name</code>.</span>  If it fails, then raise an
448              <a href="#xml-validity-error" id=vc-entname-name><code>xml-validity-error</code></a>.</li>
449              <li><span class=ed>If <code>Entity</code> <var>v</var> is NOT
450              defined,</span> then raise an  
451              <a href="#xml-validity-error" id=vc-entname-match><code>xml-validity-error</code></a>.</li>
452              </ol>
453            </dd>
454          <dt class=ed>ENTITIES_ATTR</dt>
455            <dd class=ed>@@</dd>
456          <dt class=ed>NMTOKEN_ATTR</dt>
457            <dd>
458              <ol>
459              <li><span class=ed>Validate <var>v</var> as an
460              <code>Nmtoken</code>.</span>  If it fails, then raise an
461              <a href="#xml-validity-error" id=vc-nmtok-name><code>xml-validity-error</code></a>.</li>
462              </ol>
463            </dd>
464          <dt class=ed>NMTOKENS_ATTR</dt>
465            <dd class=ed>@@</dd>
466          <dt class=ed>NOTATION_ATTR</dt>
467            <dd class=ed><var>v</var> must be one of enumerated values.
468            If not, then raise an
469            <a href="#xml-validity-error" id=vc-notatn-match><code>xml-validity-error</code></a>.</dd>
470          <dt class=ed>ENUMERATED_ATTR</dt>
471            <dd class=ed><var>v</var> must be one of enumerated values.
472            If not, then raise an
473            <a href="#xml-validity-error" id=vc-enum><code>xml-validity-error</code></a>.</dd>
474          <dt class=ed>@@</dt>
475          </dl>
476        </li>
477        <li>If <span class=ed>default is NOT #IMPLIED or #REQUIRED</span>, then
478        raise an
479        <a href="#xml-validity-error" id=vc-id-default><code>xml-validity-error</code></a>.</li>
480      </ol>      </ol>
481    </dd>    </dd>
482  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
483    <dd class=ed></dd>    <dd>
484        <ol>
485        <li class=ed></li>
486        <li>If <code>nodeName</code> attribute of <var>n</var> is
487        <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>
488        and <span class=ed>its declared type is different from (default|preserve),
489        (default), or (preserve)</span>, then raise an
490        <a href="#xml-misc-error" id=xme-at-xml-space><code>xml-misc-error</code></a>.</li>
491        <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the
492        <code>childNodes</code> list of <var>n</var>,
493          <ol>
494          <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a
495          <code>Text</code> or <code>EntityReference</code> node, then it is an
496          <a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li>
497          <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
498          <code>EntityReference</code> node, then it is an
499          <a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li>
500          <li>Otherwise,
501          <a href="#algorithm-to-check-a-node" title="check a node">check
502          <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
503          </ol></li>
504        <li class=ed>If <code>NOTATION_ATTR</code>, enumerated values MUST
505        be declared.  If not, then raise an
506        <a href="#xml-validity-error" id=vc-notatn-declared><code>xml-validity-error</code></a>.</li>
507        <li class=ed>If <code>NOTATION_ATTR</code> or <code>ENUMERATED_ATTR</code>,
508        values MUST all be distinct.  If not, then raise an
509        <a href="#xml-validity-error" id=vc-no-duplicate-tokens><code>xml-validity-error</code></a>.</li>
510        <li class=ed>If <code>NOTATION_ATTR</code> on an <code>EMPTY</code>
511        element, then raise an
512        <a href="#xml-validity-error" id=vc-no-notation-empty><code>xml-validity-error</code></a>.</li>
513        </ol>
514      </dd>
515  <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>  <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>
516    <dd>    <dd>
517      <ol>      <ol>
# Line 218  following:</p> Line 519  following:</p>
519      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
520      data</a>.</li>      data</a>.</li>
521      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
522      a string <code>]]></code>, then it is a      a string <code>]]></code>, then raise an
523      <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>
524      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
525      any nodes, they are in      any nodes, they are in
526      <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>
527      </ol>      </ol>
528    </dd>    </dd>
529  <dt>If <var>n</var> is a <code>Comment</code> node</dt>  <dt>If <var>n</var> is a <code>Comment</code> node</dt>
530    <dd>    <dd>
531      <ol>      <ol>
532        <li>Raise an
533        <a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li>
534      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
535      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
536      data</a>.</li>      data</a>.</li>
537      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
538      a string <code>--</code>, or if it ends with a character      a string <code>--</code>, or if it ends with a character
539      <code>-</code>, then it is a      <code>-</code>, then raise an
540      <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>.<!--
541        "for compatibility" --></li>
542      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
543      any nodes, they are in      any nodes, they are in
544      <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>
545      </ol>      </ol>
546    </dd>    </dd>
547  <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 248  following:</p> Line 552  following:</p>
552      then it is an <code class=ed>unknown-error?</code>.</li>      then it is an <code class=ed>unknown-error?</code>.</li>
553      <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>      <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>
554      match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>      match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>
555      <span class=ed>@@ formal def</span>, then it is a      <span class=ed>@@ formal def</span>, then it is an
556      <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>
557      <li>The <code>childNodes</code> list of <var>n</var> have to      <li>The <code>childNodes</code> list of <var>n</var> have to
558      consist of zero or more <code>Comment</code> and/or      consist of zero or more <code>Comment</code> and/or
# Line 258  following:</p> Line 562  following:</p>
562      <code>ProcessingInstruction</code> nodes, followed by      <code>ProcessingInstruction</code> nodes, followed by
563      an <code>Element</code> node, followed      an <code>Element</code> node, followed
564      by zero or more <code>Comment</code> and/or      by zero or more <code>Comment</code> and/or
565      <code>ProcessingInstruction</code> nodes.  Any violation to this is a      <code>ProcessingInstruction</code> nodes.  Any violation to this is an
566      <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>
567      <li><a href="#algorithm-to-check-a-node">Check each node</a>      <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>
568      which is different from <code>EntityReference</code> in      in the <code>childNodes</code> list of <var>n</var>,
569      <code>childNodes</code> list of <var>n</var> recursively.</li>        <ol>
570          <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
571          <code>EntityReference</code> node, then
572          <a href="#algorithm-to-check-a-node" title="check a node">check
573          <var>n<sub><var>c</var></sub></var></a> recursively.</li>
574          </ol></li>
575      <li class=ed>@@ <code>allDeclarationsProcessed</code></li>      <li class=ed>@@ <code>allDeclarationsProcessed</code></li>
576      </ol>      </ol>
577    </dd>    </dd>
578  <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>  <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>
579    <dd>    <dd>
580      <ol>      <ol>
581      <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>
582      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
583      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
584      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
585      <code>EntityReference</code> node, then it is a        <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,
586      <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
587      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>EntityReference</code> node, then it is an
588      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>
589      <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
590      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <code>EntityReference</code> node, then it is an
591      which is different from <code>EntityReference</code> in        <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>
592      <code>childNodes</code> list of <var>n</var> recursively.</li>        <li>Otherwise,
593          <a href="#algorithm-to-check-a-node" title="check a node">check
594          <var>n<sub><var>c</var></sub></var></a> recursively.</li>
595          </ol></li>
596      </ol>      </ol>
597    </dd>    </dd>
598  <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 288  following:</p> Line 600  following:</p>
600      <ol>      <ol>
601      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li><a href="#algorithm-to-validate-a-ncname">Validate the
602      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
603      <li>If the <code>publicId</code> attribute value contains any character      <li>Follow the following substeps:
604      that is outside of the range of <code>#x20 | <!--#xD | #xA |-->        <ol>
605      [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->,        <li>If <code>ownerDocument</code> attribute of <var>n</var> is
606      or contains a leading <code class=char>U+0020</code> character,        <code>null</code>, then abort these substeps.</li>
607      a trailing <code class=char>U+0020</code> character, or a        <li>If <code>documentElement</code> attribute of the node
608      sequence of two or more <code class=char>U+0020</code> characters,        set to <code>ownerDocument</code> attribute of <var>n</var> is
609      then it is a        <code>null</code>, then abort these substeps.</li>
610      <a href="#xml-well-formedness-error" id=wfe-dt-public-id><code>xml-well-formedness-error</code></a>.</li>        <li>If <code>nodeName</code> attribute of the node set to
611          <code>documentElement</code> attribute of the node set to
612          <code>ownerDocument</code> attribute of <var>n</var> is
613          different from <code>nodeName</code> of <var>n</var>,
614          then raise an
615          <a href="#xml-validity-error" id=vc-roottype><code>xml-validity-error</code></a>.</li></li>
616          </ol>
617        </li>
618        <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
619        the <code>publicId</code> attribute value as a public identifier</a>.</li>
620      <li>If the <code>systemId</code> attribute value contains      <li>If the <code>systemId</code> attribute value contains
621      both <code>"</code> and <code>'</code> characters, it is a      both <code>"</code> and <code>'</code> characters, it is a
622      <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>
623      <!-- publicId = non-null and systemId = null -->      <!-- publicId = non-null and systemId = null -->
624      <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>
625      a node which is <em>not</em> <code>ProcessingInstruction</code> node,      in the <code>childNodes</code> list of <var>n</var>,
626      then it is a        <ol>
627      <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
628      <span class=ed>@@ ref to manakai's extensions</span></li>        <code>ProcessingInstruction</code> node, then it is an
629      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.
630      which is different from <code>EntityReference</code> in        <span class=ed>@@ ref to manakai's extensions</span></li>
631      <code>childNodes</code> list of <var>n</var> recursively.</li>        <li>Otherwise, <!-- if n_c is not an EntityReference node, -->
632          <a href="#algorithm-to-check-a-node" title="check a node">check
633          <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
634          </ol></li>
635      <li class=ed>@@ <code>entities</code>, <code>notations</code>,      <li class=ed>@@ <code>entities</code>, <code>notations</code>,
636      <code>elementTypes</code>, externally declared?</li>      <code>elementTypes</code>, externally declared?</li>
637      </ol>      </ol>
# Line 320  following:</p> Line 644  following:</p>
644      <li>If the <code>prefix</code> attribute value is different from      <li>If the <code>prefix</code> attribute value is different from
645      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate      <code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate
646      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>
647      <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>
648      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
649      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
650      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
651      <code>EntityReference</code> node, then it is a        <code>Element</code>,
652      <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>,
653      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or
654      an <code>EntityReference</code> node, it is an        <code>EntityReference</code> node, then it is an
655      <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>
656      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
657      which is different from <code>EntityReference</code> in        <code>EntityReference</code> node, then it is an
658      <code>childNodes</code> list of <var>n</var> recursively.</li>        <a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li>
659          <li>Otherwise,
660          <a href="#algorithm-to-check-a-node" title="check a node">check
661          <var>n<sub><var>c</var></sub></var></a> recursively.</li>
662          </ol></li>
663        <li class=ed>@@ #elementvalid Validity constraint: Element Valid</li>
664        <li class=ed>@@ #uniqattspec Well-formedness constraint: Unique Att Spec</li>
665      </ol>      </ol>
666    </dd>    </dd>
667  <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>  <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>
668    <dd class=ed></dd>    <dd>
669        <ol>
670        <li class=ed></li>
671        <li>If the <code>childNodes</code> list of <var>n</var> contains
672        any nodes, they are in
673        <a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li>
674        <li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#elemdecls">At user option, an XML processor MAY issue a warning when a declaration mentions an element type for which no declaration is provided, but this is not an error.</q></li>
675        <li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-element-content">For compatibility, it is an error if the content model allows an element to match more than one occurrence of an element type in the content model. </q></li>
676        <li class=ed>@@ #vc-MixedChildrenUnique
677        Validity constraint: No Duplicate Types</li>
678        <li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#attdecls">At user option, an XML processor MAY issue a warning if attributes are declared for an element type not itself declared, but this is not an error.</q></li>
679        <li>If there is more than one <code>AttributeDefinition</code> node
680        with <span class=ed>attribute type <code>ID</code></span> in the
681        <code>NamedNodeMap</code> list contained in the
682        <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an
683        <a href="#xml-validity-error" id=vc-one-id-per-el><code>xml-validity-error</code></a>.</li>
684        <li>If there is more than one <code>AttributeDefinition</code> node
685        with <span class=ed>attribute type <code>NOTATION</code></span> in the
686        <code>NamedNodeMap</code> list contained in the
687        <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an
688        <a href="#xml-validity-error" id=vc-one-notation-per><code>xml-validity-error</code></a>.</li>
689        <li class=ed>"For interoperability, the same Nmtoken  SHOULD NOT occur more than once in the enumerated attribute types of a single element type."</li>
690        </ol>
691      </dd>
692  <dt>If <var>n</var> is an <code>Entity</code> node</dt>  <dt>If <var>n</var> is an <code>Entity</code> node</dt>
693    <dd>    <dd>
694      <ol>      <ol>
695      <li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li>      <li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li>
696      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li><a href="#algorithm-to-validate-a-ncname">Validate the
697      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
698      <li>If the <code>publicId</code> attribute value contains any character      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
699      that is outside of the range of <code>#x20 | <!--#xD | #xA |-->      the <code>publicId</code> attribute value as a public identifier</a>.</li>
     [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>  
700      <li>If the <code>systemId</code> attribute value contains      <li>If the <code>systemId</code> attribute value contains
701      both <code>"</code> and <code>'</code> characters, it is a      both <code>"</code> and <code>'</code> characters, it is a
702      <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>
703      <!-- publicId = non-null and systemId = null -->      <!-- publicId = non-null and systemId = null -->
704      <li class=ed>@@ <code>notationName</code></li>      <li class=ed>@@ <code>notationName</code></li>
705      <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>
706      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
707      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
708      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
709      <code>EntityReference</code> node, then it is a        <code>Element</code>,
710      <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>,
711      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or <code>EntityReference</code>
712      an <code>EntityReference</code> node, it is an        node, then it is an
713      <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>
714      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an
715      which is different from <code>EntityReference</code> in        <code>EntityReference</code> node, then it is an
716      <code>childNodes</code> list of <var>n</var> recursively.</li>        <a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li>
717          <li>Otherwise,
718          <a href="#algorithm-to-check-a-node" title="check a node">check
719          <var>n<sub><var>c</var></sub></var></a> recursively.</li>
720          </ol></li>
721      </ol>      </ol>
722    </dd>    </dd>
723  <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 375  following:</p> Line 726  following:</p>
726      <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>
727      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li><a href="#algorithm-to-validate-a-ncname">Validate the
728      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
729      <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>
730      a node which is <em>not</em> <code>Element</code>,      in the <code>childNodes</code> list of <var>n</var>,
731      <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <ol>
732      <code>ProcessingInstruction</code>, or        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an
733      <code>EntityReference</code> node, then it is a        <code>Element</code>,
734      <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>,
735      <li>If the <code>childNodes</code> list of <var>n</var> contains        <code>ProcessingInstruction</code>, or <code>EntityReference</code>
736      an <code>EntityReference</code> node, it is an        node, then it is an
737      <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>
738      <li><a href="#algorithm-to-check-a-node">Check each node</a>        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an
739      which is different from <code>EntityReference</code> in        <code>EntityReference</code> node, then it is an
740      <code>childNodes</code> list of <var>n</var> recursively.</li>        <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>
741          <li>Otherwise,
742          <a href="#algorithm-to-check-a-node" title="check a node">check
743          <var>n<sub><var>c</var></sub></var></a> recursively.</li>
744          </ol></li>
745      </ol>      </ol>
746    </dd>    </dd>
747  <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 394  following:</p> Line 749  following:</p>
749      <ol>      <ol>
750      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li><a href="#algorithm-to-validate-a-ncname">Validate the
751      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
752      <li>If the <code>publicId</code> attribute value contains any character      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
753      that is outside of the range of <code>#x20 | <!--#xD | #xA |-->      the <code>publicId</code> attribute value as a public identifier</a>.</li>
     [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>  
754      <li>If the <code>systemId</code> attribute value contains      <li>If the <code>systemId</code> attribute value contains
755      both <code>"</code> and <code>'</code> characters, it is a      both <code>"</code> and <code>'</code> characters, it is a
756      <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>
757      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
758      any nodes, they are in      any nodes, they are in
759      <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>
760      </ol>      </ol>
761    </dd>    </dd>
762  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
763    <dd>    <dd>
764      <ol>      <ol>
765      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li>If the <code>target</code> attribute value matches to the string
766      <code>target</code> attribute value as an <code>NCName</code></a>.</li>      <code>xml</code> in any case combination, then raise a
     <li>If the <code>target</code> attribute value matches to  
     <code>XML</code> case-insensitively, then it is a  
767      <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>
768      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the      <li>Otherwise, <a href="#algorithm-to-validate-a-ncname">validate the
769      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>target</code> attribute value as an <code>NCName</code></a>.</li>
770        <li>Then,
771        <a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML character data">validate
772        the <code>data</code> attribute value as an <abbr>XML</abbr> character
773      data</a>.</li>      data</a>.</li>
774      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains a string
775      a string <code>?></code>, or starts with either      <code>?></code>, then raise a
776      <code class=char>U+0009</code>, <code class=char>U+000A</code>,      <a href="#xml-well-formedness-error" id=wfe-pi-pic><code>xml-well-formedness-error</code></a>.</li>
777      <code class=char>U+000D</code>, or <code class=char>U+0020</code>      <li>If the <code>data</code> attribute value starts with either
778      character, then it is a      <code class=char>U+0009</code> <code class=charname>CHARACTER
779      <a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li>      TABULATION</code>, <code class=char>U+000A</code> <code class=charname>LINE
780        FEED</code>, <code class=char>U+000D</code> <code class=charname>CARRIAGE
781        RETURN</code>, or <code class=char>U+0020</code>
782        <code class=charname>SPACE</code> character, then raise a
783        <a href="#round-trip-error" id=rte-pi-s><code>round-trip-error</code></a>.</li>
784      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
785      any nodes, they are in      any nodes, then raise an
786      <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>
787      </ol>      </ol>
788    </dd>    </dd>
789  <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 440  following:</p> Line 794  following:</p>
794      data</a>.</li>      data</a>.</li>
795      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
796      any nodes, they are in      any nodes, they are in
797      <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>
798      </ol>      </ol>
799    </dd>    </dd>
800  <dt>Otherwise</dt>  <dt>Otherwise</dt>
801    <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>    <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>
802  </dl>  </dl>
803    
 <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>  
   
804  </div>  </div>
805    
806  <div class="section" id="examples">  </div>
 <h2>Examples</h2>  
   
 <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>  
   
 <div class="ed issue">  
807    
808  <div class="example figure block">  <div id=classes class=section>
809  <div class="caption">...</div>  <h2>Character Classes</h2>
810    
811  <pre><code>...</code></pre>  <p>This section defines a couple of character classes.
812  </div>  These classes are referred to by algorithms specified above.</p>
813    
814    <p>Character class <dfn id=class-Char10><code>Char10</code></dfn>
815    contains the following characters:</p>
816    <ul>
817    <li><code class=char>U+0009</code> <code class=charname>CHARACTER
818    TABULATION</code></li>
819    <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>
820    <li><code class=char>U+000D</code> <code class=charname>CARRIAGE
821    RETURN</code></li>
822    <li><code class=char>U+0020</code> <code class=charname>SPACE</code>
823    .. <code class=char>U+D7FF</code></li>
824    <li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code>
825    <code class=charname>REPLACEMENT CHARACTER</code></li>
826    <li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li>
827    </ul>
828    <div class="note memo">
829    <p>This character class contains all characters allowed in the production rule
830    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>
831    of <abbr>XML</abbr> 1.0
832    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>
833    </div>
834    
835    <p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn>
836    contains the following characters:</p>
837    <ul>
838    <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>
839    </ul>
840    
841    <p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn>
842    contains the following characters:</p>
843    <ul>
844    <li><code class=char>U+007F</code> <code class=charname>DELETE</code> ..
845    <code class=char>U+0084</code> <code class=charname>INDEX</code></li>
846    <li><code class=char>U+0086</code> <code class=charname>START OF SELECTED
847    AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION
848    PROGRAM COMMAND</code></li>
849    <li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li>
850    <li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li>
851    <li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li>
852    <li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li>
853    <li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li>
854    <li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li>
855    <li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li>
856    <li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li>
857    <li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li>
858    <li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li>
859    <li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li>
860    <li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li>
861    <li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li>
862    <li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li>
863    <li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li>
864    <li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li>
865    <li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li>
866    </ul>
867    <div class="note memo">
868    <p>This character class contains the characters listed in the Note in
869    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>
870    of <abbr>XML</abbr> 1.0
871    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,
872    as amended by
873    <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>
874  </div>  </div>
875    
876  </div>  </div>
# Line 497  is defined as following:</p> Line 882  is defined as following:</p>
882  <h3>Normative References</h3>  <h3>Normative References</h3>
883    
884  <dl>  <dl>
885    <dt id=ref-DOM3CORE>DOM3CORE</dt>
886      <dd class=ed>@@ W3C DOM Level 3 Core</dd>
887    <dt id=ref-DOMDTDEF>DOMDTDEF</dt>
888      <dd class=ed>@@ manakai's extension to DOM for document type definitions</dd>
889  <dt id="ref-KEYWORDS">KEYWORDS</dt>  <dt id="ref-KEYWORDS">KEYWORDS</dt>
890    <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in    <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
891    <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,    <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
# Line 559  is defined as following:</p> Line 948  is defined as following:</p>
948    <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished    <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished
949    version of the specification is available at    version of the specification is available at
950    <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>    <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>
951    <dt id=ref-XML5>XML5</dt>
952      <dd class=ed>@@</dd>
953  </dl>  </dl>
954  </div>  </div>
955    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.16

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24