| 210 |
violate to any well$B!>(Bformedness constraint in XML |
violate to any well$B!>(Bformedness constraint in XML |
| 211 |
specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>, |
specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>, |
| 212 |
<a href="#ref-XML11">XML11</a>]</cite>.</p></dd> |
<a href="#ref-XML11">XML11</a>]</cite>.</p></dd> |
| 213 |
|
<dt><dfn id=misc-info><code>misc-info</code></dfn> |
| 214 |
|
<dd><p>A <code>misc-info</code> is raised when some status information |
| 215 |
|
on parsing or checking process that are considered useful for debugging |
| 216 |
|
and so on is available. It by no means implies the non-conformance of |
| 217 |
|
the document. |
| 218 |
</dl> |
</dl> |
| 219 |
|
|
| 220 |
<div class=ed><p>@@ TODO: #dt-atuseroption at user option |
<div class=ed><p>@@ TODO: #dt-atuseroption at user option |
| 239 |
<a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>. |
<a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>. |
| 240 |
<dt>For the document type declaration |
<dt>For the document type declaration |
| 241 |
<dd class=ed>@@ read external entity |
<dd class=ed>@@ read external entity |
| 242 |
|
<dd>The <code>entities</code> attribute of the <code>DocumentType</code> |
| 243 |
|
node <em class=rfc2119>MUST</em> contain a <code>NamedNodeMap</code> object |
| 244 |
|
whose first five items are as follows: |
| 245 |
|
<ol start=0> |
| 246 |
|
<li>An <code>Entity</code> node whose <code>nodeName</code> attribute |
| 247 |
|
is <code>amp</code>. It contains a <code>Text</code> node whose |
| 248 |
|
<code>data</code> attribute is set to <code>&</code>. |
| 249 |
|
<li>An <code>Entity</code> node whose <code>nodeName</code> attribute |
| 250 |
|
is <code>lt</code>. It contains a <code>Text</code> node whose |
| 251 |
|
<code>data</code> attribute is set to <code><</code>. |
| 252 |
|
<li>An <code>Entity</code> node whose <code>nodeName</code> attribute |
| 253 |
|
is <code>gt</code>. It contains a <code>Text</code> node whose |
| 254 |
|
<code>data</code> attribute is set to <code>></code>. |
| 255 |
|
<li>An <code>Entity</code> node whose <code>nodeName</code> attribute |
| 256 |
|
is <code>quot</code>. It contains a <code>Text</code> node whose |
| 257 |
|
<code>data</code> attribute is set to <code>"</code>. |
| 258 |
|
<li>An <code>Entity</code> node whose <code>nodeName</code> attribute |
| 259 |
|
is <code>apos</code>. It contains a <code>Text</code> node whose |
| 260 |
|
<code>data</code> attribute is set to <code>'</code>. |
| 261 |
|
</ol> |
| 262 |
<dt>For each internal general entity declaration being processed by the parser |
<dt>For each internal general entity declaration being processed by the parser |
| 263 |
<dd>If the |
<dd>If the |
| 264 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-EntityValue"><code>EntityValue</code></a> |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-EntityValue"><code>EntityValue</code></a> |
| 298 |
--> |
--> |
| 299 |
|
|
| 300 |
<dt>For each entity declaration being processed by the parser |
<dt>For each entity declaration being processed by the parser |
| 301 |
<dd>If the entity declaration declares a parameter entity and the |
<dd>Handle as follows: |
| 302 |
<code>Name</code> of the entity begins with the string <code>xml</code> |
<ol> |
| 303 |
(in any combination of upper- and lowercase letters), then the parser |
<li><p>If the entity declaration declares a general entity, the following |
| 304 |
<em class=rfc2119>MUST</em> raise an |
is applied: |
| 305 |
<a href="#xml-misc-warning" id=xmw-reserved-pe-name><code>xml-misc-warning</code></a>. |
<dl> |
| 306 |
<dd>If the entity declaration contains the <code>EntityValue</code>, then |
<dt>If the <code>Name</code> is <code>lt</code> or <code>amp</code> |
| 307 |
for each occurence of any references to unparsed entities in the |
<dd><p>If the entity declaration does not declare an internal entity, |
| 308 |
<code>EntityValue</code>, the parser <em class=rfc2119>MUST</em> raise an |
or if the replacement text of the entity is not the escaped form of |
| 309 |
<a href="#xml-misc-error" id=xme-unparsed-in-ev><code>xml-misc-error</code></a>. |
<code><</code> (if <code>lt</code>) or <code>&</code> (if |
| 310 |
<!-- |
<code>amp</code>), then the parser <em class=rfc2119>MUST</em> raise an |
| 311 |
<q>It is an error for a reference to an unparsed entity to appear in the |
<a href="#xml-misc-error" id=xme-double-escape><code>xml-misc-error</code></a>. |
| 312 |
EntityValue in an entity declaration.</q> |
|
| 313 |
--> |
<div class="note memo informative"> |
| 314 |
|
<p>In other word, the character in the <code>EntityValue</code> |
| 315 |
|
has to be double-escaped. |
| 316 |
|
</div> |
| 317 |
|
<dt>If the <code>Name</code> is <code>gt</code>, <code>quot</code>, or |
| 318 |
|
<code>apos</code> |
| 319 |
|
<dd><p>If the entity declaration does not declare an internal entity, |
| 320 |
|
or if the replacement text of the entity is not equal to or not the |
| 321 |
|
escaped form of <code>></code> (if <code>gt</code>), <code>"</code> (if |
| 322 |
|
<code>quot</code>), or <code>'</code> (if <code>apos</code>), then the |
| 323 |
|
parser <em class=rfc2119>MUST</em> raise an |
| 324 |
|
<a href="#xml-misc-error" id=xme-single-escape><code>xml-misc-error</code></a>. |
| 325 |
|
|
| 326 |
|
<div class="note memo informative"> |
| 327 |
|
<p>In other word, the character in the <code>EntityValue</code> |
| 328 |
|
has to be single- or double-escaped. |
| 329 |
|
</div> |
| 330 |
|
</dl> |
| 331 |
|
<!-- |
| 332 |
|
<q>If the entities lt or amp are declared, they MUST be declared as internal entities whose replacement text is a character reference to the respective character (less-than sign or ampersand) being escaped; the double escaping is REQUIRED for these entities so that references to them produce a well-formed result. If the entities gt, apos, or quot are declared, they MUST be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is OPTIONAL but harmless).</q> |
| 333 |
|
--> |
| 334 |
|
|
| 335 |
|
<li><p>If the entity declaration has to be ignored since there has already |
| 336 |
|
been declared an entity with the same <code>Name</code> as the declaration, |
| 337 |
|
then the parser <em class=rfc2119>MUST</em> raise a |
| 338 |
|
<a href="#misc-info" id=mi-ent-unique><code>misc-info</code></a> |
| 339 |
|
and abort these steps. |
| 340 |
|
|
| 341 |
|
<div class="informative note memo"> |
| 342 |
|
<p>Five predefined entities, i.e. <code>amp</code>, <code>lt</code>, |
| 343 |
|
<code>gt</code>, <code>quot</code>, and <code>apos</code>, are always |
| 344 |
|
declared implicitly and therefore any declaration for such an entity |
| 345 |
|
always raises an |
| 346 |
|
<a href="#misc-info" id=mi-ent-unique><code>misc-info</code></a>. |
| 347 |
|
</div> |
| 348 |
|
|
| 349 |
|
<li><p>If the entity declaration declares a parameter entity and the |
| 350 |
|
<code>Name</code> of the entity begins with the string <code>xml</code> |
| 351 |
|
(in any combination of upper- and lowercase letters), then the parser |
| 352 |
|
<em class=rfc2119>MUST</em> raise an |
| 353 |
|
<a href="#xml-misc-warning" id=xmw-reserved-pe-name><code>xml-misc-warning</code></a>. |
| 354 |
|
|
| 355 |
|
<li><p>If the entity declaration contains the <code>EntityValue</code>, |
| 356 |
|
then for each occurence of any references to unparsed entities in the |
| 357 |
|
<code>EntityValue</code>, the parser <em class=rfc2119>MUST</em> raise an |
| 358 |
|
<a href="#xml-misc-error" id=xme-unparsed-in-ev><code>xml-misc-error</code></a>. |
| 359 |
|
<!-- |
| 360 |
|
<q>It is an error for a reference to an unparsed entity to appear in the |
| 361 |
|
EntityValue in an entity declaration.</q> |
| 362 |
|
--> |
| 363 |
|
<li><p>If the entity declaration declares a general entity, then an |
| 364 |
|
<code>Entity</code> node <em class=rfc2119>MUST</em> be created and |
| 365 |
|
appended to the <code>NamedNodeMap</code> object in the |
| 366 |
|
<code>entities</code> attribute of the <code>DocumentType</code> node. |
| 367 |
|
|
| 368 |
|
<p class=ed>Read the external entity |
| 369 |
|
|
| 370 |
|
<p>If the replacement text of the entity is read, then parse the |
| 371 |
|
replacement text as if it were referenced from the content of an |
| 372 |
|
element (with no namespace bindings). If no <span class=ed>@@ parse error</span> |
| 373 |
|
is raised by the parsing process, then the nodes generated by the |
| 374 |
|
parsing <em class=rfc2119>MUST</em> be appended to the <code>Entity</code> |
| 375 |
|
node. The parse error <em class=rfc2119>MUST NOT</em> be propagated to |
| 376 |
|
the entire parsing process. Other kinds of errors |
| 377 |
|
<em class=rfc2119>MUST</em> be propagated. The first parse error |
| 378 |
|
<em class=rfc2119>MUST</em> abort the internal parsing process. |
| 379 |
|
<span class=ed>@@ better wording</span> |
| 380 |
|
|
| 381 |
|
<p class=ed>@@ prop |
| 382 |
|
|
| 383 |
|
<p>Then, the <code>Entity</code> node and its descendant |
| 384 |
|
<em class=rfc2119>MUST</em> be marked as read-only. |
| 385 |
|
</ol> |
| 386 |
|
|
| 387 |
<dt>For each notation declaration being processed by the parser |
<dt>For each notation declaration being processed by the parser |
| 388 |
<dd>If there is another processed notation declaration whose |
<dd>If there is another processed notation declaration whose |
| 495 |
|
|
| 496 |
<!-- |
<!-- |
| 497 |
|
|
|
|
|
| 498 |
@@ Need detailed review, but maybe should be in parsing phase |
@@ Need detailed review, but maybe should be in parsing phase |
| 499 |
|
|
| 500 |
#vc-check-rmd Validity constraint: Standalone Document Declaration |
#vc-check-rmd Validity constraint: Standalone Document Declaration |
| 504 |
#wf-entdeclared Well-formedness constraint: Entity Declared |
#wf-entdeclared Well-formedness constraint: Entity Declared |
| 505 |
#vc-entdeclared Validity constraint: Entity Declared |
#vc-entdeclared Validity constraint: Entity Declared |
| 506 |
"For interoperability, valid documents SHOULD declare the entities amp, lt, gt, apos, quot, in the form specified in 4.6 Predefined Entities." |
"For interoperability, valid documents SHOULD declare the entities amp, lt, gt, apos, quot, in the form specified in 4.6 Predefined Entities." |
|
"If the entities lt or amp are declared, they MUST be declared as internal entities whose replacement text is a character reference to the respective character (less-than sign or ampersand) being escaped; the double escaping is REQUIRED for these entities so that references to them produce a well-formed result. If the entities gt, apos, or quot are declared, they MUST be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is OPTIONAL but harmless)." |
|
| 507 |
|
|
| 508 |
@@ flaged and then reported in DOM check phase |
@@ flaged and then reported in DOM check phase |
| 509 |
|
|
| 958 |
<a href="#algorithm-to-check-a-node" title="check a node">check the |
<a href="#algorithm-to-check-a-node" title="check a node">check the |
| 959 |
node</a> recursively.</li> |
node</a> recursively.</li> |
| 960 |
<li class=ed>@@ externally declared?</li> |
<li class=ed>@@ externally declared?</li> |
| 961 |
|
<li>If the <code>NamedNodeMap</code> object in the <code>entities</code> |
| 962 |
|
attribute of <var>n</var> does not contain <code>Entity</code> nodes |
| 963 |
|
whose <code>nodeName</code> attribute are <code>amp</code>, |
| 964 |
|
<code>lt</code>, <code>gt</code>, <code>apos</code>, and <code>quot</code> |
| 965 |
|
then raise |
| 966 |
|
<a href="#xml-misc-recommentation" id=xmr-predefined><code>xml-misc-recommendation</code></a>(s). |
| 967 |
</ol> |
</ol> |
| 968 |
</dd> |
</dd> |
| 969 |
<dt>If <var>n</var> is an <code>Element</code> node</dt> |
<dt>If <var>n</var> is an <code>Element</code> node</dt> |