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

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

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

revision 1.1 by wakaba, Sun Dec 2 04:19:12 2007 UTC revision 1.21 by wakaba, Sat Dec 8 07:01:08 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>manakai's XML Conformance Checking</title>  <title>DOM Document Type Definition Module</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="stylesheet" href="http://suika.fam.cx/www/style/def/dom">
7  <link rel="license" href="http://suika.fam.cx/c/gnu/fdl">  <link rel="license" href="http://suika.fam.cx/c/gnu/fdl">
 <style>  
   a[id]::before {  
     content: "[" attr(id) "]";  
     color: gray;  
     font-size: 70%;  
     font-family: Courier New, monospace;  
     vertical-align: 60%;  
   }  
 </style>  
8  </head>  </head>
9  <body class="has-abstract">  <body class="has-abstract">
10    
11  <div class="header">  <div class="header">
12  <h1>manakai's <abbr>XML</abbr> Conformance Checking</h1>  <h1>DOM Document Type Definition Module</h1>
13  <h2>Working Draft <time datetime=2007-12-01>1 December 2007</time></h2>  <h2>Working Draft <time datetime=2007-12-08>8 December 2007</time></h2>
14    
15  <dl class="versions-uri">  <dl class="versions-uri">
16  <dt>This Version</dt>  <dt>This Version</dt>
17    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work"    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work"
18        >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>&gt;</code></dd>        >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>&gt;</code></dd>
19  <dt>Latest Version</dt>  <dt>Latest Version</dt>
20    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc"    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef"
21        >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc</a>&gt;</code></dd>        >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef</a>&gt;</code></dd>
22  <dt>Latest Working Draft</dt>  <dt>Latest Working Draft</dt>
23    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work"    <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work"
24        >http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>&gt;</code></dd>        >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>&gt;</code></dd>
25  <!-- <dt>Previous Version</dt> -->  <!-- <dt>Previous Version</dt> -->
26  <dt>Version History</dt>  <dt>Version History</dt>
27    <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>    <dd><code class=URI>&lt;<a href="http://suika.fam.cx/gate/cvs/markup/xml/domdtdef/domdtdef-work.en.html">http://suika.fam.cx/gate/cvs/markup/xml/domdtdef/domdtdef-work.en.html</a>&gt;</code></dd>
28  </dl>  <dt id=author>Author</dt>
 <dl class="authors" id="author">  
 <dt>Author</dt>  
29    <dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author"    <dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author"
30        lang=ja>Wakaba</a>        lang=ja>Wakaba</a>
31    <code class="mail">&lt;<a href="mailto:w@suika.fam.cx" rel="author"    <code class="mail">&lt;<a href="mailto:w@suika.fam.cx" rel="author"
# Line 72  at the time of its publication.  Other d Line 62  at the time of its publication.  Other d
62  might supersede this document.</em></p>  might supersede this document.</em></p>
63    
64  <p>This document is a working draft, produced as part of the  <p>This document is a working draft, produced as part of the
 <a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a>  
 subproject of the  
65  <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a>  <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a>
66  project.  It might be updated, replaced, or obsoleted by  project.  It might be updated, replaced, or obsoleted by
67  other documents at any time.  It is inappropriate to  other documents at any time.  It is inappropriate to
# Line 92  normative version.</p> Line 80  normative version.</p>
80    
81  <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>  <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>
82    
83  <div class="issue ed">...</div>  <div class="issue ed">
84    <p>This is a work-in-progress specification for DOM Document Type
85    Definition module, as implemented by manakai and
86    <a href="http://suika.fam.cx/gate/2005/sw/DOM%20XML%20Document%20Type%20Definition">partially documented in the SuikaWiki</a>.</p>
87    </div>
88    
89    <p>The <dfn id=term-dom-dtdef><abbr>DOM</abbr> Document Type Definition</dfn>
90    module is a set of <abbr>DOM</abbr> interfaces, including both new
91    interfaces and modifications to existing <abbr>DOM</abbr> interfaces,
92    over which <abbr>DOM</abbr> applications are able to access to the
93    definitions of the document type.</p>
94    
95    <p>Interfaces defined in this specification are partially modeled from
96    early drafts of <abbr>DOM</abbr> level 1 <span class=ed>@@ ref</span>,
97    <abbr>DOM</abbr> Abstract Schema level 3 <span class=ed>@@ ref</span>, and
98    <abbr>XML</abbr> Schema <abbr>API</abbr>, but are not compatible with
99    any of them as a whole.</p>
100  </div>  </div>
101    
102  <div class="section" id="terminology">  <div class="section" id="terminology">
# Line 118  else in this specification is normative. Line 120  else in this specification is normative.
120  <p><span class=ed>Algorithm is normative but non-normative</span>.  <p><span class=ed>Algorithm is normative but non-normative</span>.
121  In addition, the order in which <a href="#errors">errors</a> are  In addition, the order in which <a href="#errors">errors</a> are
122  raised is undefined.</p>  raised is undefined.</p>
 </div>  
123    
124    <p class=ed><var>A</var> object is an object implementing <var>A</var>
125    interface.</p>
126    
127  <div class=section id=error-categories>  <p class=ed>@@ ref to DOM Binding Spec</p>
 <h2>Error Classification</h2>  
