/[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.10 by wakaba, Tue Nov 13 01:12:26 2007 UTC revision 1.13 by wakaba, Wed Nov 14 12:28:40 2007 UTC
# Line 17  Line 17 
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-13>13 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 120  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 id=parsing-xml>
124    <h2>Parsing <abbr>XML</abbr> Document</h2>
125    
126    <ul>
127    <li>If the <abbr>XML</abbr> document does not begin with an
128    <abbr>XML</abbr> declaration, then raise an
129    <a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>.</li>
130    <li>If the replacement text of an entity declaration is
131    <code>&lt;</code>, then raise an
132    <a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!--
133    "strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11].
134    --></li>
135    <li>If attribute definition whose <code>Name</code> is
136    <code>xml:space</code> has <span class=ed>declared type different from
137    (default|preserve), (default), or (preserve)</span>, then raise an
138    <a href="#xml-misc-error" id=xme-ad-xml-space><code>xml-misc-error</code></a>.
139    <span class=ed>@@ duplication with
140    <a href="#xml-at-xml-space">#xml-at-xml-space</a>.<!--
141    <!ATTLIST e xml:space CDATA #IMPLIED xml:space CDATA #IMPLIED> --></span></li>
142    <!--
143    
144    #vc-PEinMarkupDecl Validity constraint: Proper Declaration/PE Nesting
145    #wfc-PEinInternalSubset Well-formedness constraint: PEs in Internal Subset
146    #ExtSubset Well-formedness constraint: External Subset
147    #PE-between-Decls Well-formedness constraint: PE Between Declarations
148    
149    @@ Need detailed review, but maybe should be in parsing phase
150    
151    #vc-check-rmd Validity constraint: Standalone Document Declaration
152    
153    -->
154    </ul>
155    </div>
156    
157  <div class="section" id=checking-dom>  <div class="section" id=checking-dom>
158  <h2>Checking <abbr>DOM</abbr></h2>  <h2>Checking <abbr>DOM</abbr></h2>
159    
# Line 159  can be easily serialized into a valid XM Line 193  can be easily serialized into a valid XM
193    </dd>    </dd>
194  <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>
195    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
196    <dt><dfn id=round-trip-warning><code>round-trip-warning</code></dfn></dt>
197      <dd>
198        <p>A <a href="#round-trip-warning"><code>round-trip-warning</code></a>
199        will be raised when a construct, which might not be restored to the same
200        construct when it is serialized and then re-parsed by a conforming
201        processor, is encountered.</p>
202        <div class="example memo">
203          <p>For a <code>Comment</code> node a
204          <a href="#round-trip-warning"><code>round-trip-warning</code></a> will
205          be raised, since <abbr>XML</abbr> processors are not required to
206          report texts of comments for applications.</p>
207        </div>
208      </dd>
209  <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>
210    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
211  <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 179  can be easily serialized into a valid XM Line 226  can be easily serialized into a valid XM
226    <a href="@@/#dt-fatal">fatal error</a>)    <a href="@@/#dt-fatal">fatal error</a>)
227    that is not classified to any other <a href="#error-category">error    that is not classified to any other <a href="#error-category">error
228    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>
229    <dt><dfn id=xml-misc-recommendation><code>xml-misc-recommendation</code></dfn></dt>
230      <dd>
231        <p>An
232        <a href="#xml-misc-recommendation"><code>xml-misc-recommendation</code></a>
233        will be raised if a <em class=rfc2119>SHOULD</em>$B!>(Blevel requirement
234        in <abbr>XML</abbr> specification is not met.</p>
235      </dd>
236  <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>
237    <dd>A violation of validity constraint in XML document.</dd>    <dd>A violation of validity constraint in XML document.</dd>
238  <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 222  is that of the <code>Document</code> nod Line 276  is that of the <code>Document</code> nod
276  validate an <abbr>XML</abbr> character data  validate an <abbr>XML</abbr> character data
277  (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>  (<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p>
278  <ol>  <ol>
279  <li class=ed>@@</li>  <li>If <var>s</var> contains a character that is <em>not</em> in
280    the character class <a href="#class-Char10"><code>Char10</code></a>,
281    then raise an
282    <a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li>
283    <li>If <var>s</var> contains a character that is in the character
284    class <a href="#class-CompatChar10"><code>CompatChar10</code></a>,
285    then raise an
286    <a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li>
287    <li>If <var>s</var> contains a character that is in the character
288    class <a href="#class-ControlChar10"><code>ControlChar10</code></a>,
289    then raise an
290    <a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li>
291    <li class=ed>@@ XML 1.1 support</li>
292    <li>If <var>s</var> contains a <code class=char>U+000D</code>
293    <code class=charname>CARRIAGE RETURN</code> character, then
294    raise a
295    <a href="#round-trip-error" id=rte-cr><code>round-trip-error</code></a>.
296    <span class=ed>@@ We should not raise duplicate errors for U+000D
297    in attribute values.  In addition, we should support a mode where
298    U+000D will be serialized as &#x000D; (so that no round-trip-error
299    will be raised).</span></li>
300  </ol>  </ol>
301    
302  <p>The algorithm  <p>The algorithm
303  <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a  <dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a
304  <code>Name</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> is defined  <code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn> is defined
305  as following:</p>  as following:</p>
306  <ol>  <ol>
307    <li>If <var>s</var> begins with the string <code>xml</code> (in any
308    case combination), then raise an
309    <a href="#xml-misc-warning" id=xmw-reserved-name><code>xml-misc-warning</code></a>.
310    <span class=ed>@@ except for attribute names <code>xml:lang</code>,
311    <code>xml:space</code>, <code>xml:base</code>, <code>xml:id</code>,
312    <code>xmlns</code>, <code>xmlns:<var>*</var></code>,
313    pi name <code>xml-stylesheet</code>.</span></li>
314    <!-- COLON in Name is a lowercase "should not" in a Note of [XML10],
315    [XML11]. -->
316  <li class=ed>@@</li>  <li class=ed>@@</li>
317  </ol>  </ol>
318    
# Line 295  following:</p> Line 378  following:</p>
378        <a href="#algorithm-to-check-a-node" title="check a node">check        <a href="#algorithm-to-check-a-node" title="check a node">check
379        <var>n<sub><var>c</var></sub></var></a> recusrively.</li>        <var>n<sub><var>c</var></sub></var></a> recusrively.</li>
380        </ol></li>        </ol></li>
381        <li>If <code>nodeName</code> attribute of <var>n</var> is
382        <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>
383        and <code>value</code> attribute of <var>n</var> is neither
384        <code>default</code> nor <code>preserve</code>, then it is an
385        <a href="#xml-misc-error" id=xme-attr-xml-space><code>xml-misc-error</code></a>.<!--
386        Note that <!ATTLIST e xml:space (default|preserve) "a">...
387        <e xml:space="default"/> is conforming and valid. --></li>
388        <li class=ed>@@ xml:lang value is not a language tag [RFC 3066 or its
389        successor] or an empty string, then xml-misc-warning
390        (a "fact"-level error; not an XML error).</li>
391      <li class=ed>@@ <code>specified</code>,      <li class=ed>@@ <code>specified</code>,
392      <code>manakaiAttributeType</code></li>      <code>manakaiAttributeType</code></li>
393        <!-- xml:space MUST be declared to be valid. -->
394      </ol>      </ol>
395    </dd>    </dd>
396  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>  <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>
397    <dd>    <dd>
398      <ol>      <ol>
399      <li class=ed></li>      <li class=ed></li>
400        <li>If <code>nodeName</code> attribute of <var>n</var> is
401        <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>
402        and <span class=ed>its declared type is different from (default|preserve),
403        (default), or (preserve)</span>, then raise an
404        <a href="#xml-misc-error" id=xme-at-xml-space><code>xml-misc-error</code></a>.</li>
405      <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the      <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the
406      <code>childNodes</code> list of <var>n</var>,      <code>childNodes</code> list of <var>n</var>,
407        <ol>        <ol>
# Line 325  following:</p> Line 424  following:</p>
424      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
425      data</a>.</li>      data</a>.</li>
426      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
427      a string <code>]]></code>, then it is an      a string <code>]]></code>, then raise an
428      <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>
429      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
430      any nodes, they are in      any nodes, they are in
431      <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>
# Line 335  following:</p> Line 434  following:</p>
434  <dt>If <var>n</var> is a <code>Comment</code> node</dt>  <dt>If <var>n</var> is a <code>Comment</code> node</dt>
435    <dd>    <dd>
436      <ol>      <ol>
437        <li>Raise an
438        <a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li>
439      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the
440      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>data</code> attribute value as an <abbr>XML</abbr> character
441      data</a>.</li>      data</a>.</li>
442      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains
443      a string <code>--</code>, or if it ends with a character      a string <code>--</code>, or if it ends with a character
444      <code>-</code>, then it is an      <code>-</code>, then raise an
445      <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>.<!--
446        "for compatibility" --></li>
447      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
448      any nodes, they are in      any nodes, they are in
449      <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>
# Line 403  following:</p> Line 505  following:</p>
505      <ol>      <ol>
506      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li><a href="#algorithm-to-validate-a-ncname">Validate the
507      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>
508        <li>Follow the following substeps:
509          <ol>
510          <li>If <code>ownerDocument</code> attribute of <var>n</var> is
511          <code>null</code>, then abort these substeps.</li>
512          <li>If <code>documentElement</code> attribute of the node
513          set to <code>ownerDocument</code> attribute of <var>n</var> is
514          <code>null</code>, then abort these substeps.</li>
515          <li>If <code>nodeName</code> attribute of the node set to
516          <code>documentElement</code> attribute of the node set to
517          <code>ownerDocument</code> attribute of <var>n</var> is
518          different from <code>nodeName</code> of <var>n</var>,
519          then raise an
520          <a href="#xml-validity-error" id=vc-roottype><code>xml-validity-error</code></a>.</li></li>
521          </ol>
522        </li>
523      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate
524      the <code>publicId</code> attribute value as a public identifier</a>.</li>      the <code>publicId</code> attribute value as a public identifier</a>.</li>
525      <li>If the <code>systemId</code> attribute value contains      <li>If the <code>systemId</code> attribute value contains
# Line 532  following:</p> Line 649  following:</p>
649  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>
650    <dd>    <dd>
651      <ol>      <ol>
652      <li><a href="#algorithm-to-validate-a-ncname">Validate the      <li>If the <code>target</code> attribute value matches to the string
653      <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  
654      <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>
655      <li><a href="#algorithm-to-validate-an-xml-character-data">Validate the      <li>Otherwise, <a href="#algorithm-to-validate-a-ncname">validate the
656      <code>data</code> attribute value as an <abbr>XML</abbr> character      <code>target</code> attribute value as an <code>NCName</code></a>.</li>
657        <li>Then,
658        <a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML character data">validate
659        the <code>data</code> attribute value as an <abbr>XML</abbr> character
660      data</a>.</li>      data</a>.</li>
661      <li>If the <code>data</code> attribute value contains      <li>If the <code>data</code> attribute value contains a string
662      a string <code>?></code>, or starts with either      <code>?></code>, then raise a
663      <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>
664      <code class=char>U+000D</code>, or <code class=char>U+0020</code>      <li>If the <code>data</code> attribute value starts with either
665      character, then it is a      <code class=char>U+0009</code> <code class=charname>CHARACTER
666      <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
667        FEED</code>, <code class=char>U+000D</code> <code class=charname>CARRIAGE
668        RETURN</code>, or <code class=char>U+0020</code>
669        <code class=charname>SPACE</code> character, then raise a
670        <a href="#round-trip-error" id=rte-pi-s><code>round-trip-error</code></a>.</li>
671      <li>If the <code>childNodes</code> list of <var>n</var> contains      <li>If the <code>childNodes</code> list of <var>n</var> contains
672      any nodes, they are in      any nodes, then raise an
673      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>
674      </ol>      </ol>
675    </dd>    </dd>
# Line 569  following:</p> Line 691  following:</p>
691  </div>  </div>
692    
693  </div>  </div>
694    
695    <div id=classes class=section>
696    <h2>Character Classes</h2>
697    
698    <p>This section defines a couple of character classes.
699    These classes are referred to by algorithms specified above.</p>
700    
701    <p>Character class <dfn id=class-Char10><code>Char10</code></dfn>
702    contains the following characters:</p>
703    <ul>
704    <li><code class=char>U+0009</code> <code class=charname>CHARACTER
705    TABULATION</code></li>
706    <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>
707    <li><code class=char>U+000D</code> <code class=charname>CARRIAGE
708    RETURN</code></li>
709    <li><code class=char>U+0020</code> <code class=charname>SPACE</code>
710    .. <code class=char>U+D7FF</code></li>
711    <li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code>
712    <code class=charname>REPLACEMENT CHARACTER</code></li>
713    <li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li>
714    </ul>
715    <div class="note memo">
716    <p>This character class contains all characters allowed in the production rule
717    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>
718    of <abbr>XML</abbr> 1.0
719    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>
720    </div>
721    
722    <p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn>
723    contains the following characters:</p>
724    <ul>
725    <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>
726    </ul>
727    
728    <p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn>
729    contains the following characters:</p>
730    <ul>
731    <li><code class=char>U+007F</code> <code class=charname>DELETE</code> ..
732    <code class=char>U+0084</code> <code class=charname>INDEX</code></li>
733    <li><code class=char>U+0086</code> <code class=charname>START OF SELECTED
734    AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION
735    PROGRAM COMMAND</code></li>
736    <li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li>
737    <li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li>
738    <li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li>
739    <li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li>
740    <li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li>
741    <li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li>
742    <li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li>
743    <li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li>
744    <li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li>
745    <li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li>
746    <li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li>
747    <li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li>
748    <li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li>
749    <li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li>
750    <li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li>
751    <li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li>
752    <li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li>
753    </ul>
754    <div class="note memo">
755    <p>This character class contains the characters listed in the Note in
756    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>
757    of <abbr>XML</abbr> 1.0
758    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,
759    as amended by
760    <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>
761    </div>
762    
763    </div>
764    
765  <div id="references" class="section reference">  <div id="references" class="section reference">
766  <h2>References</h2>  <h2>References</h2>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.13

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24