1 |
wakaba |
1.1 |
<!DOCTYPE html> |
2 |
|
|
<html lang="en" class="formal-specification status-work-in-progress"> |
3 |
|
|
<head> |
4 |
wakaba |
1.2 |
<title>manakai's XML Conformance Checking</title> |
5 |
wakaba |
1.1 |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
6 |
|
|
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
7 |
|
|
</head> |
8 |
|
|
<body class="has-abstract"> |
9 |
|
|
|
10 |
|
|
<div class="header"> |
11 |
wakaba |
1.2 |
<h1>manakai's XML Conformance Checking</h1> |
12 |
|
|
<h2>Working Draft <time datetime=2007-11-12>12 November 2007</time></h2> |
13 |
wakaba |
1.1 |
|
14 |
wakaba |
1.2 |
<dl class="versions-uri"> |
15 |
wakaba |
1.1 |
<dt>This Version</dt> |
16 |
wakaba |
1.2 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work" |
17 |
|
|
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>></code></dd> |
18 |
wakaba |
1.1 |
<dt>Latest Version</dt> |
19 |
wakaba |
1.2 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc" |
20 |
|
|
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc</a>></code></dd> |
21 |
wakaba |
1.1 |
<dt>Latest Working Draft</dt> |
22 |
wakaba |
1.2 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work" |
23 |
|
|
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>></code></dd> |
24 |
wakaba |
1.1 |
<!-- <dt>Previous Version</dt> --> |
25 |
|
|
<dt>Version History</dt> |
26 |
wakaba |
1.2 |
<dd><code class=URI><<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>></code></dd> |
27 |
wakaba |
1.1 |
</dl> |
28 |
|
|
<dl class="authors" id="author"> |
29 |
|
|
<dt>Author</dt> |
30 |
|
|
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
31 |
|
|
lang=ja>Wakaba</a> |
32 |
|
|
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
33 |
|
|
>w@suika.fam.cx</a>></code></dd> |
34 |
|
|
</dl> |
35 |
|
|
|
36 |
|
|
<p class="copyright" lang="en">© <time>2007</time> <a |
37 |
|
|
href="http://suika.fam.cx/~wakaba/who?" rel="author">Wakaba</a>. |
38 |
|
|
Permission is granted to copy, distribute and/or modify this document |
39 |
|
|
under the terms of the <a rel="license" |
40 |
|
|
href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>, |
41 |
|
|
Version 1.2 |
42 |
|
|
or any later version published by the <a |
43 |
|
|
href="http://www.fsf.org/">Free Software Foundation</a>; |
44 |
|
|
with no Invariant Sections, no Front$B!>(BCover Texts, and no Back$B!>(BCover |
45 |
|
|
Texts. A copy of the license is |
46 |
|
|
available at <code class="URI"><<a |
47 |
|
|
href="http://www.gnu.org/copyleft/fdl.html" |
48 |
|
|
rel="license">http://www.gnu.org/copyleft/fdl.html</a>></code>.</p> |
49 |
|
|
</div> |
50 |
|
|
|
51 |
|
|
<div id="abstract" class="section"> |
52 |
|
|
<h2>Abstract</h2> |
53 |
|
|
|
54 |
|
|
<div class="ed issue">...</div> |
55 |
|
|
|
56 |
|
|
</div> |
57 |
|
|
|
58 |
|
|
<div id="status" class="section"> |
59 |
|
|
<h2>Status of This Document</h2> |
60 |
|
|
|
61 |
|
|
<p class=section-info><em>This section describes the status of this document |
62 |
|
|
at the time of its publication. Other documents |
63 |
|
|
might supersede this document.</em></p> |
64 |
|
|
|
65 |
|
|
<p>This document is a working draft, produced as part of the |
66 |
|
|
<a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a> |
67 |
|
|
subproject of the |
68 |
|
|
<a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
69 |
|
|
project. It might be updated, replaced, or obsoleted by |
70 |
|
|
other documents at any time. It is inappropriate to |
71 |
|
|
cite this document as other than <q>work in progress</q>.</p> |
72 |
|
|
|
73 |
|
|
<p>Comments on this document are welcome and |
74 |
|
|
may be sent to the <a href="#author">author</a>.</p> |
75 |
|
|
|
76 |
|
|
<p>Translations of thie document might be available. |
77 |
|
|
The English version of the document is the only |
78 |
|
|
normative version.</p> |
79 |
|
|
</div> |
80 |
|
|
|
81 |
|
|
<div id="introduction" class="section"> |
82 |
|
|
<h2>Introduction</h2> |
83 |
|
|
|
84 |
|
|
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
85 |
|
|
|
86 |
|
|
<div class="issue ed">...</div> |
87 |
|
|
|
88 |
|
|
|
89 |
|
|
</div> |
90 |
|
|
|
91 |
|
|
<div class="section" id="terminology"> |
92 |
|
|
<h2>Terminology</h2> |
93 |
|
|
|
94 |
|
|
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
95 |
|
|
<q><em class="rfc2119">MUST NOT</em></q>, |
96 |
|
|
<q><em class="rfc2119">SHOULD</em></q>, |
97 |
|
|
<q><em class="rfc2119">SHOULD NOT</em></q>, and |
98 |
|
|
<q><em class=rfc2119>MAY</em></q> in this |
99 |
|
|
document are to be interpreted as described in |
100 |
|
|
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
101 |
|
|
2119</a> |
102 |
|
|
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
103 |
|
|
|
104 |
|
|
<!-- Strictly speaking the paragraph below is not part of terminology. --> |
105 |
|
|
<p>All examples and notes in this specification are non$B!>(Bnormative, |
106 |
|
|
as are all sections explicitly marked non$B!>(Bnormative. Everything |
107 |
|
|
else in this specification is normative.</p> |
108 |
|
|
|
109 |
|
|
<p><span class=ed>Algorithm is normative but non-normative</span>. |
110 |
|
|
In addition, the order in which <a href="#errors">errors</a> are |
111 |
|
|
raised is undefined.</p> |
112 |
|
|
</div> |
113 |
|
|
|
114 |
|
|
<div class="section"> |
115 |
|
|
<h2 class=ed>Algorithms</h2> |
116 |
|
|
|
117 |
|
|
<p>The following algorithms and definitions are applied to |
118 |
|
|
<abbr>XML</abbr> documents; especially, they are not applied |
119 |
|
|
to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p> |
120 |
|
|
|
121 |
|
|
<p class=ed>If a <code>Document</code> node has no |
122 |
|
|
xml-well-formedness-error, entity-error, and unknown-error, |
123 |
|
|
then it is well-formed. If a well-formed <code>Document</code> |
124 |
|
|
node has no xml-validity-error, it is valid.</p> |
125 |
|
|
|
126 |
|
|
<div class="note memo"> |
127 |
|
|
<p>A well$B!>(Bformed <code>Document</code> can be safely serialized |
128 |
|
|
into a well$B!>(Bformed XML document. A valid <code>Document</code> |
129 |
|
|
can be easily serialized into a valid XML document.</p> |
130 |
|
|
</div> |
131 |
|
|
|
132 |
|
|
<p>Errors are classified into these |
133 |
|
|
<dfn id=error-category title="error category">error categories</dfn>:</p> |
134 |
|
|
|
135 |
|
|
<dl id=errors> |
136 |
|
|
<dt><dfn id=entity-error><code>entity-error</code></dfn></dt> |
137 |
|
|
<dd class=ed>@@</dd> |
138 |
|
|
<dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt> |
139 |
|
|
<dd class=ed>@@</dd> |
140 |
|
|
<dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt> |
141 |
|
|
<dd class=ed>@@</dd> |
142 |
|
|
<dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt> |
143 |
|
|
<dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0 |
144 |
|
|
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite> |
145 |
|
|
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> / |
146 |
|
|
<abbr>XML</abbr> 1.1 |
147 |
|
|
<cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite> |
148 |
|
|
<a href="@@/#dt-error">error</a>) |
149 |
|
|
that is not classified to any other <a href="#error-category">error |
150 |
|
|
category</a>.</dd> |
151 |
|
|
<dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt> |
152 |
|
|
<dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0 |
153 |
|
|
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite> |
154 |
|
|
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal |
155 |
|
|
error</a> / <abbr>XML</abbr> 1.1 |
156 |
|
|
<cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite> |
157 |
|
|
<a href="@@/#dt-fatal">fatal error</a>) |
158 |
|
|
that is not classified to any other <a href="#error-category">error |
159 |
|
|
category</a>. <span class=ed>@@ What errors fall into this category?</span></dd> |
160 |
|
|
<dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt> |
161 |
|
|
<dd>A violation of validity constraint in XML document.</dd> |
162 |
|
|
<dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt> |
163 |
|
|
<dd><p>If an <code>xml-well-formedness-error</code> is raised, |
164 |
|
|
it would not be possible to generate an XML serialization that |
165 |
|
|
would match to the appropriate production rule and that would not |
166 |
|
|
violate to any well$B!>(Bformedness constraint in XML |
167 |
|
|
specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>, |
168 |
|
|
<a href="#ref-XML11">XML11</a>]</cite>.</p></dd> |
169 |
|
|
</dl> |
170 |
|
|
|
171 |
|
|
<div class=ed><p>@@ TODO: #dt-atuseroption at user option |
172 |
|
|
(MAY or MUST), #dt-compat for compatibility, |
173 |
|
|
#dt-interop for interoperability</p></div> |
174 |
|
|
|
175 |
|
|
<p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is |
176 |
|
|
the <abbr>XML</abbr> version of the document to which the node belongs. |
177 |
|
|
For a <code>Documemt</code> node, the <abbr>XML</abbr> version |
178 |
|
|
of the document is the value of the <code>xmlVersion</code> |
179 |
|
|
attribute. For a <code>DocumentType</code> node whose |
180 |
|
|
<code>ownerDocument</code> is set to <code>null</code>, |
181 |
|
|
the <abbr>XML</abbr> version of the document is <code>1.0</code>. |
182 |
|
|
For any other node, the <abbr>XML</abbr> version of the document |
183 |
|
|
is that of the <code>Document</code> node contained in the |
184 |
|
|
<code>ownerDocument</code> attribute of the node.</p> |
185 |
|
|
|
186 |
|
|
<p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to |
187 |
|
|
check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as |
188 |
|
|
following:</p> |
189 |
|
|
<dl class=switch> |
190 |
|
|
<dt>If <var>n</var> is an <code>Attr</code> node</dt> |
191 |
|
|
<dd> |
192 |
|
|
<ol> |
193 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
194 |
|
|
<code>localName</code> attribute value as an <code>NCName</code></a>.</li> |
195 |
|
|
<li>If the <code>prefix</code> attribute value is different from |
196 |
|
|
<code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate |
197 |
|
|
the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li> |
198 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
199 |
|
|
a node which is <em>not</em> <code>Text</code> or |
200 |
|
|
<code>EntityReference</code> node, then it is a |
201 |
|
|
<a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li> |
202 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
203 |
|
|
an <code>EntityReference</code> node, it is an |
204 |
|
|
<a href="#entity-error" id=ee-er-in-attr><code>entity-error</code></a>.</li> |
205 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
206 |
|
|
which is different from <code>EntityReference</code> in |
207 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
208 |
|
|
<li class=ed>@@ <code>specified</code>, |
209 |
|
|
<code>manakaiAttributeType</code></li> |
210 |
|
|
</ol> |
211 |
|
|
</dd> |
212 |
|
|
<dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt> |
213 |
|
|
<dd class=ed></dd> |
214 |
|
|
<dt>If <var>n</var> is a <code>CDATASection</code> node</dt> |
215 |
|
|
<dd> |
216 |
|
|
<ol> |
217 |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data">Validate the |
218 |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
219 |
|
|
data</a>.</li> |
220 |
|
|
<li>If the <code>data</code> attribute value contains |
221 |
|
|
a string <code>]]></code>, then it is a |
222 |
|
|
<a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.</li> |
223 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
224 |
|
|
any nodes, they are in |
225 |
|
|
<a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>s.</li> |
226 |
|
|
</ol> |
227 |
|
|
</dd> |
228 |
|
|
<dt>If <var>n</var> is a <code>Comment</code> node</dt> |
229 |
|
|
<dd> |
230 |
|
|
<ol> |
231 |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data">Validate the |
232 |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
233 |
|
|
data</a>.</li> |
234 |
|
|
<li>If the <code>data</code> attribute value contains |
235 |
|
|
a string <code>--</code>, or if it ends with a character |
236 |
|
|
<code>-</code>, then it is a |
237 |
|
|
<a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.</li> |
238 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
239 |
|
|
any nodes, they are in |
240 |
|
|
<a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>s.</li> |
241 |
|
|
</ol> |
242 |
|
|
</dd> |
243 |
|
|
<dt>If <var>n</var> is a <code>Document</code> node</dt> |
244 |
|
|
<dd> |
245 |
|
|
<ol> |
246 |
|
|
<li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var> |
247 |
|
|
is different from <code>1.0</code> or <code>1.1</code>, |
248 |
|
|
then it is an <code class=ed>unknown-error?</code>.</li> |
249 |
|
|
<li>If the <code>xmlEncoding</code> attribute value does <em>not</em> |
250 |
|
|
match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code> |
251 |
|
|
<span class=ed>@@ formal def</span>, then it is a |
252 |
|
|
<a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li> |
253 |
|
|
<li>The <code>childNodes</code> list of <var>n</var> have to |
254 |
|
|
consist of zero or more <code>Comment</code> and/or |
255 |
|
|
<code>ProcessingInstruction</code> nodes, followed by |
256 |
|
|
an optional <code>DocumentType</code> node, followed |
257 |
|
|
by zero or more <code>Comment</code> and/or |
258 |
|
|
<code>ProcessingInstruction</code> nodes, followed by |
259 |
|
|
an <code>Element</code> node, followed |
260 |
|
|
by zero or more <code>Comment</code> and/or |
261 |
|
|
<code>ProcessingInstruction</code> nodes. Any violation to this is a |
262 |
|
|
<a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li> |
263 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
264 |
|
|
which is different from <code>EntityReference</code> in |
265 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
266 |
|
|
<li class=ed>@@ <code>allDeclarationsProcessed</code></li> |
267 |
|
|
</ol> |
268 |
|
|
</dd> |
269 |
|
|
<dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt> |
270 |
|
|
<dd> |
271 |
|
|
<ol> |
272 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
273 |
|
|
a node which is <em>not</em> <code>Element</code>, |
274 |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
275 |
|
|
<code>ProcessingInstruction</code>, or |
276 |
|
|
<code>EntityReference</code> node, then it is a |
277 |
|
|
<a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li> |
278 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
279 |
|
|
an <code>EntityReference</code> node, it is an |
280 |
|
|
<a href="#entity-error" id=ee-er-in-df><code>entity-error</code></a>.</li> |
281 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
282 |
|
|
which is different from <code>EntityReference</code> in |
283 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
284 |
|
|
</ol> |
285 |
|
|
</dd> |
286 |
|
|
<dt>If <var>n</var> is a <code>DocumentType</code> node</dt> |
287 |
|
|
<dd> |
288 |
|
|
<ol> |
289 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
290 |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
291 |
|
|
<li>If the <code>publicId</code> attribute value contains any character |
292 |
|
|
that is outside of the range of <code>#x20 | <!--#xD | #xA |--> |
293 |
|
|
[a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->, |
294 |
|
|
or contains a leading <code class=char>U+0020</code> character, |
295 |
|
|
a trailing <code class=char>U+0020</code> character, or a |
296 |
|
|
sequence of two or more <code class=char>U+0020</code> characters, |
297 |
|
|
then it is a |
298 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-public-id><code>xml-well-formedness-error</code></a>.</li> |
299 |
|
|
<li>If the <code>systemId</code> attribute value contains |
300 |
|
|
both <code>"</code> and <code>'</code> characters, it is a |
301 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li> |
302 |
|
|
<!-- publicId = non-null and systemId = null --> |
303 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
304 |
|
|
a node which is <em>not</em> <code>ProcessingInstruction</code> node, |
305 |
|
|
then it is a |
306 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>. |
307 |
|
|
<span class=ed>@@ ref to manakai's extensions</span></li> |
308 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
309 |
|
|
which is different from <code>EntityReference</code> in |
310 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
311 |
|
|
<li class=ed>@@ <code>entities</code>, <code>notations</code>, |
312 |
|
|
<code>elementTypes</code>, externally declared?</li> |
313 |
|
|
</ol> |
314 |
|
|
</dd> |
315 |
|
|
<dt>If <var>n</var> is an <code>Element</code> node</dt> |
316 |
|
|
<dd> |
317 |
|
|
<ol> |
318 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
319 |
|
|
<code>localName</code> attribute value as an <code>NCName</code></a>.</li> |
320 |
|
|
<li>If the <code>prefix</code> attribute value is different from |
321 |
|
|
<code>null</code>, then <a href="#algorithm-to-validate-a-ncname">validate |
322 |
|
|
the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li> |
323 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
324 |
|
|
a node which is <em>not</em> <code>Element</code>, |
325 |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
326 |
|
|
<code>ProcessingInstruction</code>, or |
327 |
|
|
<code>EntityReference</code> node, then it is a |
328 |
|
|
<a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li> |
329 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
330 |
|
|
an <code>EntityReference</code> node, it is an |
331 |
|
|
<a href="#entity-error" id=ee-er-in-element><code>entity-error</code></a>.</li> |
332 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
333 |
|
|
which is different from <code>EntityReference</code> in |
334 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
335 |
|
|
</ol> |
336 |
|
|
</dd> |
337 |
|
|
<dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt> |
338 |
|
|
<dd class=ed></dd> |
339 |
|
|
<dt>If <var>n</var> is an <code>Entity</code> node</dt> |
340 |
|
|
<dd> |
341 |
|
|
<ol> |
342 |
|
|
<li>An <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a> <span class=ed>@@ if !notationName</span>.</li> |
343 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
344 |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
345 |
|
|
<li>If the <code>publicId</code> attribute value contains any character |
346 |
|
|
that is outside of the range of <code>#x20 | <!--#xD | #xA |--> |
347 |
|
|
[a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->, |
348 |
|
|
or contains a leading <code class=char>U+0020</code> character, |
349 |
|
|
a trailing <code class=char>U+0020</code> character, or a |
350 |
|
|
sequence of two or more <code class=char>U+0020</code> characters, |
351 |
|
|
then it is a |
352 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-public-id><code>xml-well-formedness-error</code></a>.</li> |
353 |
|
|
<li>If the <code>systemId</code> attribute value contains |
354 |
|
|
both <code>"</code> and <code>'</code> characters, it is a |
355 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li> |
356 |
|
|
<!-- publicId = non-null and systemId = null --> |
357 |
|
|
<li class=ed>@@ <code>notationName</code></li> |
358 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
359 |
|
|
a node which is <em>not</em> <code>Element</code>, |
360 |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
361 |
|
|
<code>ProcessingInstruction</code>, or |
362 |
|
|
<code>EntityReference</code> node, then it is a |
363 |
|
|
<a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li> |
364 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
365 |
|
|
an <code>EntityReference</code> node, it is an |
366 |
|
|
<a href="#entity-error" id=ee-er-in-er><code>entity-error</code></a>.</li> |
367 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
368 |
|
|
which is different from <code>EntityReference</code> in |
369 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
370 |
|
|
</ol> |
371 |
|
|
</dd> |
372 |
|
|
<dt>If <var>n</var> is an <code>EntityReference</code> node</dt> |
373 |
|
|
<dd> |
374 |
|
|
<ol> |
375 |
|
|
<li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li> |
376 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
377 |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
378 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
379 |
|
|
a node which is <em>not</em> <code>Element</code>, |
380 |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
381 |
|
|
<code>ProcessingInstruction</code>, or |
382 |
|
|
<code>EntityReference</code> node, then it is a |
383 |
|
|
<a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li> |
384 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
385 |
|
|
an <code>EntityReference</code> node, it is an |
386 |
|
|
<a href="#entity-error" id=ee-er-in-entity><code>entity-error</code></a>.</li> |
387 |
|
|
<li><a href="#algorithm-to-check-a-node">Check each node</a> |
388 |
|
|
which is different from <code>EntityReference</code> in |
389 |
|
|
<code>childNodes</code> list of <var>n</var> recursively.</li> |
390 |
|
|
</ol> |
391 |
|
|
</dd> |
392 |
|
|
<dt>If <var>n</var> is a <code>Notation</code> node</dt> |
393 |
|
|
<dd> |
394 |
|
|
<ol> |
395 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
396 |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
397 |
|
|
<li>If the <code>publicId</code> attribute value contains any character |
398 |
|
|
that is outside of the range of <code>#x20 | <!--#xD | #xA |--> |
399 |
|
|
[a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]</code><!-- @@ TODO: formal def -->, |
400 |
|
|
or contains a leading <code class=char>U+0020</code> character, |
401 |
|
|
a trailing <code class=char>U+0020</code> character, or a |
402 |
|
|
sequence of two or more <code class=char>U+0020</code> characters, |
403 |
|
|
then it is a |
404 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-public-id><code>xml-well-formedness-error</code></a>.</li> |
405 |
|
|
<li>If the <code>systemId</code> attribute value contains |
406 |
|
|
both <code>"</code> and <code>'</code> characters, it is a |
407 |
|
|
<a href="#xml-well-formedness-error" id=wfe-dt-system-id><code>xml-well-formedness-error</code></a>.</li> |
408 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
409 |
|
|
any nodes, they are in |
410 |
|
|
<a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>s.</li> |
411 |
|
|
</ol> |
412 |
|
|
</dd> |
413 |
|
|
<dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt> |
414 |
|
|
<dd> |
415 |
|
|
<ol> |
416 |
|
|
<li><a href="#algorithm-to-validate-a-ncname">Validate the |
417 |
|
|
<code>target</code> attribute value as an <code>NCName</code></a>.</li> |
418 |
|
|
<li>If the <code>target</code> attribute value matches to |
419 |
|
|
<code>XML</code> case-insensitively, then it is a |
420 |
|
|
<a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li> |
421 |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data">Validate the |
422 |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
423 |
|
|
data</a>.</li> |
424 |
|
|
<li>If the <code>data</code> attribute value contains |
425 |
|
|
a string <code>?></code>, or starts with either |
426 |
|
|
<code class=char>U+0009</code>, <code class=char>U+000A</code>, |
427 |
|
|
<code class=char>U+000D</code>, or <code class=char>U+0020</code> |
428 |
|
|
character, then it is a |
429 |
|
|
<a href="#round-trip-error" id=rte-pi-data><code>round-trip-error</code></a>.</li> |
430 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
431 |
|
|
any nodes, they are in |
432 |
|
|
<a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>s.</li> |
433 |
|
|
</ol> |
434 |
|
|
</dd> |
435 |
|
|
<dt>If <var>n</var> is a <code>Text</code> node</dt> |
436 |
|
|
<dd> |
437 |
|
|
<ol> |
438 |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data">Validate the |
439 |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
440 |
|
|
data</a>.</li> |
441 |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
442 |
|
|
any nodes, they are in |
443 |
|
|
<a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>s.</li> |
444 |
|
|
</ol> |
445 |
|
|
</dd> |
446 |
|
|
<dt>Otherwise</dt> |
447 |
|
|
<dd><span class=ed>xml-well-formedness-error? unknown-error?</span></dd> |
448 |
|
|
</dl> |
449 |
|
|
|
450 |
|
|
<p>The algorithm |
451 |
|
|
<dfn id=algorithm-to-validate-an-xml-character-data title-"to validate an XML character data">to |
452 |
|
|
validate an <abbr>XML</abbr> character data |
453 |
|
|
(<dfn id=var-s><var>s</var></dfn>)</dfn> is defined as following:</p> |
454 |
|
|
<ol> |
455 |
|
|
<li class=ed>@@</li> |
456 |
|
|
</ol> |
457 |
|
|
|
458 |
|
|
<p>The algorithm |
459 |
|
|
<dfn id=algorithm-to-validate-a-name title="to validate a Name">to validate a |
460 |
|
|
<code>Name</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> is defined |
461 |
|
|
as following:</p> |
462 |
|
|
<ol> |
463 |
|
|
<li class=ed>@@</li> |
464 |
|
|
</ol> |
465 |
|
|
|
466 |
|
|
<p>The algorithm |
467 |
|
|
<dfn id=algorithm-to-validate-a-ncname title="to validate an NCName">to |
468 |
|
|
validate an <code>NCName</code> (<dfn id=var-name><var>name</var></dfn>)</dfn> |
469 |
|
|
is defined as following:</p> |
470 |
|
|
<ol> |
471 |
|
|
<li class=ed>@@</li> |
472 |
|
|
</ol> |
473 |
|
|
|
474 |
|
|
</div> |
475 |
|
|
|
476 |
|
|
<div class="section" id="examples"> |
477 |
|
|
<h2>Examples</h2> |
478 |
|
|
|
479 |
|
|
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
480 |
|
|
|
481 |
|
|
<div class="ed issue"> |
482 |
|
|
|
483 |
|
|
<div class="example figure block"> |
484 |
|
|
<div class="caption">...</div> |
485 |
|
|
|
486 |
|
|
<pre><code>...</code></pre> |
487 |
|
|
</div> |
488 |
|
|
|
489 |
|
|
</div> |
490 |
|
|
|
491 |
|
|
</div> |
492 |
|
|
|
493 |
|
|
<div id="references" class="section reference"> |
494 |
|
|
<h2>References</h2> |
495 |
|
|
|
496 |
|
|
<div id="normative-references" class="section normative reference"> |
497 |
|
|
<h3>Normative References</h3> |
498 |
|
|
|
499 |
|
|
<dl> |
500 |
wakaba |
1.3 |
<dt id=ref-DOM3CORE>DOM3CORE</dt> |
501 |
|
|
<dd class=ed>@@ W3C DOM Level 3 Core</dd> |
502 |
|
|
<dt id=ref-DOMDTDEF>DOMDTDEF</dt> |
503 |
|
|
<dd class=ed>@@ manakai's extension to DOM for document type definitions</dd> |
504 |
wakaba |
1.1 |
<dt id="ref-KEYWORDS">KEYWORDS</dt> |
505 |
|
|
<dd><cite><a href="urn:ietf:rfc:2119">Key words for use in |
506 |
|
|
<abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>, |
507 |
|
|
<abbr title="Internet Engineering Task Force">IETF</abbr> |
508 |
|
|
<a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr> |
509 |
|
|
14</a>, <abbr title="Request for Comments">RFC</abbr> 2119, |
510 |
|
|
<time datetime=1997-03>March 1997</time>. |
511 |
|
|
<em>This</em> version of the specification is referenced.</dd> |
512 |
|
|
<dt id=ref-INFOSET>INFOSET</dt> |
513 |
|
|
<dd class=ed>@@</dd> |
514 |
|
|
<dt id=ref-XML10">XML10</dt> |
515 |
|
|
<dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible |
516 |
|
|
Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>, |
517 |
|
|
<abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August |
518 |
|
|
2006</time>, edited in place <time datetime=2006-09-29>29 September |
519 |
|
|
2006</time>. Tje latest version of the specification is available at |
520 |
|
|
<code class=uri><<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>></code>. |
521 |
|
|
<em>This</em> version of the specification is referenced.</dd> |
522 |
|
|
<dt id=ref-XML11>XML11</dt> |
523 |
|
|
<dd class=ed>@@</dd> |
524 |
|
|
</dl> |
525 |
|
|
</div> |
526 |
|
|
|
527 |
|
|
<div id="informative-references" class="section informative reference"> |
528 |
|
|
<h3>Non$B!>(Bnormative References</h3> |
529 |
|
|
|
530 |
|
|
<dl class=ed> |
531 |
|
|
<dt id=ref-CSS>CSS</dt> |
532 |
|
|
<dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading |
533 |
|
|
Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1) |
534 |
|
|
Specification</a></cite>, |
535 |
|
|
<abbr title="World Wide Web Consortium">W3C</abbr> Candidate |
536 |
|
|
Recommendation, <time datetime=2007-07-19>19 July 2007</time>. |
537 |
|
|
Work in progress. The latest version of the specification is |
538 |
|
|
available at |
539 |
|
|
<code class=URI><<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd> |
540 |
|
|
<dt id=ref-CSSOM>CSSOM</dt> |
541 |
|
|
<dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&content-type=text/html;%20charset=utf-8">Cascading |
542 |
|
|
Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>, |
543 |
|
|
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
544 |
|
|
<time datetime=2007-06-18>18 June 2007</time>. Work in progress. |
545 |
|
|
The latest Editor's Draft of the specification is available at |
546 |
|
|
<code class=URI><<a href="http://dev.w3.org/csswg/cssom/Overview.html">http://dev.w3.org/csswg/cssom/Overview.html</a>></code>.</dd> |
547 |
|
|
<dt id=ref-HTML5>HTML5</dt> |
548 |
|
|
<dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>, |
549 |
|
|
<abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr> |
550 |
|
|
Working Draft. Work in progress.</dd> |
551 |
|
|
<dt id=ref-SAPI>SAPI</dt> |
552 |
|
|
<dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&content-type=text/html;%20charset=utf-8">Selectors <abbr>API</abbr></a></cite>, |
553 |
|
|
<abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft, |
554 |
|
|
<time datetime=2007-08-29>29 August 2007</time>. Work in progress. |
555 |
|
|
The latest Editor's Draft of the specification is available at |
556 |
|
|
<code class=URI><<a href="http://dev.w3.org/2006/webapi/selectors-api/Overview.html">http://dev.w3.org/2006/webapi/selectors-api/Overview.html</a>></code>. |
557 |
|
|
The latest published version of the specification is available at |
558 |
|
|
<code class=URI><<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd> |
559 |
|
|
<dt id=XBL2>XBL2</dt> |
560 |
|
|
<dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr> |
561 |
|
|
2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>. |
562 |
|
|
Work in progress. The latest |
563 |
|
|
<abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished |
564 |
|
|
version of the specification is available at |
565 |
|
|
<code class=URI><<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd> |
566 |
wakaba |
1.3 |
<dt id=ref-XML5>XML5</dt> |
567 |
|
|
<dd class=ed>@@</dd> |
568 |
wakaba |
1.1 |
</dl> |
569 |
|
|
</div> |
570 |
|
|
|
571 |
|
|
</div> |
572 |
|
|
|
573 |
|
|
</body> |
574 |
|
|
</html> |