128    
129  <p class=ed>If a <code>Document</code> node has no  <p>If the <code>strictErrorChecking</code> attribute of the
130  xml-well-formedness-error, entity-error, and unknown-error,  <code>Document</code> node is <code>false</code>, the methods are
131  then it is well-formed.  If a well-formed <code>Document</code>  not required to raise exceptions <span class=ed>[DOM3]</span>.</p>
132  node has no xml-validity-error, it is valid.</p>  
133    <div class=ed>
134    <p>Conformant product classes: implementation, XML parser (XML document ->
135    DOM converter), XML serializer (DOM -> XML document covnerter).
136    XML Infoset -> DOM converter, and DOM -> XML Infoset converter.</p>
137    </div>
138    </div>
139    
140  <div class="note memo">  <div class=section id=dom-dtdef>
141  <p>A well$B!>(Bformed <code>Document</code> can be safely serialized  <h2><abbr>DOM</abbr> Document Type Definition Module</h2>
142  into a well$B!>(Bformed XML document.  A valid <code>Document</code>  
143  can be easily serialized into a valid XML document.</p>  <p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0,
144    introduces four interfaces:
145    <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>,
146    <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>,
147    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
148    and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>.
149    In addition, it modifies existing interfaces
150    <a href="#Node"><code>Node</code></a>,
151    <a href="#Document"><code>Document</code></a>,
152    <a href="#DocumentType"><code>DocumentType</code></a>,
153    <a href="#Entity"><code>Entity</code></a>, and
154    <a href="#Notation"><code>Notation</code></a>.</p>
155    
156    <div class=section id=features>
157    <h3>Feature Name</h3>
158    
159    <p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of
160    the <abbr>DOM</abbr> Document Type Definition module, the
161    <code>hasFeature</code> method of a <code>DOMImplementation</code> object
162    <em class=rfc2119>MUST</em> return <code>true</code> when the parameters are
163    set to
164    <dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn>
165    and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively.</p>
166    
167    <p>In such an implementation, the <code>getFeature</code> method of a
168    <code>Document</code> object <em class=rfc2119>MUST</em> return the (at least
169    conceptually) same object implementing the
170    <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when
171    the parameters are set to
172    <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
173    and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively.  
174    Likewise, any method that takes one or more feature names with or without
175    version number, including the methods <code>hasFeature</code> and
176    <code>getFeature</code>, <em class=rfc2119>MUST</em> behave in a manner
177    consistent with the aforementioned cases.</p>
178  </div>  </div>
179    
180  <p class=ed>To be a conforming <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-validating">validating XML processor</a>,  <div class=section id=section-node>
181  ...</p>  <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
182    
183  <p>Errors are classified into these  <p>The implementation of the
184  <dfn id=error-category title="error category">error categories</dfn>:</p>  <a href="#Node"><code>Node</code></a> interface
185    <em class=rfc2119>MUST</em> be modified as following:</p>
186    <pre class=idl><code>// Additions to the Node interface
187    
188    // Additions to the NodeType definition group
189    const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
190    const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
191    </pre>
192    
193    <p>This specification adds two new types (subinterfaces) of
194    <a href="#Node"><code>Node</code></a>: element type definition (node type
195    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
196    interface
197    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
198    attribute definition (node type
199    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
200    interface
201    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).  For
202    these kinds of nodes, methods and attributes in the
203    <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
204    
205  <dl id=errors>  <dl>
206  <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>  <dt><code id=attributes>attributes</code></dt>
207    <dd>    <dd>
208      <p class=ed>@@</p>      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
209      <div class="note memo">      <code>null</code>.</p>
       <p>This <span class=ed>algorithm</span> does not support  
       <abbr>DOM</abbr> tree with one or more <code>EntityReference</code>  
       nodes.  It is expected that any entity references are expanded  
       at the parse time and any unexpandable entity references  
       make parse time errors raised so that never result in  
       <abbr>DOM</abbr> tree with <code>EntityReference</code> nodes.</p>  
     </div>  
210    </dd>    </dd>
211  <dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt>  <dt><code id=baseURI>baseURI</code></dt>
   <dd class=ed>@@</dd>  
 <dt><dfn id=round-trip-warning><code>round-trip-warning</code></dfn></dt>  
212    <dd>    <dd>
213      <p>A <a href="#round-trip-warning"><code>round-trip-warning</code></a>      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
214      will be raised when a construct, which might not be restored to the same      value of the <a href="#baseURI"><code>baseURI</code></a> attribute
215      construct when it is serialized and then re-parsed by a conforming      of the node in the <code>ownerDocument</code> attribute of the node.
216      processor, is encountered.</p>      Note that the value might be <code>null</code>.</p>
     <div class="example memo">  
       <p>For a <code>Comment</code> node a  
       <a href="#round-trip-warning"><code>round-trip-warning</code></a> will  
       be raised, since <abbr>XML</abbr> processors are not required to  
       report texts of comments for applications.</p>  
     </div>  
217    </dd>    </dd>
218  <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>  <dt><code id=cloneNode>cloneNode</code></dt>
219      <dd class=ed>@@</dd>
220      <dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd>
221    <dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt>
222    <dd class=ed>@@</dd>    <dd class=ed>@@</dd>
223  <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>  <dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt>
224    <dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0    <dd><p>When invoked, the method <em class=rfc2119>MUST</em> return
225    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>    <code>false</code>.</p></dd>
226    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> /  <dt><code id=isEqualNode>isEqualNode</code></dt>
227    <abbr>XML</abbr> 1.1    <dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method,
228    <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>    following items are added to the list of conditions for equality:</p>
229    <a href="@@/#dt-error">error</a>)  
230    that is not classified to any other <a href="#error-category">error    <ul>
231    category</a>.</dd>    <li>
232  <dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt>      <p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a>
233    <dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0      and at least one of them has the support for the feature
234    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>      <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p>
235    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal      <ul>
236    error</a> / <abbr>XML</abbr> 1.1      <li>they are equal according to <abbr>DOM</abbr> level 3 definition
237    <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>      <span class=ed>@@ ref</span>, and
238    <a href="@@/#dt-fatal">fatal error</a>)      <li>either:
239    that is not classified to any other <a href="#error-category">error        <ul><!--
240    category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>        <li>both of them does not support the feature
241  <dt><dfn id=xml-misc-recommendation><code>xml-misc-recommendation</code></dfn></dt>        <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>-->
242          <li>exactly one of them support the feature
243          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
244          and the <code>length</code> attribute of the <code>NamedNodeMap</code>
245          object in the <a href="#elementTypes"><code>elementTypes</code></a>
246          attribute of it is equal to <code>0</code>, or</li>
247          <li>both of them support the feature
248          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
249          and the values of the
250          <a href="#elementTypes"><code>elementTypes</code></a> attributes are
251          equal (equality of the
252          <a href="#elementTypes"><code>elementTypes</code></a> attribute is same
253          as that for the <code>attributes</code> attribute).</li>
254          </ul>
255        </li>
256        </ul>
257      </li>
258    
259      <li><p>If the nodes are
260      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
261      the values of the
262      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
263      attributes are equal (equality of the
264      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
265      attribute is same as that for the <code>attributes</code> attribute).</p></li>
266    
267      <li><p>If the nodes are
268      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
269      the values of the <a href="#declaredType"><code>declaredType</code></a> and
270      the <a href="#defaultType"><code>defaultType</code></a> attributes are
271      equal respectively.</p></li>
272    
273      <li><p>If the nodes are
274      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
275      the values of the <code>DOMStringList</code> objects in the
276      <a href="#allowedTokens"><code>allowedTokens</code></a> attributes
277      are equal, i.e. their <code>length</code> attribute values are equal and
278      each string exists in a list is contained in another list (their indeces
279      may be different), with an additional constraint that the number of the
280      items that are equal to a string in a list is equal to the number
281      of the items equal to the string in another list.</p></li>
282      </ul></dd>
283    <dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and
284    <code id=lookupPrefix>lookupPrefix</code></dt>
285      <dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return
286      <code>null</code>.</p></dd>
287    <dt><code id=nodeName>nodeName</code></dt>
288    <dd>    <dd>
289      <p>An      <p>If the node is an
290      <a href="#xml-misc-recommendation"><code>xml-misc-recommendation</code></a>      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
291      will be raised if a <em class=rfc2119>SHOULD</em>$B!>(Blevel requirement      On getting, the attribute <em class=rfc2119>MUST</em> return the
292      in <abbr>XML</abbr> specification is not met.</p>      name of the element type definition represented by the node.</p>
293    
294        <p>If the node is an
295        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
296        On getting, the attribute <em class=rfc2119>MUST</em> return the
297        name of the attribute definition represented by the node.</p>
298    </dd>    </dd>
299  <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>  <dt><code id=nodeType>nodeType</code></dt>
300    <dd>A violation of validity constraint in XML document.</dd>    <dd>
301  <dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt>      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
302    <dd><p>If an <code>xml-well-formedness-error</code> is raised,      <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
303    it would not be possible to generate an XML serialization that      (if the node is an
304    would match to the appropriate production rule and that would not      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
305    violate to any well$B!>(Bformedness constraint in XML      <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
306    specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,      (if the node is an
307    <a href="#ref-XML11">XML11</a>]</cite>.</p></dd>      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
308  </dl>  
309        <!-- NodeType -->
310  <div class=ed><p>@@ TODO: #dt-atuseroption at user option  <p>Two constants are added to the <code id=NodeType>NodeType</code>
311  (MAY or MUST), #dt-compat for compatibility,  definition group of the <a href="#Node"><code>Node</code></a> interface as
312  #dt-interop for interoperability</p></div>  following:</p>
313    <table>
314  </div>  <thead>
315    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
316  <div class=section id=parsing-xml>  </thead>
317  <h2>Parsing <abbr>XML</abbr> Document</h2>  <tbody>
318    <tr>
319  <ul>  <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
320  <li>If the <abbr>XML</abbr> document does not begin with an  <td><code>81001</code><td>The node is an
321  <abbr>XML</abbr> declaration, then raise an  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
322  <a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>.</li>  <tr>
323  <li>If the replacement text of an entity declaration is  <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
324  <code>&lt;</code>, then raise an  <td><code>81002</code><td>The node is an
325  <a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!--  <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
326  "strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11].  </tbody>
327  --></li>  </table>
328  <li>If there is an element type declaration whose <code>Name</code>    </dd>
329  value is already declared, then raise an  <dt><code id=nodeValue>nodeValue</code> and
330  <a href="#xml-validity-error" id=vc-edunique><code>xml-validity-error</code></a>.</li>  <code id=textContent>textContent</code></dt>
331  <li>If attribute definition whose <code>Name</code> is    <dd>
332  <code>xml:space</code> has <span class=ed>declared type different from      <p>If the node is an
333  (default|preserve), (default), or (preserve)</span>, then raise an      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
334  <a href="#xml-misc-error" id=xme-ad-xml-space><code>xml-misc-error</code></a>.      On getting, the attributes <em class=rfc2119>MUST</em> return
335  <span class=ed>@@ duplication with      <code>null</code>.</p>
 <a href="#xml-at-xml-space">#xml-at-xml-space</a>.<!--  
 <!ATTLIST e xml:space CDATA #IMPLIED xml:space CDATA #IMPLIED> --></span></li>  
 <li>If an empty-element tag is used for an element which is <em>not</em>  
 declared <code>EMPTY</code>, then raise an  
 <a href="#xml-misc-recommentation" id=xmr-emptyelemtag-not-empty><code>xml-misc-recommendation</code></a>.</li>  
 <li>If an empty-element tag is <em>not</em> used for an element which is  
 declared <code>EMPTY</code>, then raise an  
 <a href="#xml-misc-recommentation" id=xmr-empty-not-emptyelemtag><code>xml-misc-recommendation</code></a>.</li>  
 <!--  
   
 #vc-PEinMarkupDecl Validity constraint: Proper Declaration/PE Nesting  
 #wfc-PEinInternalSubset Well-formedness constraint: PEs in Internal Subset  
 #ExtSubset Well-formedness constraint: External Subset  
 #PE-between-Decls Well-formedness constraint: PE Between Declarations  
 #GIMatch Well-formedness constraint: Element Type Match  
 #uniqattspec Well-formedness constraint: Unique Att Spec  
 #NoExternalRefs Well-formedness constraint: No External Entity References  
 #CleanAttrVals Well-formedness constraint: No < in Attribute Values  
 #vc-PEinGroup Validity constraint: Proper Group/PE Nesting  
 "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 ,)."  
 "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."  
 #condsec-nesting Validity constraint: Proper Conditional Section/PE Nesting  
 #wf-Legalchar Well-formedness constraint: Legal Character  
 #textent Well-formedness constraint: Parsed Entity  
 #norecursion Well-formedness constraint: No Recursion  
 #indtd Well-formedness constraint: In DTD  
 "External parsed entities SHOULD each begin with a text declaration."  
 "It is an error for a reference to an unparsed entity to appear in the EntityValue in an entity declaration."  
 #UniqueNotationName Validity constraint: Unique Notation Name  
   
 @@ Need detailed review, but maybe should be in parsing phase  
   
 #vc-check-rmd Validity constraint: Standalone Document Declaration  
   
 @@ Need dtailed review  
   
 #wf-entdeclared Well-formedness constraint: Entity Declared  
 #vc-entdeclared Validity constraint: Entity Declared  
 "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)."  
   
 @@ flaged and then reported in DOM check phase  
   
 "Entities encoded in UTF-16 MUST and entities encoded in UTF-8 MAY begin with the Byte Order Mark"  
 "In the absence of external character encoding information (such as MIME headers), parsed entities which are stored in an encoding other than UTF-8 or UTF-16 MUST begin with a text declaration"  
 "In an encoding declaration, the values "UTF-8", "UTF-16", "ISO-10646-UCS-2", and "ISO-10646-UCS-4" SHOULD be used for the various encodings and transformations of Unicode / ISO/IEC 10646, the values "ISO-8859-1", "ISO-8859-2", ... "ISO-8859-n" (where n is the part number) SHOULD be used for the parts of ISO 8859, and the values "ISO-2022-JP", "Shift_JIS", and "EUC-JP" SHOULD be used for the various encoded forms of JIS X-0208-1997. It is RECOMMENDED that character encodings registered (as charsets) with the Internet Assigned Numbers Authority [IANA-CHARSETS], other than those just listed, be referred to using their registered names; other encodings SHOULD use names starting with an "x-" prefix."  
336    
337  @@ in parsing phase      <div class="note memo">
338          <p>Thus, on setting the attributes does nothing
339          <span class=ed>[DOM3]</span>.</p>
340        </div>
341    
342  "It is a fatal error when an XML processor encounters an entity with an encoding that it is unable to process. It is a fatal error if an XML entity is determined (via default, encoding declaration, or higher-level protocol) to be in a certain encoding but contains byte sequences that are not legal in that encoding."      <p>On setting, the <a href="#textContent"><code>textContent</code></a>
343        attribute <em class=rfc2119>MUST NOT</em> raise a
344        <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>.
345        <span class=ed>@@ I forgot why this requirement is necessary.</span></p>
346    
347      <p>If the node is an
348      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
349      The attribute <em class=rfc2119>MUST</em> behave as if the node
350      were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd>
351    <dt><code id=normalize>normalize</code></dt>
352      <dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is
353      normalized, any nodes in the <code>NamedNodeMap</code> object in the
354      <a href="#elementTypes"><code>elementTypes</code></a> attribute
355      <em class=rfc2119>MUST</em> be normalized as well.</p>
356    
357      <p>When an
358      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
359      is normalized, any nodes in the <code>NamedNodeMap</code> object in the
360      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
361      attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd>
362    <dt class=ed>@@ ...</dt>
363    </dl>
364    
 -->  
 </ul>  
365  </div>  </div>
366    
367  <div class="section" id=checking-dom>  <div class=section id=section-document>
368  <h2>Checking <abbr>DOM</abbr></h2>  <h3>Modifications to the <code id=Document>Document</code> Interface</h3>
   
 <p>The following algorithms and definitions are applied to  
 <abbr>XML</abbr> documents; especially, they are not applied  
 to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>  
   
 <div class=section id=definitions>  
 <h3>Definitions</h3>  
   
 <p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is  
 the <abbr>XML</abbr> version of the document to which the node belongs.  
 For a <code>Documemt</code> node, the <abbr>XML</abbr> version  
 of the document is the value of the <code>xmlVersion</code>  
 attribute of the node.  For a <code>DocumentType</code> node whose  
 <code>ownerDocument</code> attribute is set to <code>null</code>,  
 the <abbr>XML</abbr> version of the document is <code>1.0</code><!--  
 since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->.  
 For any other node, the <abbr>XML</abbr> version of the document  
 is that of the <code>Document</code> node contained in the  
 <code>ownerDocument</code> attribute of the node.</p>  
   
 </div>  
   
   
 <div class=section id=checking-components>  
 <h3>Conformance Checking Algorithms for Components</h3>  
   
 <p>To  
 <dfn id=algorithm-to-validate-an-xml-character-data title="validate an XML string">to  
 validate an <abbr>XML</abbr> string (<dfn id=var-s><var>s</var></dfn>)</dfn>,  
 the following algorithm <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
 <li>If <var>s</var> contains a character that is <em>not</em> in  
 the character class <a href="#class-Char10"><code>Char10</code></a>,  
 then raise an  
 <a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li>  
 <li>If <var>s</var> contains a character that is in the character  
 class <a href="#class-CompatChar10"><code>CompatChar10</code></a>,  
 then raise an  
 <a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li>  
 <li>If <var>s</var> contains a character that is in the character  
 class <a href="#class-ControlChar10"><code>ControlChar10</code></a>,  
 then raise an  
 <a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li>  
 <li class=ed>@@ XML 1.1 support</li>  
 <li>If <var>s</var> contains a <code class=char>U+000D</code>  
 <code class=charname>CARRIAGE RETURN</code> character, then  
 raise a  
 <a href="#round-trip-error" id=rte-cr><code>round-trip-error</code></a>.  
 <span class=ed>@@ We should not raise duplicate errors for U+000D  
 in attribute values.  In addition, we should support a mode where  
 U+000D will be serialized as &#x000D; (so that no round-trip-error  
 will be raised).</span></li>  
 </ol>  
   
 <p>To  
 <dfn id=algorithm-to-validate-a-name title="validate a Name">validate a  
 <code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn>, the following  
 algorithm <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
 <li>If <var>s</var> is an empty string, then raise an  
 <a href="#xml-well-formedness-error" id=wfe-name-empty><code>xml-well-formedness-error</code></a>.  
 Abort these steps.</li>  
 <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate  
 <var>s</var> as an <abbr>XML</abbr> string</a>.</li>  
 <li>If the first character in <var>s</var> is a character that is  
 <em>not</em> in the character class  
 <a href="#class-NameStartChar10"><code>NameStartChar10</code></a>, then raise  
 an  
 <a href="#xml-well-formedness-error" id=wfe-name-startchar><code>xml-well-formedness-error</code></a>.</li>  
 <li>If a character other than the first character in <var>s</var> is a  
 character that is <em>not</em> in the character class  
 <a href="#class-NameChar10"><code>NameChar10</code></a>, then raise an  
 <a href="#xml-well-formedness-error" id=wfe-name-char><code>xml-well-formedness-error</code></a>.</li>  
 <li>If <var>s</var> begins with the string <code>xml</code> (in any  
 case combination), then raise an  
 <a href="#xml-misc-warning" id=xmw-reserved-name><code>xml-misc-warning</code></a>.  
 <span class=ed>@@ except for attribute names <code>xml:lang</code>,  
 <code>xml:space</code>, <code>xml:base</code>, <code>xml:id</code>,  
 <code>xmlns</code>, <code>xmlns:<var>*</var></code>,  
 pi name <code>xml-stylesheet</code>.</span><!--  
 "names beginning with a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization in this or future versions of this specification.":  
 xmlns, xml-stylesheet, xml:base and xml:id specifications violate to this sentense!  
 --></li>  
 <!-- COLON in Name is a lowercase "should not" in a Note of [XML10],  
 [XML11]. -->  
 <li class=ed>@@ XML 1.1 support</li>  
 </ol>  
   
 <p>To  
 <dfn id=algorithm-to-validate-an-ncname title="validate an NCName">validate  
 an <code>NCName</code> (<dfn id=var-ncname-s><var>s</var></dfn>)</dfn>, the  
 following algorithm <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
 <li><a href="#algorithm-to-validate-a-name" title="validate a Name">Validate  
 <var>s</var> as a <code>Name</code></a>.</li>  
 <li class=ed>@@</li>  
 </ol>  
   
 <p>To  
 <dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate  
 a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the  
 following algorithm <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
 <li>If <var>pid</var> is <code>null</code>, abort these steps.</li>  
 <li>If <var>pid</var> contains a character that is <em>not</em> in the  
 character class <a href="#class-PubidChar"><code>PubidChar</code></a>, then  
 raise an  
 <a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li>  
   <li>If <var>pid</var> contains one of <code class=char>U+0009</code>  
   <code class=charname>CHARACTER TABULATION</code>,  
   <code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>,  
   and <code class=char>U+000D</code> <code class=charname>LINE FEED</code>  
   characters, if the first character of <var>pid</var> is  
   <code class=char>U+0020</code> <code class=charname>SPACE</code> character,  
   if the last character of <var>pid</var> is <code class=char>U+0020</code>  
   <code class=charname>SPACE</code> character, or if there is a  
   <code class=char>U+0020</code> <code class=charname>SPACE</code> character  
   immediately followed by another <code class=char>U+0020</code>  
   <code class=charname>SPACE</code> character in <var>pid</var>, then it is a  
   <a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>.  
   <span class=ed>Is this really a roundtripness problem?  XML spec  
   does only define the way to match public identifiers in fact, no  
   canonical form.</span></li>  
 </ol>  
   
 <p>To  
 <dfn id=algorithm-to-validate-a-system-identifier title="validate a system identifier">validate  
 a system identifier (<dfn id=var-sid><var>sid</var></dfn>)</dfn>, the  
 following algorithm <em class=rfc2119>MUST</em> be used:</p>  
 <ol>  
   <li>If <var>sid</var> is <code>null</code>, abort these steps.</li>  
 <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate  
 <var>sid</var> as an <abbr>XML</abbr> string</a>.</li>  
   <li>If <var>sid</var> contains both <code class=char>U+0022</code>  
   <code class=charname>QUOTATION MARK</code> (<code class=char>"</code>) and  
   <code class=char>U+0027</code> <code class=charname>APOSTROPHE</code>  
   (<code class=char>'</code>) characters, raise an  
   <a href="#xml-well-formedness-error" id=wfe-sid-lit><code>xml-well-formedness-error</code></a>.</li>  
   <li>If <var>sid</var> contains at least one <code class=char>U+0023</code>  
   <code class=charname>NUMBER SIGN</code> (<code class=char>#</code>)  
   character, then raise an  
   <a href="#xml-misc-error" id=xme-sid-fragment><code>xml-misc-error</code></a>.</li>  
   <li class=ed>@@ If <var>sid</var> cannot be converted to a URI  
   reference, then raise a fact-level error (xml-misc-warning?).<!--  
   XML 1.0 has no conformance language for system identifier being  
   a URI reference. --></li>  
 </ol>  
369    
370    <p>If an attempt is made to adopt an
371    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
372    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
373    the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em>
374    raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@
375    ref</span>.</p>
376  </div>  </div>
377    
378  <div class=section id=checking-node>  <div class=section id=section-documentxdoctype>
379  <h3>Checking <code>Node</code></h3>  <h3>The <code>DocumentXDoctype</code> Interface</h3>
380    
381  <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to  <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
382  check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as  <em class=rfc2119>MUST</em> be implemented as following:</p>
383  following:</p>  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
384  <dl class=switch>    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
385  <dt>If <var>n</var> is an <code>Attr</code> node</dt>      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
386    <dd>      raises (DOMException);
387      <ol>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
388      <li><a href="#algorithm-to-validate-an-ncname">Validate the      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
389      <code>localName</code> attribute value as an <code>NCName</code></a>.</li>      raises (DOMException);
390      <li>If the <code>prefix</code> attribute value is different from    <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
391      <code>null</code>, then <a href="#algorithm-to-validate-an-ncname">validate      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
392      the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>      raises (DOMException);
393      <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the    <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
394      <code>childNodes</code> list of <var>n</var>,      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
395        <ol>      raises (DOMException);
396        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a    <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
397        <code>Text</code> or <code>EntityReference</code> node, then it is an      (in DOMString <a href="#createNotation-name"><var>name</var></a>)
398        <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>      raises (DOMException);
399        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an  }</code></pre>
400        <code>EntityReference</code> node, then it is an  
401        <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>  <div class=ed>@@ cast definition</div>
402        <li>Otherwise,  
403        <a href="#algorithm-to-check-a-node" title="check a node">check  <dl>
404        <var>n<sub><var>c</var></sub></var></a> recusrively.</li>  <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,
405        </ol></li>  method</dt>
     <li>If <code>nodeName</code> attribute of <var>n</var> is  
     <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>  
     and <code>value</code> attribute of <var>n</var> is neither  
     <code>default</code> nor <code>preserve</code>, then it is an  
     <a href="#xml-misc-error" id=xme-attr-xml-space><code>xml-misc-error</code></a>.<!--  
     Note that <!ATTLIST e xml:space (default|preserve) "a">...  
     <e xml:space="default"/> is conforming and valid. --></li>  
     <li class=ed>@@ xml:lang value is not a language tag [RFC 3066 or its  
     successor] or an empty string, then xml-misc-warning  
     (a "fact"-level error; not an XML error).</li>  
     <li class=ed>@@ <code>specified</code>,  
     <code>manakaiAttributeType</code> (#ValueType Validity constraint: Attribute Value Type)</li>  
     <!-- xml:space MUST be declared to be valid. -->  
     <li>Let <dfn id=var-v><var>v</var></dfn> be the value of the  
     attribute <code>value</code> of <var>n</var>.</li>  
     <li>Validate the <var>n</var> against the <span class=ed>declared  
     type</span> as following:  
       <dl class=switch>  
       <dt class=ed><code>ID_ATTR</code></dt>  
         <dd>  
           <ol>  
           <li><span class=ed>Validate <var>v</var> as an  
           <code>Name</code>.</span>  If it fails, then raise an  
           <a href="#xml-validity-error" id=vc-id-name><code>xml-validity-error</code></a>.</li>  
           <li><span class=ed>If <code>ID</code> <var>v</var> is defined,</span>  
           then raise an    
           <a href="#xml-validity-error" id=vc-id-duplication><code>xml-validity-error</code></a>.</li>  
           </ol>  
         </dd>  
       <dt class=ed>IDREF_ATTR</dt>  
         <dd>  
           <ol>  
           <li><span class=ed>Validate <var>v</var> as an  
           <code>Name</code>.</span>  If it fails, then raise an  
           <a href="#xml-validity-error" id=vc-idref-name><code>xml-validity-error</code></a>.</li>  
           <li><span class=ed>If <code>ID</code> <var>v</var> is NOT  
           defined,</span> then raise an    
           <a href="#xml-validity-error" id=vc-idref-match><code>xml-validity-error</code></a>.</li>  
           </ol>  
         </dd>  
       <dt class=ed>IDREFS_ATTR</dt>  
         <dd class=ed>@@</dd>  
       <dt class=ed>ENTITY_ATTR</dt>  
         <dd>  
           <ol>  
           <li><span class=ed>Validate <var>v</var> as an  
           <code>Name</code>.</span>  If it fails, then raise an  
           <a href="#xml-validity-error" id=vc-entname-name><code>xml-validity-error</code></a>.</li>  
           <li><span class=ed>If <code>Entity</code> <var>v</var> is NOT  
           defined,</span> then raise an    
           <a href="#xml-validity-error" id=vc-entname-match><code>xml-validity-error</code></a>.</li>  
           </ol>  
         </dd>  
       <dt class=ed>ENTITIES_ATTR</dt>  
         <dd class=ed>@@</dd>  
       <dt class=ed>NMTOKEN_ATTR</dt>  
         <dd>  
           <ol>  
           <li><span class=ed>Validate <var>v</var> as an  
           <code>Nmtoken</code>.</span>  If it fails, then raise an  
           <a href="#xml-validity-error" id=vc-nmtok-name><code>xml-validity-error</code></a>.</li>  
           </ol>  
         </dd>  
       <dt class=ed>NMTOKENS_ATTR</dt>  
         <dd class=ed>@@</dd>  
       <dt class=ed>NOTATION_ATTR</dt>  
         <dd class=ed><var>v</var> must be one of enumerated values.  
         If not, then raise an  
         <a href="#xml-validity-error" id=vc-notatn-match><code>xml-validity-error</code></a>.</dd>  
       <dt class=ed>ENUMERATED_ATTR</dt>  
         <dd class=ed><var>v</var> must be one of enumerated values.  
         If not, then raise an  
         <a href="#xml-validity-error" id=vc-enum><code>xml-validity-error</code></a>.</dd>  
       <dt class=ed>@@</dt>  
       </dl>  
     </li>  
     <li>If <span class=ed>type ID and default is NOT #IMPLIED or #REQUIRED</span>, then  
     raise an  
     <a href="#xml-validity-error" id=vc-id-default><code>xml-validity-error</code></a>.</li>  
     <li class=ed>@@ #FixedAttr Validity constraint: Fixed Attribute Default</li>  
     <li class=ed>@@ strict serialization error for U+000D, U+000A, and  
     U+0009 characters, leading/trailing U+0020, and U+0020{2,} string?</li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt>  
   <dd>  
     <ol>  
     <li class=ed></li>  
     <li>If <code>nodeName</code> attribute of <var>n</var> is  
     <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>  
     and <span class=ed>its declared type is different from (default|preserve),  
     (default), or (preserve)</span>, then raise an  
     <a href="#xml-misc-error" id=xme-at-xml-space><code>xml-misc-error</code></a>.</li>  
     <li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the  
     <code>childNodes</code> list of <var>n</var>,  
       <ol>  
       <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a  
       <code>Text</code> or <code>EntityReference</code> node, then it is an  
       <a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li>  
       <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an  
       <code>EntityReference</code> node, then it is an  
       <a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li>  
       <li>Otherwise,  
       <a href="#algorithm-to-check-a-node" title="check a node">check  
       <var>n<sub><var>c</var></sub></var></a> recusrively.</li>  
       </ol></li>  
     <li class=ed>If <code>NOTATION_ATTR</code>, enumerated values MUST  
     be declared.  If not, then raise an  
     <a href="#xml-validity-error" id=vc-notatn-declared><code>xml-validity-error</code></a>.</li>  
     <li class=ed>If <code>NOTATION_ATTR</code> or <code>ENUMERATED_ATTR</code>,  
     values MUST all be distinct.  If not, then raise an  
     <a href="#xml-validity-error" id=vc-no-duplicate-tokens><code>xml-validity-error</code></a>.</li>  
     <li class=ed>If <code>NOTATION_ATTR</code> on an <code>EMPTY</code>  
     element, then raise an  
     <a href="#xml-validity-error" id=vc-no-notation-empty><code>xml-validity-error</code></a>.</li>  
     <li class=ed>@@ #defattrvalid Validity constraint: Attribute Default Value Syntactically Correct</li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>CDATASection</code> node</dt>  
   <dd>  
     <ol>  
     <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the  
     <code>data</code> attribute value as an <abbr>XML</abbr> character  
     data</a>.</li>  
     <li>If the <code>data</code> attribute value contains  
     a string <code>]]></code>, then raise an  
     <a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.<!-- "for compatibility" --></li>  
     <li>If the <code>childNodes</code> list of <var>n</var> contains  
     any nodes, they are in  
     <a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>Comment</code> node</dt>  
   <dd>  
     <ol>  
     <li>Raise an  
     <a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li>  
     <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the  
     <code>data</code> attribute value as an <abbr>XML</abbr> character  
     data</a>.</li>  
     <li>If the <code>data</code> attribute value contains  
     a string <code>--</code>, or if it ends with a character  
     <code>-</code>, then raise an  
     <a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.<!--  
     "for compatibility" --></li>  
     <li>If the <code>childNodes</code> list of <var>n</var> contains  
     any nodes, they are in  
     <a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>Document</code> node</dt>  
   <dd>  
     <ol>  
     <li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var>  
     is different from <code>1.0</code> or <code>1.1</code>,  
     then it is an <code class=ed>unknown-error?</code>.</li>  
     <li>If the <code>xmlEncoding</code> attribute value does <em>not</em>  
     match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code>  
     <span class=ed>@@ formal def</span>, then it is an  
     <a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li>  
     <li>The <code>childNodes</code> list of <var>n</var> have to  
     consist of zero or more <code>Comment</code> and/or  
     <code>ProcessingInstruction</code> nodes, followed by  
     an optional <code>DocumentType</code> node, followed  
     by zero or more <code>Comment</code> and/or  
     <code>ProcessingInstruction</code> nodes, followed by  
     an <code>Element</code> node, followed  
     by zero or more <code>Comment</code> and/or  
     <code>ProcessingInstruction</code> nodes.  Any violation to this is an  
     <a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li>  
     <li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn>  
     in the <code>childNodes</code> list of <var>n</var>,  
       <ol>  
       <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an  
       <code>EntityReference</code> node, then  
       <a href="#algorithm-to-check-a-node" title="check a node">check  
       <var>n<sub><var>c</var></sub></var></a> recursively.</li>  
       </ol></li>  
     <li class=ed>@@ <code>allDeclarationsProcessed</code></li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt>  
   <dd>  
     <ol>  
     <li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn>  
     in the <code>childNodes</code> list of <var>n</var>,  
       <ol>  
       <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an  
       <code>Element</code>, <code>Text</code>, <code>CDATASection</code>,  
       <code>Comment</code>, <code>ProcessingInstruction</code>, or  
       <code>EntityReference</code> node, then it is an  
       <a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li>  
       <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an  
       <code>EntityReference</code> node, then it is an  
       <a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li>  
       <li>Otherwise,  
       <a href="#algorithm-to-check-a-node" title="check a node">check  
       <var>n<sub><var>c</var></sub></var></a> recursively.</li>  
       </ol></li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>DocumentType</code> node</dt>  
   <dd>  
     <ol>  
     <li><a href="#algorithm-to-validate-an-ncname">Validate the  
     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>  
     <li>Follow the following substeps:  
       <ol>  
       <li>If <code>ownerDocument</code> attribute of <var>n</var> is  
       <code>null</code>, then abort these substeps.</li>  
       <li>If <code>documentElement</code> attribute of the node  
       set to <code>ownerDocument</code> attribute of <var>n</var> is  
       <code>null</code>, then abort these substeps.</li>  
       <li>If <code>nodeName</code> attribute of the node set to  
       <code>documentElement</code> attribute of the node set to  
       <code>ownerDocument</code> attribute of <var>n</var> is  
       different from <code>nodeName</code> of <var>n</var>,  
       then raise an  
       <a href="#xml-validity-error" id=vc-roottype><code>xml-validity-error</code></a>.</li></li>  
       </ol>  
     </li>  
     <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate  
     the <code>publicId</code> attribute value as a public identifier</a>.</li>  
     <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate  
     the <code>systemId</code> attribute value as a system identifier</a>.</li>  
     <li>If the <code>publicId</code> attribute value of <var>n</var> is  
     <em>not</em> <code>null</code> and the <code>systemId</code> attribute  
     value of <var>n</var> is <code>null</code>, then raise an  
     <a href="#xml-well-formedness-error" id=wfe-dt-sid><code>xml-well-formedness-error</code></a>.  
     <span class=ed>@@ publicId == null?  Or, publicId == ""</span></li>  
     <li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn>  
     in the <code>childNodes</code> list of <var>n</var>,  
       <ol>  
       <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a  
       <code>ProcessingInstruction</code> node, then it is an  
       <a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>.  
       <span class=ed>@@ ref to manakai's extensions</span></li>  
       <li>Otherwise, <!-- if n_c is not an EntityReference node, -->  
       <a href="#algorithm-to-check-a-node" title="check a node">check  
       <var>n<sub><var>c</var></sub></var></a> recusrively.</li>  
       </ol></li>  
     <li>For each node in the <code>entities</code>, <code>notations</code>,  
     and <code>elementTypes</code> lists of <var>n</var>,  
     <a href="#algorithm-to-check-a-node" title="check a node">check the  
     node</a> recursively.</li>  
     <li class=ed>@@ externally declared?</li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is an <code>Element</code> node</dt>  
   <dd>  
     <ol>  
     <li><a href="#algorithm-to-validate-an-ncname">Validate the  
     <code>localName</code> attribute value as an <code>NCName</code></a>.</li>  
     <li>If the <code>prefix</code> attribute value is different from  
     <code>null</code>, then <a href="#algorithm-to-validate-an-ncname">validate  
     the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>  
     <li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn>  
     in the <code>childNodes</code> list of <var>n</var>,  
       <ol>  
       <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an  
       <code>Element</code>,  
       <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,  
       <code>ProcessingInstruction</code>, or  
       <code>EntityReference</code> node, then it is an  
       <a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li>  
       <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an  
       <code>EntityReference</code> node, then it is an  
       <a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li>  
       <li>Otherwise,  
       <a href="#algorithm-to-check-a-node" title="check a node">check  
       <var>n<sub><var>c</var></sub></var></a> recursively.</li>  
       </ol></li>  
     <li class=ed>@@ #elementvalid Validity constraint: Element Valid</li>  
     <li>Let <var>attrs</var> be the value of the <code>attribute</code>  
     attribute of <var>n</var>.  Check conformance of <var>attrs</var>  
     as following:  
       <ol>  
       <li>If <var>attrs</var> contains an <code>Attr</code> node whose  
       <code>nodeName</code> attribute value is equal to that of another  
       <code>Attr</code> node in <var>attrs</var>, then raise an  
       <a href="#xml-well-formedness-error" id=wfe-uniqattspec><code>xml-well-formedness-error</code></a>.<!--  
       #uniqattspec Well-formedness constraint: Unique Att Spec --></li>  
       <li class=ed>@@ #RequiredAttr Validity constraint: Required Attribute</li>  
       </ol>  
     </li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt>  
406    <dd>    <dd>
407      <ol>      <p>This method creates a <code>DocumentType</code> node with the specified
408      <li class=ed></li>      name, belonging to the document.</p>
409      <li>If the <code>childNodes</code> list of <var>n</var> contains      <p>The <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn>
410      any nodes, they are in      parameter is the name of the document type.</p>
411      <a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li>  
412      <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>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
413      <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>      return a <code>DocumentType</code> node with the following attributes:</p>
414      <li class=ed>@@ #vc-MixedChildrenUnique      <dl>
415      Validity constraint: No Duplicate Types</li>      <dt><code>attributes</code>, <code>parentNode</code></dt>
416      <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>        <dd><code>null</code>.</dd>
417      <li>If there is more than one <code>AttributeDefinition</code> node      <dt><code>elementTypes</code>, <code>generalEntities</code>, and
418      with <span class=ed>attribute type <code>ID</code></span> in the      <code>notations</code></dt>
419      <code>NamedNodeMap</code> list contained in the        <dd>Empty <code>NamedNodeMap</code> objects.</dd>
420      <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an      <dt><code>entities</code></dt>
421      <a href="#xml-validity-error" id=vc-one-id-per-el><code>xml-validity-error</code></a>.</li>        <dd>The same value as the <code>generalEntities</code> attribute.</dd>
422      <li>If there is more than one <code>AttributeDefinition</code> node      <dt><code>childNodes</code></dt>
423      with <span class=ed>attribute type <code>NOTATION</code></span> in the        <dd>An empty <code>NodeList</code> object.</dd>
424      <code>NamedNodeMap</code> list contained in the      <dt><code>internalSubset</code>, <code>publicId</code>, and
425      <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an      <code>systemId</code></dt>
426      <a href="#xml-validity-error" id=vc-one-notation-per><code>xml-validity-error</code></a>.</li>        <dd>Empty strings.</dd>
427      <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>      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
428      </ol>        <dd><code>false</code>.</dd>
429        <dt><code>nodeName</code></dt>
430          <dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd>
431        <dt><code>ownerDocument</code></dt>
432          <dd>The <code>Document</code> over which the method is invoked.</dd>
433        </dl>
434        <p>In addition, the method <em class=rfc2119>MUST</em> be marked as
435        containing five general entity declarations: <code>amp</code>,
436        <code>lt</code>, <code>gt</code>, <code>quot</code>, and
437        <code>apos</code>.</p>
438    </dd>    </dd>
439  <dt>If <var>n</var> is an <code>Entity</code> node whose  <dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>,
440  <code>notationName</code> attribute value is <code>null</code> (i.e. a  method</dt>
 parsed entity)</dt>  
441    <dd>    <dd>
442      <ol>      <p>This method creates a <code>ElementTypeDefinition</code> node with the
443      <li>Raise an      specified name, belonging to the document.</p>
444      <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a>.</li>      <p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn>
445      <li><a href="#algorithm-to-validate-an-ncname">Validate the      parameter is the name of the element type defined by the element
446      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      type definition.</p>
447      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate  
448      the <code>publicId</code> attribute value as a public identifier</a>.</li>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
449      <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate      return an
450      the <code>systemId</code> attribute value as a system identifier</a>.</li>      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
451      <li>If the <code>publicId</code> attribute value of <var>n</var> is      node with the following attributes:</p>
452      <em>not</em> <code>null</code> and the <code>systemId</code> attribute      <dl>
453      value of <var>n</var> is <code>null</code>, then raise an      <dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt>
454      <a href="#xml-well-formedness-error" id=wfe-entity-sid><code>xml-well-formedness-error</code></a>.</li>        <dd>An empty <code>NamedNodeMap</code> object.</dd>
455      <li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn>      <dt><code>attributes</code>, <code>parentNode</code></dt>
456      in the <code>childNodes</code> list of <var>n</var>,        <dd><code>null</code>.</dd>
457        <ol>      <dt><code>childNodes</code></dt>
458        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an        <dd>An empty <code>NodeList</code> object.</dd>
459        <code>Element</code>,      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
460        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,        <dd><code>false</code>.</dd>
461        <code>ProcessingInstruction</code>, or <code>EntityReference</code>      <dt><code>nodeName</code></dt>
462        node, then it is an        <dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd>
463        <a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li>      <dt><code>ownerDocument</code></dt>
464        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an        <dd>The <code>Document</code> node over which the method is invoked.</dd>
465        <code>EntityReference</code> node, then it is an      <dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt>
466        <a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li>        <dd><code>null</code>.</dd>
467        <li>Otherwise,      <dt class=ed>@@ Ensure all attributes are defined</dt>
468        <a href="#algorithm-to-check-a-node" title="check a node">check      </dl>
       <var>n<sub><var>c</var></sub></var></a> recursively.</li>  
       </ol></li>  
     </ol>  
469    </dd>    </dd>
470  <dt>If <var>n</var> is an <code>Entity</code> node whose  <dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>,
471  <code>notationName</code> attribute value is <em>not</em> <code>null</code>  method</dt>
 (i.e. an unparsed entity)</dt>  
472    <dd>    <dd>
473      <ol>      <p>This method creates a <code>AttributeDefinition</code> node with the
474      <li><a href="#algorithm-to-validate-an-ncname">Validate the      specified name, belonging to the document.</p>
475      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn>
476      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate      parameter is the name of the attribute defined by the attribute
477      the <code>publicId</code> attribute value as a public identifier</a>.</li>      definition.</p>
478      <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate  
479      the <code>systemId</code> attribute value as a system identifier</a>.</li>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
480      <li>If the <code>systemId</code> attribute value of <var>n</var> is      return an
481      <code>null</code>, then raise an      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
482      <a href="#xml-well-formedness-error" id=wfe-uentity-sid><code>xml-well-formedness-error</code></a>.</li>      node with the following attributes:</p>
483      <li><a href="#algorithm-to-validate-an-ncname">Validate the      <dl>
484      <code>notationName</code> attribute value of <var>n</var> as an      <dt><code>allowedTokens</code></dt>
485      <code>NCName</code></a>.</li>        <dd>An empty <code>DOMStringList</code> object.</dd>
486      <li class=ed>@@ #not-declared Validity constraint: Notation Declared</li>      <dt><code>attributes</code>,
487      <li>If the <code>childNodes</code> list of <var>n</var> contains      <a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>,
488      any nodes, they are in      and <code>parentNode</code></dt>
489      <a href="#xml-well-formedness-error" id=wfe-uentity-child><code>xml-well-formedness-error</code></a>.</li>        <dd><code>null</code>.</dd>
490      </ol>      <dt><code>childNodes</code></dt>
491    </dd>        <dd>An empty <code>NodeList</code> object.</dd>
492  <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>      <dt><code>declaredType</code></dt>
493    <dd>        <dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd>
494      <ol>      <dt><code>defaultType</code></dt>
495      <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>        <dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd>
496      <li><a href="#algorithm-to-validate-an-ncname">Validate the      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
497      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>        <dd><code>false</code>.</dd>
498      <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>      <dt><code>nodeName</code></dt>
499      in the <code>childNodes</code> list of <var>n</var>,        <dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd>
500        <ol>      <dt><code>ownerDocument</code></dt>
501        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an        <dd>The <code>Document</code> node over which the method is invoked.</dd>
502        <code>Element</code>,      <dt class=ed>@@ Ensure all attributes are defined</dt>
503        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,      </dl>
504        <code>ProcessingInstruction</code>, or <code>EntityReference</code>  
505        node, then it is an      <div class=ed>
506        <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>      <p>@@ Should we keep these statements?:
507        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an  However, if the &lt;cfg::cfg|xml-id> configuration
508        <code>EntityReference</code> node, then it is an  parameter is set to <code>true</code> and the <var>name</var>
509        <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>  is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]]
510        <li>Otherwise,  attribute is set to <code>ID_ATTR</code>.
511        <a href="#algorithm-to-check-a-node" title="check a node">check  [CODE(DOMa)@en[[[defaultType]]]]?</p>
512        <var>n<sub><var>c</var></sub></var></a> recursively.</li>      </div>
       </ol></li>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is a <code>Notation</code> node</dt>  
   <dd>  
     <ol>  
     <li><a href="#algorithm-to-validate-an-ncname">Validate the  
     <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>  
     <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate  
     the <code>publicId</code> attribute value as a public identifier</a>.</li>  
     <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate  
     the <code>systemId</code> attribute value as a system identifier</a>.</li>  
     <li>If the <code>childNodes</code> list of <var>n</var> contains  
     any nodes, they are in  
     <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>  
     </ol>  
513    </dd>    </dd>
514  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>  <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,
515    method</dt>
516    <dd>    <dd>
517      <ol>      <p>This method creates a <a href="#Entity"><code>Entity</code></a> node
518      <li>If the <code>target</code> attribute value matches to the string      with the specified name, which represents a general entity, belonging to
519      <code>xml</code> in any case combination, then raise a      the document.</p>
520      <a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li>      <p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn>
521      <li>Otherwise, <a href="#algorithm-to-validate-an-ncname">validate the      parameter is the name of the general entity.</p>
522      <code>target</code> attribute value as an <code>NCName</code></a>.</li>  
523      <li>Then,      <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
524      <a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">validate      an <a href="#Entity"><code>Entity</code></a> node with the following
525      the <code>data</code> attribute value as an <abbr>XML</abbr> character      attributes:</p>
526      data</a>.</li>      <dl>
527      <li>If the <code>data</code> attribute value contains a string      <dt><code>attributes</code>, <code>notationName</code>,
528      <code>?></code>, then raise a      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
529      <a href="#xml-well-formedness-error" id=wfe-pi-pic><code>xml-well-formedness-error</code></a>.</li>      and <code>parentNode</code></dt>
530      <li>If the <code>data</code> attribute value starts with either        <dd><code>null</code>.</dd>
531      <code class=char>U+0009</code> <code class=charname>CHARACTER      <dt><code>childNodes</code></dt>
532      TABULATION</code>, <code class=char>U+000A</code> <code class=charname>LINE        <dd>An empty <code>NodeList</code> object.</dd>
533      FEED</code>, <code class=char>U+000D</code> <code class=charname>CARRIAGE      <dt><code>manakaiDeclarationBaseURI</code>,
534      RETURN</code>, or <code class=char>U+0020</code>      <code>manakaiEntityBaseURI</code>, and
535      <code class=charname>SPACE</code> character, then raise a      <code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt>
536      <a href="#round-trip-error" id=rte-pi-s><code>round-trip-error</code></a>.</li>        <dd>No explicit value is set.</dd>
537      <li>If the <code>childNodes</code> list of <var>n</var> contains      <dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and
538      any nodes, then raise an      <code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
539      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>        <dd><code>false</code>.</dd>
540      </ol>      <dt><code>nodeName</code></dt>
541          <dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd>
542          <dd>
543            <div class="note memo">
544              <p>It is not an error for
545              <a href="#createGeneralEntity-name"><var>name</var></a> matching
546              to the name of one of predefined general parsed entities in
547              <abbr>XML</abbr> or <abbr>HTML</abbr>.  For example,
548              <a href="#createGeneralEntity-name"><var>name</var></a> might be
549              <code>amp</code>, resulting in an
550              <a href="#Entity"><code>Entity</code></a> node
551              with its <code>nodeName</code> attribute set to <code>amp</code>.</p>
552            </div>
553          </dd>
554        <dt><code>ownerDocument</code></dt>
555          <dd>The <code>Document</code> node over which the method is invoked.</dd>
556        <dt><code>publicId</code>, and <code>systemId</code></dt>
557          <dd><code>null</code>.</dd>
558          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
559        <dt class=ed>@@ Ensure all attributes are defined</dd>
560        </dl>
561    </dd>    </dd>
562  <dt>If <var>n</var> is a <code>Text</code> node</dt>  <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,
563    method</dt>
564    <dd>    <dd>
565      <ol>      <p>This method creates a <code>Notation</code> node with the
566      <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the      specified name, belonging to the document.</p>
567      <code>data</code> attribute value as an <abbr>XML</abbr> character      <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>
568      data</a>.</li>      parameter is the name of the notation.</p>
569      <li>If the <code>childNodes</code> list of <var>n</var> contains  
570      any nodes, they are in      <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
571      <a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li>      a <code>Notation</code> node with the following attributes:</p>
572      </ol>      <dl>
573        <dt><code>attributes</code>,
574        <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
575        and <code>parentNode</code></dt>
576          <dd><code>null</code>.</dd>
577        <dt><code>childNodes</code></dt>
578          <dd>An empty <code>NodeList</code> object.</dd>
579        <dt><code>manakaiDeclarationBaseURI</code></dt>
580          <dd>No explicit value is set.</dd>
581        <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
582          <dd><code>false</code>.</dd>
583        <dt><code>nodeName</code></dt>
584          <dd><a href="#createNotation-name"><var>name</var></a>.</dd>
585        <dt><code>ownerDocument</code></dt>
586          <dd>The <code>Document</code> node over which the method is invoked.</dd>
587        <dt><code>publicId</code> and <code>systemId</code></dt>
588          <dd><code>null</code>.</dd>
589          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
590        <dt class=ed>@@ Ensure all attributes are defined</dt>
591        </dl>
592    </dd>    </dd>
 <dt>Otherwise</dt>  
   <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>  
593  </dl>  </dl>
594    
595    <p>These methods <em class=rfc2119>MUST</em> raise an
596    <code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span>
597    if <var>name</var> is <em>not</em> a legal <code>Name</code> according to
598    the <abbr>XML</abbr> version in use, as specified in the
599    <code>xmlVersion</code> attribute of the <code>Document</code> node.</p>
600    
601    <div class="note memo">
602    <p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now,
603    since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not
604    define it for <code>Document</code> methods.</p>
605    
606    <p><var>name</var> does not have to be a namespace qualified name.</p>
607  </div>  </div>
608    
609  </div>  </div>
610    
 <div id=classes class=section>  
 <h2>Character Classes</h2>  
611    
612  <p>This section defines a couple of character classes.  <div class=section id=section-documenttype>
613  These classes are referred to by algorithms specified above.</p>  <h3>Modifications to the <code id=DocumentType>DocumentType</code>
614    Interface</h3>
615    
616    <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
617    <em class=rfc2119>MAY</em> contain zero or more
618    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
619    nodes in the <code>NodeList</code> object contained in the
620    <code>childNodes</code> attribute of the
621    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
622    
623    <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
624    during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
625    document, the <code>NodeList</code> object in the <code>childNodes</code>
626    object <em class=rfc2119>MUST</em> contains the
627    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
628    nodes representing the processing instructions in the document type
629    definition of the document processed <span class=ed>@@ ref</span> by
630    the <abbr>XML</abbr> processor.  If the
631    <a href="#DocumentType"><code>DocumentType</code></a> node is marked
632    as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em>
633    also be marked as read$B!>(Bonly.</p>
634    
635    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
636    from a document type declaration information item <span class=ed>@@ ref</span>,
637    the <code>NodeList</code> object in the <code>childNodes</code> attribute
638    of the node <em class=rfc2119>MUST</em> contain the
639    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
640    created from the processing instruction information items in the list in the
641    [children] property of the document type declaration item in the same
642    order.</p>
643    
644    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
645    a document type declaration information item, the list in the [children]
646    property <em class=rfc2119>MUST</em> contain the processng instruction
647    information items created from the
648    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
649    in the <code>NodeList</code> object in the <code>childNodes</code> attribute
650    of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
651    
652    <p>The implementation of the
653    <a href="#DocumentType"><code>DocumentType</code></a> interface
654    <em class=rfc2119>MUST</em> be modified as following:</p>
655    <pre class=idl><code>// Modifications to the DocumentType interface
656      attribute DOMString <a href="#publicId">publicId</a>;
657      attribute DOMString <a href="#systemId">systemId</a>;
658    
659      attribute DOMString <a href="#internalSubset">internalSubset</a>;
660    </code></pre>
661    
662    <p>The <code id=publicId>publicId</code> attribute and the
663    <code id=systemId>systemId</code> attribute of
664    <a href="#DocumentType"><code>DocumentType</code></a>,
665    <a href="#Entity"><code>Entity</code></a>, and
666    <a href="#Notation"><code>Notation</code></a> interfaces are no longer
667    read$B!>(Bonly.</p>
668    
669    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
670    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
671    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
672    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
673    associated to the attribute.  No normalization, relative reference resolution,
674    or lexical validation is performed. <span class=ed>@@ If the new
675    value is <code>null</code>, ...</span></p>
676    
 <p>Character class <dfn id=class-Char10><code>Char10</code></dfn>  
 contains the following characters:</p>  
 <ul>  
 <li><code class=char>U+0009</code> <code class=charname>CHARACTER  
 TABULATION</code></li>  
 <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>  
 <li><code class=char>U+000D</code> <code class=charname>CARRIAGE  
 RETURN</code></li>  
 <li><code class=char>U+0020</code> <code class=charname>SPACE</code>  
 .. <code class=char>U+D7FF</code></li>  
 <li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code>  
 <code class=charname>REPLACEMENT CHARACTER</code></li>  
 <li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li>  
 </ul>  
 <div class="note memo">  
 <p>This character class contains all characters allowed in the production rule  
 <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>  
 of <abbr>XML</abbr> 1.0  
 <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  
 </div>  
   
 <p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn>  
 contains the following characters:</p>  
 <ul>  
 <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>  
 </ul>  
   
 <p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn>  
 contains the following characters:</p>  
 <ul>  
 <li><code class=char>U+007F</code> <code class=charname>DELETE</code> ..  
 <code class=char>U+0084</code> <code class=charname>INDEX</code></li>  
 <li><code class=char>U+0086</code> <code class=charname>START OF SELECTED  
 AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION  
 PROGRAM COMMAND</code></li>  
 <li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li>  
 <li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li>  
 <li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li>  
 <li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li>  
 <li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li>  
 <li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li>  
 <li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li>  
 <li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li>  
 <li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li>  
 <li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li>  
 <li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li>  
 <li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li>  
 <li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li>  
 <li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li>  
 <li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li>  
 <li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li>  
 <li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li>  
 </ul>  
677  <div class="note memo">  <div class="note memo">
678  <p>This character class contains the characters listed in the Note in  <p>Setting an invalid identifier might make the node unserializable.
679  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>  Setting a public identifier while leaveing system identifier unspecified
680  of <abbr>XML</abbr> 1.0  would also make the <a href="#DocumentType"><code>DocumentType</code></a>
681  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,  or <a href="#Entity"><code>Entity</code></a> node unserializable.</p>
 as amended by  
 <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>  
682  </div>  </div>
683    
684  <p>The character class <dfn id=class-NameStartChar10><code>NameStartChar10</code></dfn>  <div class=ed>
685  contains the following characters:</p>  <p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p>
686  <ul class=ed>  </div>
687  </ul>  
688  <div class="note memo">  <p>The <code id=internalSubset>internalSubset</code> attribute of the
689  <p>This character class contains all characters allowed as the first character  <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
690  of a string matching to the production rule  read$B!>(Bonly.</p>
691  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Name"><code>Name</code></a>  
692  of <abbr>XML</abbr> 1.0  <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
693  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
694    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
695    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
696    associated to the attribute.  No normalization, or lexical validation is
697    performed. <span class=ed>@@ If the new value is <code>null</code>,
698    ...</span></p>
699    
700  </div>  </div>
701    
702  <p>The character class <dfn id=class-NameChar10><code>NameChar10</code></dfn>  <div class=section id=section-documenttypedefinition>
703  contains the following characters:</p>  <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
704  <ul>  
 <li>The characters in the character class  
 <a href="#class-NameStartChar10">NameStartChar10</a>.</li>  
 <li class=ed></li>  
 </ul>  
705  <div class="note memo">  <div class="note memo">
706  <p>This character class contains all characters allowed as the second  <p>This interface is a separated interface from the
707  character of a string matching to the production rule  <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
708  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Name"><code>Name</code></a>  to the <a href="#DocumentType"><code>DocumentType</code></a>,
709  of <abbr>XML</abbr> 1.0  for the historical reason.</p>
710  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  </div>
711  </div>  
712    <p>The
713  <p>The character class <dfn id=class-PubidChar><code>PubidChar</code></dfn>  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
714  contains the following characters:</p>  interface <em class=rfc2119>MUST</em> be implemented as following:</p>
715  <ul>  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
716  <li><code class=char>U+0009</code> <code class=charname>CHARACTER    readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
717  TABULATION</code></li>    readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
718  <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>    readonly attribute NamedNodeMap <a href="#notations">notations</a>;
719  <li><code class=char>U+000D</code> <code class=charname>CARRIAGE  
720  RETURN</code></li>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
721  <li><code class=char>U+0020</code> <code class=charname>SPACE</code></li>      (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
722  <li><code class=char>U+0021</code> <code class=charname>EXCLAMATION MARK</code>    <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
723  (<code class=char>!</code>)</li>      (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
724  <li><code class=char>U+0023</code> <code class=charname>DOLLAR SIGN</code>    <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
725  (<code class=char>$</code>)</li>      (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
726  <li><code class=char>U+0024</code> <code class=charname>NUMBER SIGN</code>  
727  (<code class=char>#</code>)</li>    void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
728  <li><code class=char>U+0025</code> <code class=charname>PERCENT SIGN</code>      (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
729  (<code class=char>%</code>)</li>      raises (DOMException);
730  <li><code class=char>U+0027</code> <code class=charname>APOSTROPHE</code>    void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
731  (<code class=char>'</code>)</li>      (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
732  <li><code class=char>U+0028</code> <code class=charname>LEFT PARENTHESIS</code>      raises (DOMException);
733  (<code class=char>(</code>)</li>    void <a href="#setNotationNode">setNotationNode</a>
734  <li><code class=char>U+0029</code> <code class=charname>RIGHT      (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
735  PARENTHESIS</code> (<code class=char>)</code>)</li>      raises (DOMException);
736  <li><code class=char>U+002A</code> <code class=charname>ASTERISK</code>  }</code></pre>
737  (<code class=char>*</code>)</li>  
738  <li><code class=char>U+002B</code> <code class=charname>PLUS SIGN</code>  <pre class=ed>
739  (<code class=char>+</code>)</li>  [1] In an implementation that supports the
740  <li><code class=char>U+002C</code> <code class=charname>COMMA</code>  [CODE(URI)@en[[[http://suika.fam.cx/www/2006/feature/XDoctype]]]]
741  (<code class=char>,</code>)</li>  feature, a [CODE(DOMi)@en[[[DocumentType]]]] node
742  <li><code class=char>U+002D</code> <code class=charname>HYPHEN-MINUS</code>  must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]
743  (<code class=char>-</code>)</li>  interface.  See [[DOM XML Document Type Definition]>>3] for
744  <li><code class=char>U+002E</code> <code class=charname>FULL STOP</code>  details.
745  (<code class=char>.</code>)</li>  </pre>
746  <li><code class=char>U+002F</code> <code class=charname>SOLIDUS</code>  
747  (<code class=char>/</code>)</li>  <dl>
748  <li><code class=char>U+0030</code> <code class=charname>DIGIT ZERO</code>  <dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of
749  (<code class=char>0</code>) .. <code class=char>U+0039</code>  type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
750  <code class=charname>DIGIT NINE</code> (<code class=char>9</code>)</li>    <dd><p>A live <code>NamedNodeMap</code> object that contains all the element
751  <li><code class=char>U+003A</code> <code class=charname>COLON</code>    type definitions belonging to the <code>DocumentType</code> node.</p>
752  (<code class=char>:</code>)</li>  
753  <li><code class=char>U+003B</code> <code class=charname>SEMICOLON</code>    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
754  (<code class=char>;</code>)</li>    <code>NamedNodeMap</code> object that contains all the
755  <li><code class=char>U+003D</code> <code class=charname>EQUAL SIGN</code>    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
756  (<code class=char>=</code>)</li>    nodes belonging to the <code>DocumentType</code> node.  The
757  <li><code class=char>U+003F</code> <code class=charname>QUESTION MARK</code>    <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly
758  (<code class=char>?</code>)</li>    if and only if the node is read$B!>(Bonly.  The <code>NamedNodeMap</code>
759  <li><code class=char>U+0040</code> <code class=charname>COMMERCIAL AT</code>    object <em class=rfc2119>MUST</em> be live and the same object
760  (<code class=char>@</code>)</li>    <em class=rfc2119>MUST</em> be returned for any invocation.</p>
761  <li><code class=char>U+0041</code> <code class=charname>LATIN CAPITAL LETTER  
762  A</code> (<code class=char>A</code>) .. <code class=char>U+005A</code>    <p>If the <code>DocumentType</code> node is created during the process
763  <code class=charname>LATIN CAPITAL LETTER Z</code>    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following
764  (<code class=char>Z</code>)</li>    requirements are applied:  The <code>NamedNodeMap</code> object in the
765  <li><code class=char>U+005F</code> <code class=charname>LOW LINE</code>    <a href="#elementTypes"><code>elementType</code></a> attribute
766  (<code class=char>_</code>)</li>    <em class=rfc2119>MUST</em> be so transformed that the object contains
767  <li><code class=char>U+0061</code> <code class=charname>LATIN CAPITAL LETTER    the <code>ElementTypeDefinition</code> nodes for the element types
768  A</code> (<code class=char>A</code>) .. <code class=char>U+007A</code>    whose name is presented as the <code>Name</code> of the element type or
769  <code class=charname>LATIN CAPITAL LETTER Z</code>    attribute definition list declarations processed by the <abbr>XML</abbr>
770  (<code class=char>Z</code>)</li>    processor.  If there are more than one element type declarations for an
771  </ul>    element type, then the declarations other than the first one
772      <em class=rfc2119>MUST</em> be ignored for the purpose of constructing the
773      <code>NamedNodeMap</code> object.</p></dd>
774    <dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn>
775    of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
776      <dd><p>A live <code>NamedNodeMap</code> object that contains all the general
777      entities belonging to the <code>DocumentType</code> node.</p>
778      
779      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
780      same value as the <code>entities</code> attribute (defined in the
781      <code>DocumentType</code> interface) of the same node.</p>
782    
783      <div class="note memo">
784        <p>This attribute is part of the interface for historical reason.</p>
785      </div></dd>
786    <!--
787    All entities declared in the document type definition
788    contained in or referenced from the document entity
789    might not be exposed through this collection, depending
790    on the information provided by the XML processor for
791    the DOM implementation.  In particular, it might not
792    contain any entity if entity references are expanded
793    at the parse time.  An implementation [['''MUST NOT''']]
794    expose an [CODE(DOMi)@en[[[Entity]]]] node whose [CODE(DOMa)@en[[[nodeName]]]]
795    is equal to the name of one of five predefined general entities in
796    XML through the collection as the result of parsing of an XML
797    document that has no error.  Duplicate entity declarations are also discarded.
798    
799    The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
800    object that contains all the [CODE(DOMi)@en[[[Entity]]]] nodes
801    representing general entities belong to the node.  The returned
802    [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
803    the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
804    and therefore any change of read-only flag on the node is immediately
805    reflected by that of the object.
806    -->
807    <dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type
808    <code>notations</code>, read$B!>(Bonly</code>
809      <dd><p>A live <code>NamedNodeMap</code> object that contains all the
810      notations belonging to the <code>DocumentType</code> node.</p>
811      
812      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
813      same value as the <code>notations</code> attribute (defined in the
814      <code>DocumentType</code> interface) of the same node.</p>
815    
816      <div class="note memo">
817        <p>This attribute is part of the interface for historical reason.</p>
818        <p>Implementations are not required to implement the
819        <code>notations</code> attribute twice (for <code>DocumentType</code>
820        and <code>DocumentTypeDefinition</code> interfaces); they share exactly
821        same definition.</p>
822      </div></dd>
823    <!--
824    If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is
825    created from an XML document, duplicate notation declarations, if any, in DTD
826    [['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]]
827    object and only the first declaration [['''MUST''']] be
828    made available as a [CODE(DOMi)@en[[[Notation]]]] node.
829    
830    ;; This definition is based on one for the
831    [CODE(DOMa)@en[[[notations]]]] attribute of the
832    [CODE(DOMi)@en[[[DocumentType]]]] interface in DOM XML module.
833    Since duplication is violation to the Validity Constraint,
834    XML parsers might vary on how notations are notified to
835    the application.  In particular, [CODE(InfoProp)@en[[[notations]]]]
836    property of the document information item in XML Information Set
837    is so defined that in case ''any'' notation is declared for
838    multiple times then the property has no value.
839    
840    The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
841    object that contains all the [CODE(DOMi)@en[[[Notation]]]] nodes
842    representing notations belong to the node.  The returned
843    [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
844    the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
845    and therefore any change of read-only flag on the node is immediately
846    reflected by that of the object.
847    -->
848    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
849    method</dt>
850      <dd><p>Returns the
851      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
852      with the specified name.</p>
853    
854      <p>The
855      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
856      parameter is the name of the element type.</p>
857    
858      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
859      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
860      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
861      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
862      <code>NamedNodeMap</code> object in the
863      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
864      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
865      <code>null</code>.</p></dd>
866    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
867    method</dt>
868      <dd><p>Returns the
869      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
870      with the specified name.</p>
871    
872      <p>The
873      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
874      parameter is the name of the element type.</p>
875    
876      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
877      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
878      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
879      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
880      <code>NamedNodeMap</code> object in the
881      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
882      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
883      <code>null</code>.</p></dd>
884    <dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>,
885    method</dt>
886      <dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node
887      with the specified name.</p>
888    
889      <p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn>
890      parameter is the name of the general entity.</p>
891    
892      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
893      <a href="#Entity"><code>Entity</code></a> node,
894      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
895      <a href="#getEntityNode-name"><var>name</var></a>, in the
896      <code>NamedNodeMap</code> object in the
897      <a href="#entities"><code>entities</code></a> attribute of the
898      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
899      <code>null</code>.</p></dd>
900    <dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>,
901    method</dt>
902      <dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node
903      with the specified name.</p>
904    
905      <p>The
906      <dfn id=getNotationNode-name class=dom-param><var>name</var></dfn>
907      parameter is the name of the notation.</p>
908    
909      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
910      <a href="#Notation"><code>Notation</code></a> node,
911      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
912      <a href="#getNotationNode-name"><var>name</var></a>, in the
913      <code>NamedNodeMap</code> object in the
914      <a href="#notations"><code>notations</code></a> attribute of the
915      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
916      <code>null</code>.</p></dd>
917    <dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>,
918    method</dt>
919      <dd class=ed>@@</dd>
920    <dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>,
921    method</dt>
922      <dd class=ed>@@</dd>
923    <dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>,
924    method</dt>
925      <dd class=ed>@@</dd>
926    </dl>
927    
928    <div class=ed>
929    <p>A future version of this interface might define the
930    <code>parameterEntities</code> and getter/setter for parameter entities.
931    </div>
932    
933    </div>
934    
935    <div class=section id=section-elementtypedefinition>
936    <h3>The <code>ElementTypeDefinition</code> Interface</h3>
937    
938    <p>The nodes of type
939    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
940    represents an element type definition.  Such a node
941    <em class=rfc2119>MUST</em> implement the
942    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
943    interface, which extends the <a href="#Node"><code>Node</code></a>
944    interface.</p>
945    
946    <p>An element type definition represents a definition of the element type.
947    It is corresponding to the element type declaration in <abbr>DTD</abbr>.
948    However, an
949    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
950    does not represent the element type definition in <abbr>DTD</abbr> itself.  
951    Even if there are more than one element type declarations for an element type
952    in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
953    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
954    node for that element type.  In addition, if there are attribute definition
955    declarations for an element type, even when there is no element type
956    declaration for that element type, the <abbr>DOM</abbr> will contain an
957    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
958    node for that element type.</p>
959    
960    <p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
961    node cannot be a child of any node.  An
962    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
963    cannot have any child node.</p>
964    
965    <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
966    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
967    <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
968      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
969    
970      readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>;
971      <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a>
972        (in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>);
973      void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a>
974        (in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>)
975        raises (DOMException);
976    }</code></pre>
977    
978    <dl>
979    <dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn>
980    of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt>
981      <dd><p>The
982      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
983      attribute of
984      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
985      <a href="#Entity"><code>Entity</code></a>, and
986      <a href="#Notation"><code>Notation</code></a> interface contains the
987      <a href="#DocumentType"><code>DocumentType</code></a> node to which the node
988      is attached.</p>
989    
990      <p>On getting, the attribute <em class=rfc2119>MUST</em> return a
991      <a href="#DocumentType"><code>DocumentType</code></a> node.  It
992      <em class=rfc2119>MUST</em> be such a node that whose
993      <a href="#elementTypes"><code>elementTypes</code></a> (for an
994      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
995      node), <a href="#entities"><code>entities</code></a> (for an
996      <a href="#Entity"><code>Entity</code></a> node), or
997      <a href="#notations"><code>notations</code></a> (for a
998      <a href="#Notation"><code>Notation</code></a> node) attribute contains the
999      <code>NamedNodeMap</code> object that contains the node.  If there is no such
1000      a <a href="#DocumentType"><code>DocumentType</code></a> node,
1001      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd>
1002    <dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn>
1003    of type NamedNodeMap, read$B!>(Bonly</dt>
1004      <dd><p>A live <code>NamedNodeMap</code> object that contains all the
1005      attribute definitions belonging to the
1006      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1007      node.</p>
1008    
1009      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1010      <code>NamedNodeMap</code> object that contains all the
1011      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1012      belonging to the
1013      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1014      The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1015      read$B!>(Bonly if and only if the node is read$B!>(Bonly.  The
1016      <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be live and
1017      the same object <em class=rfc2119>MUST</em> be returned for any
1018      invocation.</p>
1019      
1020      <p>If the
1021      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1022      is created during the process to create a <abbr>DOM</abbr> from an
1023      <abbr>XML</abbr> document, the following requirements are applied:  The
1024      <code>NamedNodeMap</code> object in the
1025      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1026      attribute <em class=rfc2119>MUST</em> be so transformed that the object
1027      contains the
1028      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1029      corresponding to the attribute definitions in the attribute definition
1030      list declarations processed by the <abbr>XML</abbr> processor and
1031      associated to the element type represented by the node.  If there are more
1032      than one attribute definitions for an attribute, then the definitions other
1033      than the first one <em class=rfc2119>MUST</em> be ignored for the purpose
1034      of constructing the <code>NamedNodeMap</code> object.</p></dd>
1035    <dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>,
1036    method</dt>
1037      <dd><p>Return the
1038      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1039      with the specified name.</p>
1040    
1041      <p>The
1042      <dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn>
1043      parameter is the name of the attribute.</p>
1044    
1045      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1046      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
1047      whose <a href="#nodeName"><code>nodeName</code></a> attribute value is
1048      equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>,
1049      in the <code>NamedNodeMap</code> in the
1050      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1051      attribute of the node.  If there is no such node, it
1052      <em class=rfc2119>MUST</em> return <code>null</code>.</p></dd>
1053    <dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>,
1054    method</dt>
1055      <dd class=ed>@@</dd>
1056    </dl>
1057    
1058    <div class=ed>
1059    <p>A future version of the specification might define a set of attributes
1060    and methods for representing and accessing to the content model of the
1061    element type.</p>
1062    </div>
1063    </div>
1064    
1065    <div class=section id=section-attributedefinition>
1066    <h3>The <code>AttributeDefinition</code> Interface</h3>
1067    
1068    <p>The nodes of type
1069    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
1070    represents an attribute definition.  Such a node
1071    <em class=rfc2119>MUST</em> implement the
1072    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
1073    which extends the <a href="#Node"><code>Node</code></a> interface.</p>
1074    
1075    <p>An attribute definition represents a definition of the attribute
1076    associated to an element type.  It is corresponding to the attribute definition
1077    in the attribute list declaration in <abbr>DTD</abbr>.  However, an
1078    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
1079    not represent the attribute definition in <abbr>DTD</abbr> itself.  Even if
1080    there are more than one attribute definitions for an attribute of an element
1081    type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1082    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
1083    that attribute.</p>
1084    
1085    <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1086    node cannot be a child of any node.  An
1087    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1088    can have zero or more child nodes of same kinds as those allowed for
1089    <code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p>
1090    
1091    <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1092    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
1093    <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
1094      <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
1095      const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
1096      const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1;
1097      const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2;
1098      const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3;
1099      const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4;
1100      const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5;
1101      const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6;
1102      const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7;
1103      const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8;
1104      const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
1105      const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
1106      const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
1107    
1108      <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
1109      const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
1110      const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
1111      const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
1112      const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
1113      const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
1114      
1115      readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
1116    
1117      readonly attribute unsigned short <a href="#declaredType">declaredType</a>;
1118      readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>;
1119      readonly attribute unsigned short <a href="#defaultType">defaultType</a>;
1120    }</code></pre>
1121    
1122    <dl>
1123    <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
1124    of type
1125    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1126    read$B!>(Bonly</dt>
1127      <dd><p>The
1128      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
1129      which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1130      node belongs.</p>
1131    
1132      <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
1133      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1134      It <em class=rfc2119>MUST</em> be such a node that whose
1135      <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
1136      attribute contains the <code>NamedNodeMap</code> object that contains
1137      the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1138      node.  If there is no such an
1139      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1140      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
1141    <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
1142    <code>unsigned short</code></dt>
1143      <dd><p>The declared type <span class=ed>@@ ref</span> of the attribute.
1144      It is expected that this attribute contains a value from the definition group
1145      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
1146    
1147      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1148      value associated to this attribute.</p>
1149    
1150      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1151      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1152      exception if the
1153      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1154      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
1155      <em class=rfc2119>MUST</em> set the specified value as the value
1156      associated to this attribute.</p>
1157    
1158      <p>If the <code>AttributeDefinition</code> node is created during the process
1159      to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
1160      appropriate value from the
1161      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
1162      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1163    
1164      <!-- DeclaredValueType -->
1165    <p>The definition group
1166    <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
1167    integers indicating the declared type of attributes.  The definition
1168    group contains the following constants:</p>
1169    
1170    <table>
1171    <thead>
1172    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1173    </thead>
1174    <tbody>
1175    <tr>
1176    <th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code>
1177    <td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr>
1178    <tr>
1179    <th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code>
1180    <td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr>
1181    <tr>
1182    <th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code>
1183    <td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr>
1184    <tr>
1185    <th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code>
1186    <td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr>
1187    <tr>
1188    <th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code>
1189    <td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr>
1190    <tr>
1191    <th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code>
1192    <td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr>
1193    <tr>
1194    <th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code>
1195    <td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr>
1196    <tr>
1197    <th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code>
1198    <td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr>
1199    <tr>
1200    <th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code>
1201    <td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr>
1202    <tr>
1203    <th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code>
1204    <td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr>
1205    <tr>
1206    <th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code>
1207    <td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr>
1208    <tr>
1209    <th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code>
1210    <td><code>11</code><td>Unknown, because no declaration for the attribute
1211    has been read but the [all declaration processed] property
1212    <span class=ed>[INFOSET]</span> would be false.</tr>
1213    </tbody>
1214    </table>
1215    
1216    <p>If no attribute type information is available, or if the source
1217    of the information does not distinguish <q>no value</q> and <q>unknown</q>
1218    <span class=ed>[INFOSET]</span>, then the value
1219    <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>
1220    <em class=rfc2119>MUST</em> be used.</p>
1221    
1222  <div class="note memo">  <div class="note memo">
1223  <p>This character class contains all characters allowed in the production rule  <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1224  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-PubidChar"><code>PubidChar</code></a>  created by the
1225  of <abbr>XML</abbr> 1.0  <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1226  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  method has its <a href="#declaredType"><code>declaredType</code></a> attribute
1227    set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p>
1228    </div>
1229    
1230    <p>If the source of the information does not distinguish <q>no value</q>
1231    and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and
1232    <code>CDATA</code> <span class=ed>[XML]</span>, then the value
1233    <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
1234    be used.</p>
1235    
1236    <p>In Perl binding <span class=ed>[PERLBINDING]</span>, the
1237    <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1238    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1239    definition group.</p>
1240    
1241      </dd>
1242    <dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of
1243    type <code>DOMStringList</code>, read$B!>(Bonly</dt>
1244      <dd><p>The list of allowed attribute values.</p>
1245    
1246      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1247      <code>DOMStringList</code> object associated to this attribute.  The object
1248      <em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of
1249      zero or more characters respectively, possibly with duplications.  The
1250      object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node
1251      is read$B!>(Bonly.</p>
1252    
1253      <p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1254      node is created during the process to create a <abbr>DOM</abbr> from an
1255      <abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain
1256      the names or name tokens allowed for the attribute defined by the node.
1257      If the document is well$B!>(Bformed, the object will be empty unless
1258      the <a href="#declaredType"><code>declaredType</code></a> is
1259      <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1260      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p>
1261    
1262      <p>If the <a href="#declaredType"><code>declaredType</code></a> is different
1263      from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1264      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute
1265      <em class=rfc2119>MUST</em> be ignored for the purpose of serializing
1266      into (part of) <abbr>XML</abbr> document.</p>
1267    
1268      <div class="note memo">
1269        <p>When serializing the node it should be noted that the object might
1270        be empty, might contain duplications, and might contain strings that are
1271        not names or name tokens.</p>
1272      </div></dd>
1273    <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1274    type <code>unsigned short</code></dt>
1275      <dd><p>The type of the default for the attribute.  It is expected that this
1276      attribute contains a value from the definition group
1277      <a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p>
1278    
1279      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1280      the value associated to this attribute.</p>
1281    
1282      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1283      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1284      exception if the
1285      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1286      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
1287      <em class=rfc2119>MUST</em> set the specified value as the value
1288      associated to this attribute.</p>
1289    
1290      <p>If the
1291      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1292      created during the process to create a <abbr>DOM</abbr> from an
1293      <abbr>XML</abbr> document, an appropriate value from the
1294      <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1295      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1296    
1297      <!-- DefaultValueType -->
1298      <p>The definition group
1299      <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1300      contains integers indicating the type of the default for the attribute.
1301      The definition group contains the following constans:</p>
1302    
1303      <table>
1304      <thead>
1305      <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1306      </thead>
1307      <tbody>
1308      <tr>
1309      <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1310      <td><code>0</code><td>Unknown.</tr>
1311      <tr>
1312      <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1313      <td><code>1</code><td>Provided explicitly and fixed
1314      <span class=ed>@@ ref</span> to that value.</tr>
1315      <tr>
1316      <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1317      <td><code>2</code><td>No default value and the attribute have to be
1318      explicitly specified.</tr>
1319      <tr>
1320      <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1321      <td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr>
1322      <tr>
1323      <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1324      <td><code>4</code><td>Provided explicitly.</tr>
1325      </tbody>
1326      </table>
1327    
1328      <p>If the source of the default type does not distinguish
1329      implied and unknown default types, then the value
1330      <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1331      <em class=rfc2119>MUST</em> be used.</p>
1332    
1333      <div class="note memo">
1334      <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1335      node created by the
1336      <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1337      method has its <a href="#defaultType"><code>defaultType</code></a>
1338      attribute set to
1339      <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1340      </div></dd>
1341    </dl>
1342    
1343    </div>
1344    
1345    <div class=section id=section-entity>
1346    <h3>Modifications to the <code id=Entity>Entity</code> Interface</h3>
1347    
1348    <p>The implementation of the <a href="#Entity"><code>Entity</code></a>
1349    interface <em class=rfc2119>MUST</em> be modified as following:</p>
1350    <pre class=idl><code>// Modifications to the Entity interface
1351      attribute DOMString <a href="#publicId">publicId</a>;
1352      attribute DOMString <a href="#systemId">systemId</a>;
1353      attribute DOMString <a href="#notationName">notationName</a>;
1354    
1355      // Additions to the Entity interface
1356      attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>;
1357      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1358    
1359      attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>;
1360    </code></pre>
1361    
1362    <p>The <code id=notationName>notationName</code> attribute of the
1363    <a href="#Entity"><code>Entity</code></a> interface is no longer
1364    read$B!>(Bonly.</p>
1365    
1366    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1367    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1368    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.
1369    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
1370    associated to the attribute.  No lexical validation is performed.  The new
1371    value <em class=rfc2119>MAY</em> be <code>null</code>.</p>
1372    
1373    <dl>
1374    <dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn>
1375    of type boolean</dt>
1376      <dd><p>Whether the structure of the replacement text of the entity
1377      is available via the <code>NodeList</code> object in the
1378      <code>childNodes</code> attribute of the entity.</p>
1379    
1380      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1381      the value associated to this attribute.</p>
1382    
1383      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1384      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1385      exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
1386      Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the
1387      value associated to this attribute.</p>
1388    
1389      <div class="note memo">
1390      <p>The attribute can be set to <code>false</code> even if the
1391      <a href="#Entity"><code>Entity</code></a> node has any child node.
1392      If the attribute is set to <code>false</code>, then any child node of
1393      the <a href="#Entity"><code>Entity</code></a> node ought to be ignored,
1394      say, for the purpose of serialization.</p>
1395      </div>
1396    
1397      <p>When an <code>EntityReference</code> node is created by cloning
1398      the replacement subtree of the <a href="#Entity"><code>Entity</code></a>
1399      node, if the attribute is set to <code>false</code>, then any descendant
1400      of the node <em class=rfc2119>MUST</em> be ignored.</p>
1401    
1402      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1403      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1404      the following requirements are applied:  If the entity is an unparsed
1405      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1406      <code>false</code>.  Otherwise, if the entity is an external entity whose
1407      replacement text is not available, or whose replacement text is not converted
1408      to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set
1409      to <code>false</code>.  Otherwise, the attribute
1410      <em class=rfc2119>MUST</em> be set to <code>true</code>.</p>
1411    
1412      <div class="note memo">
1413      <p>An <a href="#Entity"><code>Entity</code></a> node created by the
1414      <a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method
1415      has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a>
1416      attribute set to <code>false</code>.</p>
1417      </div></dd>
1418    <dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn>
1419    of type boolean</dt>
1420      <dd><p>Whether the entity is declared by an external entity declaration or
1421      not.  If the value is <code>true</code>, the entity is declared in an entity
1422      declaration in the external subset entity or in an external parameter entity.
1423      If the value is <code>false</code>, the entity is declared in an entity
1424      declaration in the internal subset, or the node is created in memory.</p>
1425    
1426      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1427      the value associated to this attribute.</p>
1428    
1429      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1430      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1431      exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
1432      Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the
1433      value associated to this attribute.</p>
1434    
1435      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1436      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1437      the following requirements are applied:  If the entity is an unparsed
1438      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1439      <code>false</code>.  Otherwise, i.e. the entity is a parsed entity, then the
1440      attribute <em class=rfc2119>MUST</em> be set to the value of whether the
1441      entity is declared by an external markup declaration or not.</p></dd>
1442    </dl>
1443    </div>
1444    
1445    <div class=section id=section-notation>
1446    <h3>Modifications to the <code id=Notation>Notation</code> Interface</h3>
1447    
1448    <p>The implementation of the <a href="#Notation"><code>Notation</code></a>
1449    interface <em class=rfc2119>MUST</em> be modified as following:</p>
1450    <pre class=idl><code>// Modifications to the Notation interface
1451      attribute DOMString <a href="#publicId">publicId</a>;
1452      attribute DOMString <a href="#systemId">systemId</a>;
1453    
1454      // Addition to the Notation interface
1455      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1456    </code></pre>
1457  </div>  </div>
1458    
1459  </div>  </div>

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24