/[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.25 by wakaba, Sat Dec 8 13:41:36 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 60  available at <code class="URI">&lt;<a Line 50  available at <code class="URI">&lt;<a
50  <div id="abstract" class="section">  <div id="abstract" class="section">
51  <h2>Abstract</h2>  <h2>Abstract</h2>
52    
53  <div class="ed issue">...</div>  <p>The <abbr>DOM</abbr> Document Type Definition module is a set of
54    <abbr>DOM</abbr> interfaces, including both new interfaces and modifications
55    to existing <abbr>DOM</abbr> interfaces, over which <abbr>DOM</abbr>
56    applications are able to access to the definitions of the document type.</p>
57  </div>  </div>
58    
59  <div id="status" class="section">  <div id="status" class="section">
# Line 72  at the time of its publication.  Other d Line 64  at the time of its publication.  Other d
64  might supersede this document.</em></p>  might supersede this document.</em></p>
65    
66  <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  
67  <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>
68  project.  It might be updated, replaced, or obsoleted by  project.  It might be updated, replaced, or obsoleted by
69  other documents at any time.  It is inappropriate to  other documents at any time.  It is inappropriate to
# Line 92  normative version.</p> Line 82  normative version.</p>
82    
83  <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>
84    
85  <div class="issue ed">...</div>  <p>The <dfn id=term-dom-dtdef><abbr>DOM</abbr> Document Type Definition</dfn>
86    module is a set of <abbr>DOM</abbr> interfaces, including both new
87    interfaces and modifications to existing <abbr>DOM</abbr> interfaces,
88    over which <abbr>DOM</abbr> applications are able to access to the
89    definitions of the document type.</p>
90    
91    <p>Interfaces defined in this document are partially modeled and inspired by
92    early drafts of <abbr>DOM</abbr> Level 1
93    <cite class="bibref informative">[<a href="#ref-DOM1WD">DOM1WD</a>]</cite>,
94    <abbr>DOM</abbr> Level 3 Abstract Schemas <abbr>W3C</abbr> Note
95    <cite class="bibref informative">[<a href="#ref-DOM3AS">DOM3AS</a>]</cite>,
96    and <abbr>XML</abbr> Schema <abbr>API</abbr> specification
97    <cite class="bibref informative">[<a href="#ref-XSAPI">XSAPI</a>]</cite>, but
98    they are not compatible with any of them as a whole.</p>
99    </div>
100    
101    <div class="section" id=conformance>
102    <h2>Conformance Requirements</h2>
103    
104  </div>  <div class=section id=terminology>
105    <h3>Terminology</h3>
106    
107  <div class="section" id="terminology">  <p>All examples and notes in this specification are non$B!>(Bnormative,
108  <h2>Terminology</h2>  as are all sections explicitly marked non$B!>(Bnormative.  Everything
109    else in this specification is normative.</p>
110    
111  <p>The key words <q><em class="rfc2119">MUST</em></q>,  <p>The key words <q><em class="rfc2119">MUST</em></q>,
112  <q><em class="rfc2119">MUST NOT</em></q>,  <q><em class="rfc2119">MUST NOT</em></q>, and <q><em class=rfc2119>MAY</em></q>
113  <q><em class="rfc2119">SHOULD</em></q>,  in this document are to be interpreted as described in
 <q><em class="rfc2119">SHOULD NOT</em></q>, and  
 <q><em class=rfc2119>MAY</em></q> in this  
 document are to be interpreted as described in  
114  <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>  <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>
115  2119</a>  2119</a>
116  <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>  <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>
117    
118  <!-- Strictly speaking the paragraph below is not part of terminology. -->  <p>Conformance requirements phrased as algorithms or specific steps
119  <p>All examples and notes in this specification are non$B!>(Bnormative,  <em class=rfc2119>MAY</em> be implemented in any manner, so long as the end
120  as are all sections explicitly marked non$B!>(Bnormative.  Everything  result is equivalent.  Requirements phrased in the imperative as part of
121  else in this specification is normative.</p>  algorithms are to be interpreted with the meaning of the key word used in
122    introducing the algorithm.</p>
123  <p><span class=ed>Algorithm is normative but non-normative</span>.  
124  In addition, the order in which <a href="#errors">errors</a> are  <p>Sometimes an exception is phrased as being required to be raised.  As
125  raised is undefined.</p>  specified in the <abbr>DOM</abbr> Core specification
126    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>,
127    when the value of the <code>strictErrorChecking</code> attribute of the
128    <a href="#Document"><code>Document</code></a> node is <code>false</code>,
129    then the exception is not have to be raised.</p>
130    
131    <p>Some conformance requirements are phrased as requirements on interfaces,
132    attributes, methods, or objects.  Such requirements are applied to
133    implementations.</p>
134    
135    <p>The construction <q>a <code><var>Foo</var></code> object</q>, where
136    <code><var>Foo</var></code> is an interface, is used instead of the more
137    accurate <q>an object implementing the interface
138    <code><var>Foo</var></code></q>.</p>
139    
140    <p>The construction <q>raise a <code><var>Bar</var></code></q>, where
141    <code><var>Bar</var></code> is an exception code, is used instead of the more
142    accurate <q>raise an exception implementing the interface
143    <code>DOMException</code>
144    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
145    with its <code>code</code> attribute set to
146    <code><var>Bar</var></code></q>.</p>
147    
148    <p>The terms
149    <em id=live><a href="http://www.whatwg.org/specs/web-apps/current-work/#live">live</a></em>
150    and <em id=setting>setting</em> and <em id=getting>getting</em> of an attribute
151    is defined in the HTML5 specification
152    <cite class="bibref normative">[<a href="#ref-HTML5">HTML5</a>]</cite>.</p>
153    
154    <p>The term
155    <em id=read-only><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/glossary.html#dt-readonly-node">read$B!>(Bonly (node)</a></em>
156    is defined in the <abbr>DOM</abbr> Level 3 Core specification
157    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
158    
159    <p>The <em id=idl-fragment><abbr>IDL</abbr> fragments</em> in this document are
160    to be interpreted as described in the <cite>Language Bindings for
161    <abbr>DOM</abbr> Specifications</cite> specification
162    <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.</p>
163    
164    <p>Some <abbr>IDL</abbr> fragments are presented as <i>patch</i> to an
165    <abbr>IDL</abbr> fragment defined in another document.  They are to be
166    interpreted as an instance of
167    <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMembers"><code>InterfaceMembers</code></a>
168    <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.
169    If the <abbr>IDL</abbr> fragment to which the <i>patch</i> is applied has any
170    instance of
171    <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
172    with same
173    <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#prod-identifier"><code>identifier</code></a>
174    part as that of any instance of
175    <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
176    in the <i>patch</i>, then the former instance of
177    <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
178    <em class=rfc2119>MUST</em> be ignored.</p>
179  </div>  </div>
180    
181    <div class=section id=conformance-categories>
182    <h3>Conformance Categories</h3>
183    
184  <div class=section id=error-categories>  <p>There are several kinds of products that can be claim to conform to
185  <h2>Error Classification</h2>  this specification:</p>
186    <dl>
187    <dt id=category-dom-implementation><abbr>DOM</abbr> Implementation</dt>
188      <dd>A <abbr>DOM</abbr> implementation (or just written as
189      <q>implementation</q> in this document) provides a way to access
190      <abbr>DOM</abbr> trees for applications by implementing interfaces defined
191      by this and other documents.  Unless otherwise noted, requirements in this
192      document are applied to <abbr>DOM</abbr> implementations.  To implement
193      all the features in this document, the implementation have to implement
194      some version of <abbr>DOM</abbr> Core (e.g. <abbr>DOM</abbr> Level 3 Core
195      <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>)
196      with one or more language binding (e.g. ECMAScript and Java bindings
197      <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>
198      or Perl binding
199      <cite class="bibref normative">[<a href="#ref-DOMPERL">DOMPERL</a>]</cite>).
200      A conforming implementation <em class=rfc2119>MUST</em> also be a
201      <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#dfn-conforming-implementation">conforming
202      implementation</a> of the <abbr>IDL</abbr> fragments in this document, as
203      described in the <cite>Language Bindings for <abbr>DOM</abbr>
204      Specifications</cite> specification
205      <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.</dd>
206    <dt id=category-xml-parser><abbr>XML</abbr> Parser (<abbr>XML</abbr> document
207    to <abbr>DOM</abbr> tree converter)</dt>
208      <dd>A software component that converts
209      <abbr>XML</abbr> 1.0 or 1.1 document
210      <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
211      <a href="#ref-XML11">XML11</a>]</cite> (or fragment thereof) into a
212      <abbr>DOM</abbr> tree (or fragment thereof) in the context of this
213      document.  Note that this document does not define any particular way to
214      parse an <abbr>XML</abbr> document or to construct an <abbr>DOM</abbr>
215      document, but it defines constraints for such processing.</dd>
216    <dt id=category-xml-serializer><abbr>XML</abbr> Serializer (<abbr>DOM</abbr>
217    tree to <abbr>XML</abbr> document converter)</dt>
218      <dd>A software component that converts
219      <abbr>DOM</abbr> tree (or fragment thereof) into an <abbr>XML</abbr> 1.0 or
220      1.1 document (or fragment thereof).  Note that this document does not define
221      any particular way to serialize a <abbr>DOM</abbr> tree, but it defines
222      constraints for such processing.</dd>
223    <dt id=category-infoset-dom><abbr>XML</abbr> Information Set to
224    <abbr>DOM</abbr> Tree Converter</dt>
225      <dd>A software component that converts an <abbr>XML</abbr> information set
226      <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>
227      into a <abbr>DOM</abbr> tree.  Note that this documetn does not define
228      any particular way for the convertion, but it defines constraints for
229      such processing.</dd>
230    <dt id=category-dom-infoset><abbr>DOM</abbr> Tree to <abbr>XML</abbr>
231    Information Set Converter</dt>
232      <dd>A software component that converts a <abbr>DOM</abbr> tree into
233      an <abbr>XML</abbr> information set.  Note that this documetn does not define
234      any particular way for the convertion, but it defines constraints for
235      such processing.</dd>
236    </dl>
237    </div>
238    </div>
239    
240  <p class=ed>If a <code>Document</code> node has no  <div class=section id=dom-dtdef>
241  xml-well-formedness-error, entity-error, and unknown-error,  <h2><abbr>DOM</abbr> Document Type Definition Module</h2>
 then it is well-formed.  If a well-formed <code>Document</code>  
 node has no xml-validity-error, it is valid.</p>  
242    
243  <div class="note memo">  <p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0,
244  <p>A well$B!>(Bformed <code>Document</code> can be safely serialized  introduces four interfaces:
245  into a well$B!>(Bformed XML document.  A valid <code>Document</code>  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>,
246  can be easily serialized into a valid XML document.</p>  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>,
247    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
248    and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>.
249    In addition, it modifies existing interfaces
250    <a href="#Node"><code>Node</code></a>,
251    <a href="#Document"><code>Document</code></a>,
252    <a href="#DocumentType"><code>DocumentType</code></a>,
253    <a href="#Entity"><code>Entity</code></a>, and
254    <a href="#Notation"><code>Notation</code></a>
255    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
256    
257    <div class=section id=features>
258    <h3>Feature String</h3>
259    
260    <p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of
261    the <abbr>DOM</abbr> Document Type Definition module, the
262    <code>hasFeature</code> method of a <code>DOMImplementation</code> object
263    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
264    <em class=rfc2119>MUST</em> return <code>true</code> when the parameters are
265    set to
266    <dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn>
267    and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively.  Any
268    method that takes one or more feature names, with or without version number,
269    such as <code>hasFeature</code> or <code>getFeature</code>,
270    <em class=rfc2119>MUST</em> behave in a manner consistent with it.</p>
271  </div>  </div>
272    
273  <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>
274  ...</p>  <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
275    
276  <p>Errors are classified into these  <p>The implementation of the
277  <dfn id=error-category title="error category">error categories</dfn>:</p>  <a href="#Node"><code>Node</code></a> interface
278    <em class=rfc2119>MUST</em> be modified as the following
279    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
280    <pre class=idl><code>// Additions to the Node interface
281    
282    // Additions to the NodeType definition group
283    const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
284    const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
285    </pre>
286    
287    <p>This specification adds two new types (subinterfaces) of
288    <a href="#Node"><code>Node</code></a>: element type definition (node type
289    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
290    interface
291    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
292    attribute definition (node type
293    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
294    interface
295    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).  For
296    these kinds of nodes, methods and attributes in the
297    <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
298    
299  <dl id=errors>  <dl>
300  <dt><dfn id=entity-error><code>entity-error</code></dfn></dt>  <dt><code id=attributes>attributes</code>,
301    <code id=localName>localName</code>,
302    <code id=manakaiLocalName>manakaiLocalName</code>
303    <cite class="bibref normative">[<a href="#ref-MANAKAI">MANAKAI</a>]</cite>,
304    <code id=namespaceURI>namespaceURI</code>, and
305    <code id=prefix>prefix</code></dt>
306    <dd>    <dd>
307      <p class=ed>@@</p>      <p>On getting, the attributes <em class=rfc2119>MUST</em> return
308      <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>  
309    </dd>    </dd>
310  <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>  
311    <dd>    <dd>
312      <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
313      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
314      construct when it is serialized and then re-parsed by a conforming      of the node in the <code>ownerDocument</code> attribute of the node.
315      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>  
316    </dd>    </dd>
317  <dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt>  <dt><code id=cloneNode>cloneNode</code></dt>
318    <dd class=ed>@@</dd>    <dd class=ed>
319  <dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt>      <p>A future version of the specification is expected to define the
320    <dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0      behavior of the <a href="#cloneNode"><code>cloneNode</code></a> method
321    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>      for those kinds of nodes.  In addition, it might revise behavior of
322    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> /      the method for <a href="#Entity"><code>Entity</code></a>,
323    <abbr>XML</abbr> 1.1      <a href="#Notation"><code>Notation</code></a>, and/or
324    <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>      <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
325    <a href="@@/#dt-error">error</a>)    </dd>
326    that is not classified to any other <a href="#error-category">error    <!--
327    category</a>.</dd>    <dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd>
328  <dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt>    -->
329    <dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0  <dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt>
330    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>    <dd class=ed>
331    <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal      <p>A future version of the specification is expected to define the
332    error</a> / <abbr>XML</abbr> 1.1      behavior of the method
333    <cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite>      for those kinds of nodes.  In addition, it might revise behavior of
334    <a href="@@/#dt-fatal">fatal error</a>)      the method for <a href="#Entity"><code>Entity</code></a>,
335    that is not classified to any other <a href="#error-category">error      <a href="#Notation"><code>Notation</code></a>, and/or
336    category</a>. <span class=ed>@@ What errors fall into this category?</span></dd>      <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
337  <dt><dfn id=xml-misc-recommendation><code>xml-misc-recommendation</code></dfn></dt>    </dd>
338    <dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt>
339      <dd><p>When invoked, the method <em class=rfc2119>MUST</em> return
340      <code>false</code>.</p></dd>
341    <dt><code id=isEqualNode>isEqualNode</code></dt>
342      <dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method,
343      following items are added to the list of conditions for equality:</p>
344    
345      <ul>
346      <li>
347        <p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a>
348        and at least one of them has the support for the feature
349        <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p>
350        <ul>
351        <li>they are equal according to <abbr>DOM</abbr> Level 3 Core definition
352        <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>,
353        and
354        <li>either:
355          <ul><!--
356          <li>both of them does not support the feature
357          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>-->
358          <li>exactly one of them support the feature
359          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
360          and the <code>length</code> attribute of the <code>NamedNodeMap</code>
361          object in the <a href="#elementTypes"><code>elementTypes</code></a>
362          attribute of it is equal to <code>0</code>, or</li>
363          <li>both of them support the feature
364          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
365          and the values of the
366          <a href="#elementTypes"><code>elementTypes</code></a> attributes are
367          equal (equality of the
368          <a href="#elementTypes"><code>elementTypes</code></a> attribute is same
369          as that for the <code>attributes</code> attribute).</li>
370          </ul>
371        </li>
372        </ul>
373      </li>
374    
375      <li><p>If the nodes are
376      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
377      the values of the
378      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
379      attributes are equal (equality of the
380      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
381      attribute is same as that for the <code>attributes</code> attribute).</p></li>
382    
383      <li><p>If the nodes are
384      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
385      the values of the <a href="#declaredType"><code>declaredType</code></a> and
386      the <a href="#defaultType"><code>defaultType</code></a> attributes are
387      equal respectively.</p></li>
388    
389      <li><p>If the nodes are
390      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
391      the values of the <code>DOMStringList</code> objects in the
392      <a href="#allowedTokens"><code>allowedTokens</code></a> attributes
393      are equal, i.e. their <code>length</code> attribute values are equal and
394      each string exists in a list is contained in another list (their indeces
395      may be different), with an additional constraint that the number of the
396      items that are equal to a string in a list is equal to the number
397      of the items equal to the string in another list.</p></li>
398      </ul></dd>
399    <dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and
400    <code id=lookupPrefix>lookupPrefix</code></dt>
401      <dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return
402      <code>null</code>.</p></dd>
403    <dt><code id=nodeName>nodeName</code></dt>
404    <dd>    <dd>
405      <p>An      <p>If the node is an
406      <a href="#xml-misc-recommendation"><code>xml-misc-recommendation</code></a>      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
407      will be raised if a <em class=rfc2119>SHOULD</em>$B!>(Blevel requirement      On getting, the attribute <em class=rfc2119>MUST</em> return the
408      in <abbr>XML</abbr> specification is not met.</p>      name of the element type definition represented by the node.</p>
409    
410        <p>If the node is an
411        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
412        On getting, the attribute <em class=rfc2119>MUST</em> return the
413        name of the attribute definition represented by the node.</p>
414    </dd>    </dd>
415  <dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt>  <dt><code id=nodeType>nodeType</code></dt>
416    <dd>A violation of validity constraint in XML document.</dd>    <dd>
417  <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>--> returns
418    <dd><p>If an <code>xml-well-formedness-error</code> is raised,      <!-- NOTE: No MUST, to avoid circular reference (nodeType==8100[12]
419    it would not be possible to generate an XML serialization that      is defined that they MUST implement ElementType|AttributeDefinition). -->
420    would match to the appropriate production rule and that would not      <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
421    violate to any well$B!>(Bformedness constraint in XML      (if the node is an
422    specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
423    <a href="#ref-XML11">XML11</a>]</cite>.</p></dd>      <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
424        (if the node is an
425        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
426    
427        <!-- NodeType -->
428    <p>Two constants are added to the <code id=NodeType>NodeType</code>
429    definition group of the <a href="#Node"><code>Node</code></a> interface as
430    following:</p>
431    <table>
432    <thead>
433    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
434    </thead>
435    <tbody>
436    <tr>
437    <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
438    <td><code>81001</code><td>The node is an
439    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
440    <tr>
441    <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
442    <td><code>81002</code><td>The node is an
443    <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
444    </tbody>
445    </table>
446      </dd>
447    <dt><code id=nodeValue>nodeValue</code> and
448    <code id=textContent>textContent</code></dt>
449      <dd>
450        <p>If the node is an
451        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
452        On getting, the attributes <em class=rfc2119>MUST</em> return
453        <code>null</code>.</p>
454    
455      <div class="note memo">
456      <p>Thus, on setting the attributes does nothing
457      <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
458      </div>
459    
460      <p>If the node is an
461      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
462      The attribute <em class=rfc2119>MUST</em> behave as if the node
463      were <code>Attr</code>
464      <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p></dd>
465    <dt><code id=normalize>normalize</code></dt>
466      <dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is
467      normalized, any nodes in the <code>NamedNodeMap</code> object in the
468      <a href="#elementTypes"><code>elementTypes</code></a> attribute
469      <em class=rfc2119>MUST</em> be normalized as well.</p>
470    
471      <p>When an
472      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
473      is normalized, any nodes in the <code>NamedNodeMap</code> object in the
474      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
475      attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd>
476  </dl>  </dl>
477    
 <div class=ed><p>@@ TODO: #dt-atuseroption at user option  
 (MAY or MUST), #dt-compat for compatibility,  
 #dt-interop for interoperability</p></div>  
   
478  </div>  </div>
479    
480  <div class=section id=parsing-xml>  <div class=section id=section-document>
481  <h2>Parsing <abbr>XML</abbr> Document</h2>  <h3>Modifications to the <code id=Document>Document</code> Interface</h3>
   
 <ul>  
 <li>If the <abbr>XML</abbr> document does not begin with an  
 <abbr>XML</abbr> declaration, then raise an  
 <a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>.</li>  
 <li>If the replacement text of an entity declaration is  
 <code>&lt;</code>, then raise an  
 <a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!--  
 "strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11].  
 --></li>  
 <li>If there is an element type declaration whose <code>Name</code>  
 value is already declared, then raise an  
 <a href="#xml-validity-error" id=vc-edunique><code>xml-validity-error</code></a>.</li>  
 <li>If attribute definition whose <code>Name</code> is  
 <code>xml:space</code> has <span class=ed>declared type different from  
 (default|preserve), (default), or (preserve)</span>, then raise an  
 <a href="#xml-misc-error" id=xme-ad-xml-space><code>xml-misc-error</code></a>.  
 <span class=ed>@@ duplication with  
 <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."  
   
 @@ in parsing phase  
   
 "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."  
482    
483    <!--
484    <p>If an attempt is made to adopt an
485    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
486    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
487    the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em>
488    raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@
489    ref</span>.</p>
490  -->  -->
 </ul>  
 </div>  
   
 <div class="section" id=checking-dom>  
 <h2>Checking <abbr>DOM</abbr></h2>  
491    
492  <p>The following algorithms and definitions are applied to  <div class=ed>
493  <abbr>XML</abbr> documents; especially, they are not applied  <p>Future version of the specification is expected to define what should
494  to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p>  be done if <code>adoptNode</code> or <code>importNode</code> method have to
495    adopt or import an
496  <div class=section id=definitions>  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
497  <h3>Definitions</h3>  <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node.
498    In addition it might revise behavior of those methods for
499  <p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is  <a href="#Entity"><code>Entity</code></a>,
500  the <abbr>XML</abbr> version of the document to which the node belongs.  <a href="#Notation"><code>Notation</code></a>, and/or
501  For a <code>Documemt</code> node, the <abbr>XML</abbr> version  <a href="#DocumentType"><code>DocumentType</code></a> nodes.
502  of the document is the value of the <code>xmlVersion</code>  Behavior of <code>normalizeDocument</code> method for these kinds of
503  attribute of the node.  For a <code>DocumentType</code> node whose  nodes might also be defined in some day.</p>
504  <code>ownerDocument</code> attribute is set to <code>null</code>,  </div>
 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>  
505    
506  </div>  </div>
507    
508  <div class=section id=checking-node>  <div class=section id=section-documentxdoctype>
509  <h3>Checking <code>Node</code></h3>  <h3>The <code>DocumentXDoctype</code> Interface</h3>
510    
511  <p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to  <p>The <a href="#Document"><code>Document</code></a> nodes
512  check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as  <em class=rfc2119>MUST</em> also implement the
513  following:</p>  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface.</p>
514  <dl class=switch>  
515  <dt>If <var>n</var> is an <code>Attr</code> node</dt>  <p>An instance of the
516    <dd>  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>
517      <ol>  interface <em class=rfc2119>MUST</em> be able to be obtained by using
518      <li><a href="#algorithm-to-validate-an-ncname">Validate the  binding$B!>(Bspecific casting methods on an instance of the
519      <code>localName</code> attribute value as an <code>NCName</code></a>.</li>  <a href="#Document"><code>Document</code></a> interface (if such
520      <li>If the <code>prefix</code> attribute value is different from  casting methods are available) or by using the method <code>getFeature</code>
521      <code>null</code>, then <a href="#algorithm-to-validate-an-ncname">validate  with parameter values
522      the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li>  <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
523      <li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the  and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
524      <code>childNodes</code> list of <var>n</var>,  <a href="#Document"><code>Document</code></a> node supports the
525        <ol>  feature <code>Core</code> version <code>3.0</code>
526        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a  <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>).</p>
527        <code>Text</code> or <code>EntityReference</code> node, then it is an  
528        <a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li>  <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
529        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an  <em class=rfc2119>MUST</em> be implemented as the following
530        <code>EntityReference</code> node, then it is an  <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
531        <a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li>  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
532        <li>Otherwise,    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
533        <a href="#algorithm-to-check-a-node" title="check a node">check      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
534        <var>n<sub><var>c</var></sub></var></a> recusrively.</li>      raises (DOMException);
535        </ol></li>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
536      <li>If <code>nodeName</code> attribute of <var>n</var> is      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
537      <code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span>      raises (DOMException);
538      and <code>value</code> attribute of <var>n</var> is neither    <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
539      <code>default</code> nor <code>preserve</code>, then it is an      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
540      <a href="#xml-misc-error" id=xme-attr-xml-space><code>xml-misc-error</code></a>.<!--      raises (DOMException);
541      Note that <!ATTLIST e xml:space (default|preserve) "a">...    <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
542      <e xml:space="default"/> is conforming and valid. --></li>      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
543      <li class=ed>@@ xml:lang value is not a language tag [RFC 3066 or its      raises (DOMException);
544      successor] or an empty string, then xml-misc-warning    <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
545      (a "fact"-level error; not an XML error).</li>      (in DOMString <a href="#createNotation-name"><var>name</var></a>)
546      <li class=ed>@@ <code>specified</code>,      raises (DOMException);
547      <code>manakaiAttributeType</code> (#ValueType Validity constraint: Attribute Value Type)</li>  }</code></pre>
548      <!-- xml:space MUST be declared to be valid. -->  
549      <li>Let <dfn id=var-v><var>v</var></dfn> be the value of the  <dl>
550      attribute <code>value</code> of <var>n</var>.</li>  <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,
551      <li>Validate the <var>n</var> against the <span class=ed>declared  method</dt>
     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>  
   <dd>  
     <ol>  
     <li class=ed></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-et-child><code>xml-well-formedness-error</code></a>.</li>  
     <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>  
     <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>  
     <li class=ed>@@ #vc-MixedChildrenUnique  
     Validity constraint: No Duplicate Types</li>  
     <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>  
     <li>If there is more than one <code>AttributeDefinition</code> node  
     with <span class=ed>attribute type <code>ID</code></span> in the  
     <code>NamedNodeMap</code> list contained in the  
     <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an  
     <a href="#xml-validity-error" id=vc-one-id-per-el><code>xml-validity-error</code></a>.</li>  
     <li>If there is more than one <code>AttributeDefinition</code> node  
     with <span class=ed>attribute type <code>NOTATION</code></span> in the  
     <code>NamedNodeMap</code> list contained in the  
     <code>attributeDefinitions</code> attribute of <var>n</var>, then raise an  
     <a href="#xml-validity-error" id=vc-one-notation-per><code>xml-validity-error</code></a>.</li>  
     <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>  
     </ol>  
   </dd>  
 <dt>If <var>n</var> is an <code>Entity</code> node whose  
 <code>notationName</code> attribute value is <code>null</code> (i.e. a  
 parsed entity)</dt>  
   <dd>  
     <ol>  
     <li>Raise an  
     <a href="#entity-error" id=ee-entity-node><code>entity-error</code></a>.</li>  
     <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>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-entity-sid><code>xml-well-formedness-error</code></a>.</li>  
     <li>For each node <dfn id=var-entity-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-entity-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-er-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 an <code>Entity</code> node whose  
 <code>notationName</code> attribute value is <em>not</em> <code>null</code>  
 (i.e. an unparsed entity)</dt>  
552    <dd>    <dd>
553      <ol>      <p>This method creates a <code>DocumentType</code> node with the specified
554      <li><a href="#algorithm-to-validate-an-ncname">Validate the      name, belonging to the document.</p>
555      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      <p>The
556      <li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate      <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn>
557      the <code>publicId</code> attribute value as a public identifier</a>.</li>      parameter is the name of the document type.</p>
558      <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate  
559      the <code>systemId</code> attribute value as a system identifier</a>.</li>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
560      <li>If the <code>systemId</code> attribute value of <var>n</var> is      return a <a href="#DocumentType"><code>DocumentType</code></a> node with
561      <code>null</code>, then raise an      the following attributes:</p>
562      <a href="#xml-well-formedness-error" id=wfe-uentity-sid><code>xml-well-formedness-error</code></a>.</li>      <dl>
563      <li><a href="#algorithm-to-validate-an-ncname">Validate the      <dt><code>attributes</code>, <code>parentNode</code></dt>
564      <code>notationName</code> attribute value of <var>n</var> as an        <dd><code>null</code>.</dd>
565      <code>NCName</code></a>.</li>      <dt><a href="#elementTypes"><code>elementTypes</code></a>,
566      <li class=ed>@@ #not-declared Validity constraint: Notation Declared</li>      <a href="#entities"><code>entities</code></a>, and
567      <li>If the <code>childNodes</code> list of <var>n</var> contains      <a href="#notations"><code>notations</code></a></dt>
568      any nodes, they are in        <dd>Empty <code>NamedNodeMap</code> objects respectively.</dd>
569      <a href="#xml-well-formedness-error" id=wfe-uentity-child><code>xml-well-formedness-error</code></a>.</li>      <dt><code>childNodes</code></dt>
570      </ol>        <dd>An empty <code>NodeList</code> object.</dd>
571        <dt><a href="#internalSubset"><code>internalSubset</code></a>,
572        <a href="#publicId"><code>publicId</code></a>, and
573        <a href="#systemId"><code>systemId</code></a></dt>
574          <dd>Empty strings.</dd>
575        <dt><code>nodeName</code></dt>
576          <dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd>
577        <dt><code>ownerDocument</code></dt>
578          <dd>The <a href="#Document"><code>Document</code></a> node over which the
579          method is invoked.</dd>
580        </dl>
581        <p>The returned node <em class=rfc2119>MUST NOT</em> be marked as
582        <a href="#read-only">read$B!>(Bonly</a>.</p>
583        <p>In addition, the method <em class=rfc2119>MUST</em> be marked as
584        containing five general entity declarations: <code>amp</code>,
585        <code>lt</code>, <code>gt</code>, <code>quot</code>, and
586        <code>apos</code>.</p>
587    </dd>    </dd>
588  <dt>If <var>n</var> is an <code>EntityReference</code> node</dt>  <dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>,
589    method</dt>
590    <dd>    <dd>
591      <ol>      <p>This method creates a <code>ElementTypeDefinition</code> node with the
592      <li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li>      specified name, belonging to the document.</p>
593      <li><a href="#algorithm-to-validate-an-ncname">Validate the      <p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn>
594      <code>nodeName</code> attribute value as an <code>NCName</code></a>.</li>      parameter is the name of the element type defined by the element
595      <li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn>      type definition.</p>
596      in the <code>childNodes</code> list of <var>n</var>,  
597        <ol>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
598        <li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an      return an
599        <code>Element</code>,      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
600        <code>Text</code>, <code>CDATASection</code>, <code>Comment</code>,      node with the following attributes:</p>
601        <code>ProcessingInstruction</code>, or <code>EntityReference</code>      <dl>
602        node, then it is an      <dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt>
603        <a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li>        <dd>An empty <code>NamedNodeMap</code> object.</dd>
604        <li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an      <dt><code>childNodes</code></dt>
605        <code>EntityReference</code> node, then it is an        <dd>An empty <code>NodeList</code> object.</dd>
606        <a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li>      <dt><a href="#nodeName"><code>nodeName</code></a></dt>
607        <li>Otherwise,        <dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd>
608        <a href="#algorithm-to-check-a-node" title="check a node">check      <dt><code>ownerDocument</code></dt>
609        <var>n<sub><var>c</var></sub></var></a> recursively.</li>        <dd>The <code>Document</code> node over which the method is invoked.</dd>
610        </ol></li>      <dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
611      </ol>      and <code>parentNode</code></dt>
612          <dd><code>null</code>.</dd>
613        </dl>
614        <p>The returned node <em class=rfc2119>MUST NOT</em> be marked as
615        <a href="#read-only">read$B!>(Bonly</a>.</p>
616    </dd>    </dd>
617  <dt>If <var>n</var> is a <code>Notation</code> node</dt>  <dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>,
618    method</dt>
619    <dd>    <dd>
620      <ol>      <p>This method creates a <code>AttributeDefinition</code> node with the
621      <li><a href="#algorithm-to-validate-an-ncname">Validate the      specified name, belonging to the document.</p>
622      <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>
623      <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
624      the <code>publicId</code> attribute value as a public identifier</a>.</li>      definition.</p>
625      <li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate  
626      the <code>systemId</code> attribute value as a system identifier</a>.</li>      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
627      <li>If the <code>childNodes</code> list of <var>n</var> contains      return an
628      any nodes, they are in      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
629      <a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li>      node with the following attributes:</p>
630      </ol>      <dl>
631        <dt><a href="#allowedTokens"><code>allowedTokens</code></a></dt>
632          <dd>An empty <code>DOMStringList</code> object.</dd>
633        <dt><code>childNodes</code></dt>
634          <dd>An empty <code>NodeList</code> object.</dd>
635        <dt><a href="#declaredType"><code>declaredType</code></a></dt>
636          <dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd>
637        <dt><a href="#defaultType"><code>defaultType</code></a></dt>
638          <dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd>
639        <dt><a href="#nodeName"><code>nodeName</code></a></dt>
640          <dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd>
641        <dt><code>ownerDocument</code></dt>
642          <dd>The <code>Document</code> node over which the method is invoked.</dd>
643        <dt><a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>
644        and <code>parentNode</code></dt>
645          <dd><code>null</code>.</dd>
646        </dl>
647        <p>The returned node <em class=rfc2119>MUST NOT</em> be marked as
648        <a href="#read-only">read$B!>(Bonly</a>.</p>
649    
650        <!-- This requirement, if not droped, should be part of xml-id spec.
651        <div class=ed>
652        <p>@@ Should we keep these statements?:
653    However, if the &lt;cfg::cfg|xml-id> configuration
654    parameter is set to <code>true</code> and the <var>name</var>
655    is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]]
656    attribute is set to <code>ID_ATTR</code>.
657    [CODE(DOMa)@en[[[defaultType]]]]?</p>
658        </div>-->
659    </dd>    </dd>
660  <dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt>  <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,
661    method</dt>
662    <dd>    <dd>
663      <ol>      <p>This method creates a <a href="#Entity"><code>Entity</code></a> node
664      <li>If the <code>target</code> attribute value matches to the string      with the specified name, which represents a general entity, belonging to
665      <code>xml</code> in any case combination, then raise a      the document.</p>
666      <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>
667      <li>Otherwise, <a href="#algorithm-to-validate-an-ncname">validate the      parameter is the name of the general entity.</p>
668      <code>target</code> attribute value as an <code>NCName</code></a>.</li>  
669      <li>Then,      <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
670      <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
671      the <code>data</code> attribute value as an <abbr>XML</abbr> character      attributes:</p>
672      data</a>.</li>      <dl>
673      <li>If the <code>data</code> attribute value contains a string      <dt><code>childNodes</code></dt>
674      <code>?></code>, then raise a        <dd>An empty <code>NodeList</code> object.</dd>
675      <a href="#xml-well-formedness-error" id=wfe-pi-pic><code>xml-well-formedness-error</code></a>.</li>      <dt><code>manakaiDeclarationBaseURI</code>,
676      <li>If the <code>data</code> attribute value starts with either      <code>manakaiEntityBaseURI</code>, and <code>manakaiEntityURI</code>
677      <code class=char>U+0009</code> <code class=charname>CHARACTER      <cite class="bibref normative">[<a href="#ref-MANAKAI">MANAKAI</a>]</cite></dt>
678      TABULATION</code>, <code class=char>U+000A</code> <code class=charname>LINE        <dd>No explicit value is set.</dd>
679      FEED</code>, <code class=char>U+000D</code> <code class=charname>CARRIAGE      <dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a></dt>
680      RETURN</code>, or <code class=char>U+0020</code>        <dd><code>false</code>.</dd>
681      <code class=charname>SPACE</code> character, then raise a      <dt><code>nodeName</code></dt>
682      <a href="#round-trip-error" id=rte-pi-s><code>round-trip-error</code></a>.</li>        <dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd>
683      <li>If the <code>childNodes</code> list of <var>n</var> contains        <dd>
684      any nodes, then raise an          <div class="note memo">
685      <a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li>            <p>It is not an error for
686      </ol>            <a href="#createGeneralEntity-name"><var>name</var></a> matching
687    </dd>            to the name of one of predefined general parsed entities in
688  <dt>If <var>n</var> is a <code>Text</code> node</dt>            <abbr>XML</abbr> or <abbr>HTML</abbr>.  For example,
689              <a href="#createGeneralEntity-name"><var>name</var></a> might be
690              <code>amp</code>, resulting in an
691              <a href="#Entity"><code>Entity</code></a> node
692              with its <code>nodeName</code> attribute set to <code>amp</code>.</p>
693            </div>
694          </dd>
695        <dt><a href="#notationName"><code>notationName</code></a>,
696        <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
697        and <code>parentNode</code></dt>
698          <dd><code>null</code>.</dd>
699        <dt><code>ownerDocument</code></dt>
700          <dd>The <code>Document</code> node over which the method is invoked.</dd>
701        <dt><a href="#publicId"><code>publicId</code></a> and
702        <a href="#systemId"><code>systemId</code></a></dt>
703          <dd><code>null</code>.</dd>
704          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
705        </dl>
706      <p>The returned node <em class=rfc2119>MUST NOT</em> be marked as
707      <a href="#read-only">read$B!>(Bonly</a>.</p></dd>
708    <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,
709    method</dt>
710    <dd>    <dd>
711      <ol>      <p>This method creates a <code>Notation</code> node with the
712      <li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the      specified name, belonging to the document.</p>
713      <code>data</code> attribute value as an <abbr>XML</abbr> character      <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>
714      data</a>.</li>      parameter is the name of the notation.</p>
715      <li>If the <code>childNodes</code> list of <var>n</var> contains  
716      any nodes, they are in      <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
717      <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>
718      </ol>      <dl>
719    </dd>      <dt><code>childNodes</code></dt>
720  <dt>Otherwise</dt>        <dd>An empty <code>NodeList</code> object.</dd>
721    <dd><span class=ed>xml-well-formedness-error?  unknown-error?</span></dd>      <dt><code>manakaiDeclarationBaseURI</code>
722        <cite class="bibref normative">[<a href="#ref-MANAKAI">MANAKAI</a>]</cite></dt>
723          <dd>No explicit value is set.</dd>
724        <dt><code>nodeName</code></dt>
725          <dd><a href="#createNotation-name"><var>name</var></a>.</dd>
726        <dt><code>ownerDocument</code></dt>
727          <dd>The <code>Document</code> node over which the method is invoked.</dd>
728        <dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
729        and <code>parentNode</code></dt>
730          <dd><code>null</code>.</dd>
731        <dt><a href="#publicId"><code>publicId</code></a> and
732        <a href="#systemId"><code>systemId</code></a></dt>
733          <dd><code>null</code>.</dd>
734          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
735        </dl>
736      <p>The returned node <em class=rfc2119>MUST NOT</em> be marked as
737      <a href="#read-only">read$B!>(Bonly</a>.</p></dd>
738  </dl>  </dl>
739    
740    <p>These methods <em class=rfc2119>MUST</em> raise an
741    <code>INVALID_CHARACTER_ERR</code> if <var>name</var> is <em>not</em> a legal
742    <code>Name</code>
743    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
744    <a href="#ref-XML11">XML11</a>]</cite> according to the <abbr>XML</abbr>
745    version specified in the <code>xmlVersion</code> attribute of the
746    <a href="#Document"><code>Document</code></a> node.</p>
747    
748    <div class="note memo">
749    <p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now,
750    since <abbr>DOM</abbr> Level 3 Core specification
751    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
752    does not define it for <a href="#Document"><code>Document</code></a>
753    methods.</p>
754    
755    <p><var>name</var> does not have to be a namespace qualified name.</p>
756  </div>  </div>
757    
758  </div>  </div>
759    
 <div id=classes class=section>  
 <h2>Character Classes</h2>  
760    
761  <p>This section defines a couple of character classes.  <div class=section id=section-documenttype>
762  These classes are referred to by algorithms specified above.</p>  <h3>Modifications to the <code id=DocumentType>DocumentType</code>
763    Interface</h3>
764    
765    <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
766    <em class=rfc2119>MAY</em> contain zero or more
767    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
768    nodes in the <code>NodeList</code> object contained in the
769    <code>childNodes</code> attribute of the
770    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
771    
772    <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
773    during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
774    document, the <code>NodeList</code> object in the <code>childNodes</code>
775    object <em class=rfc2119>MUST</em> contains the
776    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
777    nodes representing the processing instructions in the document type
778    definition of the document processed
779    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
780    <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr> processor.  If
781    the <a href="#DocumentType"><code>DocumentType</code></a> node is marked as
782    <a href="#read-only">read$B!>(Bonly</a>, then all the child nodes
783    <em class=rfc2119>MUST</em> also be marked as
784    <a href="#read-only">read$B!>(Bonly</a>.</p>
785    
786    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
787    from a
788    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.doctype">document
789    type declaration information item</a>
790    <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>,
791    the <code>NodeList</code> object in the <code>childNodes</code> attribute
792    of the node <em class=rfc2119>MUST</em> contain the
793    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
794    created from any
795    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.pi">processing
796    instruction information items</a> in the list in the [children] property of the
797    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.doctype">document
798    type declaration item</a> in the same order.</p>
799    
800    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
801    a document type declaration information item, the list in the [children]
802    property <em class=rfc2119>MUST</em> contain the processng instruction
803    information items created from the
804    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
805    in the <code>NodeList</code> object in the <code>childNodes</code> attribute
806    of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
807    
808    <p>The implementation of the
809    <a href="#DocumentType"><code>DocumentType</code></a> interface
810    <em class=rfc2119>MUST</em> be modified as the following
811    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
812    <pre class=idl><code>// Modifications to the DocumentType interface
813      attribute DOMString <a href="#publicId">publicId</a>;
814      attribute DOMString <a href="#systemId">systemId</a>;
815    
816      attribute DOMString <a href="#internalSubset">internalSubset</a>;
817    </code></pre>
818    
819    <p>The <code id=publicId>publicId</code> attribute and the
820    <code id=systemId>systemId</code> attribute of
821    <a href="#DocumentType"><code>DocumentType</code></a>,
822    <a href="#Entity"><code>Entity</code></a>, and
823    <a href="#Notation"><code>Notation</code></a> interfaces are no longer
824    read$B!>(Bonly.</p>
825    
826    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
827    <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
828    <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it <em class=rfc2119>MUST</em>
829    set the specified value as the value associated to the attribute.  No
830    normalization, relative reference resolution, or lexical validation is
831    performed. <span class=ed>@@ If the new value is <code>null</code>, should an e
832    mpty string be set?</span></p>
833    
 <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>  
834  <div class="note memo">  <div class="note memo">
835  <p>This character class contains all characters allowed in the production rule  <p>Setting an invalid identifier might make the node unserializable.
836  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a>  Setting a public identifier while leaveing system identifier unspecified
837  of <abbr>XML</abbr> 1.0  would also make the <a href="#DocumentType"><code>DocumentType</code></a>
838  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  or <a href="#Entity"><code>Entity</code></a> node unserializable.</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>  
 <div class="note memo">  
 <p>This character class contains the characters listed in the Note in  
 <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a>  
 of <abbr>XML</abbr> 1.0  
 <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>,  
 as amended by  
 <a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p>  
839  </div>  </div>
840    
841  <p>The character class <dfn id=class-NameStartChar10><code>NameStartChar10</code></dfn>  <div class=ed>
842  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>
 <ul class=ed>  
 </ul>  
 <div class="note memo">  
 <p>This character class contains all characters allowed as the first character  
 of a string matching to the production rule  
 <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Name"><code>Name</code></a>  
 of <abbr>XML</abbr> 1.0  
 <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  
843  </div>  </div>
844    
845  <p>The character class <dfn id=class-NameChar10><code>NameChar10</code></dfn>  <p>The <code id=internalSubset>internalSubset</code> attribute of the
846  contains the following characters:</p>  <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
847  <ul>  read$B!>(Bonly.</p>
848  <li>The characters in the character class  
849  <a href="#class-NameStartChar10">NameStartChar10</a>.</li>  <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
850  <li class=ed></li>  <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
851  </ul>  <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it <em class=rfc2119>MUST</em>
852    set the specified value as the value associated to the attribute.  No
853    normalization, or lexical validation is performed.  <span class=ed>@@ If the
854    new value is <code>null</code>, should an empty string be set?</span></p>
855    
856    </div>
857    
858    <div class=section id=section-documenttypedefinition>
859    <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
860    
861    <p>The <a href="#DocumentType"><code>DocumentType</code></a> nodes
862    <em class=rfc2119>MUST</em> also implement the
863    <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
864    interface.</p>
865    
866    <p>An instance of the
867    <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
868    interface <em class=rfc2119>MUST</em> be able to be obtained by using
869    binding$B!>(Bspecific casting methods on an instance of the
870    <a href="#DocumentType"><code>DocumentType</code></a> interface (if such
871    casting methods are available) or by using the method <code>getFeature</code>
872    with parameter values
873    <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
874    and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
875    <a href="#DocumentType"><code>DocumentType</code></a> node supports the
876    feature <code>Core</code> version <code>3.0</code>
877    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>).</p>
878    
879  <div class="note memo">  <div class="note memo">
880  <p>This character class contains all characters allowed as the second  <p>This interface is a separated interface from the
881  character of a string matching to the production rule  <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
882  <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>,
883  of <abbr>XML</abbr> 1.0  for the historical reason.</p>
884  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  
885  </div>  <p class=ed>Should the interface be merged with
886    <a href="#DocumentType"><code>DocumentType</code></a>?</p>
887  <p>The character class <dfn id=class-PubidChar><code>PubidChar</code></dfn>  </div>
888  contains the following characters:</p>  
889  <ul>  <p>The
890  <li><code class=char>U+0009</code> <code class=charname>CHARACTER  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
891  TABULATION</code></li>  interface <em class=rfc2119>MUST</em> be implemented as the following
892  <li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li>  <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
893  <li><code class=char>U+000D</code> <code class=charname>CARRIAGE  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
894  RETURN</code></li>    readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
895  <li><code class=char>U+0020</code> <code class=charname>SPACE</code></li>    readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
896  <li><code class=char>U+0021</code> <code class=charname>EXCLAMATION MARK</code>    readonly attribute NamedNodeMap <a href="#notations">notations</a>;
897  (<code class=char>!</code>)</li>  
898  <li><code class=char>U+0023</code> <code class=charname>DOLLAR SIGN</code>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
899  (<code class=char>$</code>)</li>      (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
900  <li><code class=char>U+0024</code> <code class=charname>NUMBER SIGN</code>    <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
901  (<code class=char>#</code>)</li>      (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
902  <li><code class=char>U+0025</code> <code class=charname>PERCENT SIGN</code>    <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
903  (<code class=char>%</code>)</li>      (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
904  <li><code class=char>U+0027</code> <code class=charname>APOSTROPHE</code>  
905  (<code class=char>'</code>)</li>    void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
906  <li><code class=char>U+0028</code> <code class=charname>LEFT PARENTHESIS</code>      (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
907  (<code class=char>(</code>)</li>      raises (DOMException);
908  <li><code class=char>U+0029</code> <code class=charname>RIGHT    void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
909  PARENTHESIS</code> (<code class=char>)</code>)</li>      (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
910  <li><code class=char>U+002A</code> <code class=charname>ASTERISK</code>      raises (DOMException);
911  (<code class=char>*</code>)</li>    void <a href="#setNotationNode">setNotationNode</a>
912  <li><code class=char>U+002B</code> <code class=charname>PLUS SIGN</code>      (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
913  (<code class=char>+</code>)</li>      raises (DOMException);
914  <li><code class=char>U+002C</code> <code class=charname>COMMA</code>  }</code></pre>
915  (<code class=char>,</code>)</li>  
916  <li><code class=char>U+002D</code> <code class=charname>HYPHEN-MINUS</code>  <dl>
917  (<code class=char>-</code>)</li>  <dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of
918  <li><code class=char>U+002E</code> <code class=charname>FULL STOP</code>  type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
919  (<code class=char>.</code>)</li>    <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
920  <li><code class=char>U+002F</code> <code class=charname>SOLIDUS</code>    contains all the element type definitions belonging to the
921  (<code class=char>/</code>)</li>    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
922  <li><code class=char>U+0030</code> <code class=charname>DIGIT ZERO</code>  
923  (<code class=char>0</code>) .. <code class=char>U+0039</code>    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
924  <code class=charname>DIGIT NINE</code> (<code class=char>9</code>)</li>    <code>NamedNodeMap</code> object that contains all the
925  <li><code class=char>U+003A</code> <code class=charname>COLON</code>    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
926  (<code class=char>:</code>)</li>    nodes belonging to the <code>DocumentType</code> node.  The
927  <li><code class=char>U+003B</code> <code class=charname>SEMICOLON</code>    <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly
928  (<code class=char>;</code>)</li>    if and only if the node is <a href="#read-only">read$B!>(Bonly</a>.  The
929  <li><code class=char>U+003D</code> <code class=charname>EQUAL SIGN</code>    <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
930  (<code class=char>=</code>)</li>    <a href="#live">live</a>.</p>
931  <li><code class=char>U+003F</code> <code class=charname>QUESTION MARK</code>  
932  (<code class=char>?</code>)</li>    <p>If the <code>DocumentType</code> node is created during the process
933  <li><code class=char>U+0040</code> <code class=charname>COMMERCIAL AT</code>    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following
934  (<code class=char>@</code>)</li>    requirements are applied:  The <code>NamedNodeMap</code> object in the
935  <li><code class=char>U+0041</code> <code class=charname>LATIN CAPITAL LETTER    <a href="#elementTypes"><code>elementType</code></a> attribute
936  A</code> (<code class=char>A</code>) .. <code class=char>U+005A</code>    <em class=rfc2119>MUST</em> be so transformed that the object contains
937  <code class=charname>LATIN CAPITAL LETTER Z</code>    the <code>ElementTypeDefinition</code> nodes for the element types
938  (<code class=char>Z</code>)</li>    whose name is presented as the <code>Name</code> of the element type or
939  <li><code class=char>U+005F</code> <code class=charname>LOW LINE</code>    attribute definition list declarations processed
940  (<code class=char>_</code>)</li>    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
941  <li><code class=char>U+0061</code> <code class=charname>LATIN CAPITAL LETTER    <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr>
942  A</code> (<code class=char>A</code>) .. <code class=char>U+007A</code>    processor.  If there are more than one element type declarations for an
943  <code class=charname>LATIN CAPITAL LETTER Z</code>    element type, then the declarations other than the first one
944  (<code class=char>Z</code>)</li>    <em class=rfc2119>MUST</em> be ignored for the purpose of constructing the
945  </ul>    <code>NamedNodeMap</code> object.</p></dd>
946    <dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn>
947    of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
948      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
949      contains all the general entities belonging to the
950      <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
951      
952      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
953      same value as the <code id=entities>entities</code> attribute (defined in the
954      <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
955      node.</p>
956    
957      <div class="note memo">
958        <p>This attribute is part of the interface for historical reason.</p>
959      </div></dd>
960    <!--
961    All entities declared in the document type definition
962    contained in or referenced from the document entity
963    might not be exposed through this collection, depending
964    on the information provided by the XML processor for
965    the DOM implementation.  In particular, it might not
966    contain any entity if entity references are expanded
967    at the parse time.  An implementation [['''MUST NOT''']]
968    expose an [CODE(DOMi)@en[[[Entity]]]] node whose [CODE(DOMa)@en[[[nodeName]]]]
969    is equal to the name of one of five predefined general entities in
970    XML through the collection as the result of parsing of an XML
971    document that has no error.  Duplicate entity declarations are also discarded.
972    
973    The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
974    object that contains all the [CODE(DOMi)@en[[[Entity]]]] nodes
975    representing general entities belong to the node.  The returned
976    [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
977    the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
978    and therefore any change of read-only flag on the node is immediately
979    reflected by that of the object.
980    -->
981    <dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type
982    <code>notations</code>, read$B!>(Bonly</code>
983      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
984      contains all the notations belonging to the
985      <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
986      
987      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
988      same value as the <code>notations</code> attribute (defined in the
989      <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
990      node.</p>
991    
992      <div class="note memo">
993        <p>This attribute is part of the interface for historical reason.</p>
994        <p>Implementations are not required to implement the
995        <code>notations</code> attribute twice (for
996        <a href="#DocumentType"><code>DocumentType</code></a> and
997        <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
998        interfaces); they share exactly same definition.</p>
999      </div></dd>
1000    <!--
1001    If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is
1002    created from an XML document, duplicate notation declarations, if any, in DTD
1003    [['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]]
1004    object and only the first declaration [['''MUST''']] be
1005    made available as a [CODE(DOMi)@en[[[Notation]]]] node.
1006    
1007    ;; This definition is based on one for the
1008    [CODE(DOMa)@en[[[notations]]]] attribute of the
1009    [CODE(DOMi)@en[[[DocumentType]]]] interface in DOM XML module.
1010    Since duplication is violation to the Validity Constraint,
1011    XML parsers might vary on how notations are notified to
1012    the application.  In particular, [CODE(InfoProp)@en[[[notations]]]]
1013    property of the document information item in XML Information Set
1014    is so defined that in case ''any'' notation is declared for
1015    multiple times then the property has no value.
1016    
1017    The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
1018    object that contains all the [CODE(DOMi)@en[[[Notation]]]] nodes
1019    representing notations belong to the node.  The returned
1020    [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
1021    the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
1022    and therefore any change of read-only flag on the node is immediately
1023    reflected by that of the object.
1024    -->
1025    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
1026    method</dt>
1027      <dd><p>Returns the
1028      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1029      with the specified name.</p>
1030    
1031      <p>The
1032      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
1033      parameter is the name of the element type.</p>
1034    
1035      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1036      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1037      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1038      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
1039      <code>NamedNodeMap</code> object in the
1040      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
1041      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1042      <code>null</code>.</p></dd>
1043    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
1044    method</dt>
1045      <dd><p>Returns the
1046      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1047      with the specified name.</p>
1048    
1049      <p>The
1050      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
1051      parameter is the name of the element type.</p>
1052    
1053      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1054      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1055      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1056      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
1057      <code>NamedNodeMap</code> object in the
1058      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
1059      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1060      <code>null</code>.</p></dd>
1061    <dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>,
1062    method</dt>
1063      <dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node
1064      with the specified name.</p>
1065    
1066      <p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn>
1067      parameter is the name of the general entity.</p>
1068    
1069      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1070      <a href="#Entity"><code>Entity</code></a> node,
1071      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1072      <a href="#getEntityNode-name"><var>name</var></a>, in the
1073      <code>NamedNodeMap</code> object in the
1074      <a href="#entities"><code>entities</code></a> attribute of the
1075      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1076      <code>null</code>.</p></dd>
1077    <dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>,
1078    method</dt>
1079      <dd><p>Returns the <a href="#Notation"><code>Notation</code></a> node
1080      with the specified name.</p>
1081    
1082      <p>The
1083      <dfn id=getNotationNode-name class=dom-param><var>name</var></dfn>
1084      parameter is the name of the notation.</p>
1085    
1086      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1087      <a href="#Notation"><code>Notation</code></a> node,
1088      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1089      <a href="#getNotationNode-name"><var>name</var></a>, in the
1090      <code>NamedNodeMap</code> object in the
1091      <a href="#notations"><code>notations</code></a> attribute of the
1092      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1093      <code>null</code>.</p></dd>
1094    <dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>,
1095    method</dt>
1096      <dd class=ed>@@</dd>
1097    <dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>,
1098    method</dt>
1099      <dd class=ed>@@</dd>
1100    <dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>,
1101    method</dt>
1102      <dd class=ed>@@</dd>
1103    </dl>
1104    
1105    <div class=ed>
1106    <p>A future version of this interface might define the
1107    <code>parameterEntities</code> and getter/setter for parameter entities.
1108    </div>
1109    
1110    </div>
1111    
1112    <div class=section id=section-elementtypedefinition>
1113    <h3>The <code>ElementTypeDefinition</code> Interface</h3>
1114    
1115    <p>The nodes of type
1116    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
1117    represents an element type definition.  Such a node
1118    <em class=rfc2119>MUST</em> implement the
1119    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1120    interface, which extends the <a href="#Node"><code>Node</code></a>
1121    interface.</p>
1122    
1123    <p>An element type definition represents a definition of the element type.
1124    It is corresponding to the element type declaration in <abbr>DTD</abbr>.
1125    However, an
1126    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1127    does not represent the element type definition in <abbr>DTD</abbr> itself.  
1128    Even if there are more than one element type declarations for an element type
1129    in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1130    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1131    node for that element type.  In addition, if there are attribute definition
1132    declarations for an element type, even when there is no element type
1133    declaration for that element type, the <abbr>DOM</abbr> will contain an
1134    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1135    node for that element type.</p>
1136    
1137    <p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1138    node cannot be a child of any node.  An
1139    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1140    cannot have any child node.</p>
1141    
1142    <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1143    interface <em class=rfc2119>MUST</em> be implemented as the following
1144    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1145    <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
1146      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1147    
1148      readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>;
1149      <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a>
1150        (in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>);
1151      void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a>
1152        (in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>)
1153        raises (DOMException);
1154    }</code></pre>
1155    
1156    <dl>
1157    <dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn>
1158    of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt>
1159      <dd><p>The
1160      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
1161      attribute of
1162      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1163      <a href="#Entity"><code>Entity</code></a>, and
1164      <a href="#Notation"><code>Notation</code></a> interfaces contain the
1165      <a href="#DocumentType"><code>DocumentType</code></a> node to which the node
1166      is attached.</p>
1167    
1168      <p>On getting, the attribute <em class=rfc2119>MUST</em> return a
1169      <a href="#DocumentType"><code>DocumentType</code></a> node.  It
1170      <em class=rfc2119>MUST</em> be such a node that whose
1171      <a href="#elementTypes"><code>elementTypes</code></a> (for an
1172      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1173      node), <a href="#entities"><code>entities</code></a> (for an
1174      <a href="#Entity"><code>Entity</code></a> node), or
1175      <a href="#notations"><code>notations</code></a> (for a
1176      <a href="#Notation"><code>Notation</code></a> node) attribute contains the
1177      <code>NamedNodeMap</code> object that contains the node.  If there is no such
1178      a <a href="#DocumentType"><code>DocumentType</code></a> node,
1179      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd>
1180    <dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn>
1181    of type NamedNodeMap, read$B!>(Bonly</dt>
1182      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
1183      contains all the attribute definitions belonging to the
1184      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1185      node.</p>
1186    
1187      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1188      <code>NamedNodeMap</code> object that contains all the
1189      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1190      belonging to the
1191      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1192      The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1193      read$B!>(Bonly if and only if the node is <a href="#read-only">read$B!>(Bonly</a>.  
1194      The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1195      <a href="#live">live</a>.</p>
1196      
1197      <p>If the
1198      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1199      is created during the process to create a <abbr>DOM</abbr> from an
1200      <abbr>XML</abbr> document, the following requirements are applied:  The
1201      <code>NamedNodeMap</code> object in the
1202      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1203      attribute <em class=rfc2119>MUST</em> be so transformed that the object
1204      contains the
1205      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1206      corresponding to the attribute definitions in the attribute definition
1207      list declarations processed
1208      <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1209      <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr> processor and
1210      associated to the element type represented by the node.  If there are more
1211      than one attribute definitions for an attribute, then the definitions other
1212      than the first one <em class=rfc2119>MUST</em> be ignored for the purpose
1213      of constructing the <code>NamedNodeMap</code> object.</p></dd>
1214    <dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>,
1215    method</dt>
1216      <dd><p>Return the
1217      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1218      with the specified name.</p>
1219    
1220      <p>The
1221      <dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn>
1222      parameter is the name of the attribute.</p>
1223    
1224      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1225      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
1226      whose <a href="#nodeName"><code>nodeName</code></a> attribute value is
1227      equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>,
1228      in the <code>NamedNodeMap</code> in the
1229      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1230      attribute of the node.  If there is no such node, it
1231      <em class=rfc2119>MUST</em> return <code>null</code>.</p></dd>
1232    <dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>,
1233    method</dt>
1234      <dd class=ed>@@</dd>
1235    </dl>
1236    
1237    <div class=ed>
1238    <p>A future version of the specification might define a set of attributes
1239    and methods for representing and accessing to the content model of the
1240    element type.</p>
1241    </div>
1242    </div>
1243    
1244    <div class=section id=section-attributedefinition>
1245    <h3>The <code>AttributeDefinition</code> Interface</h3>
1246    
1247    <p>The nodes of type
1248    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
1249    represents an attribute definition.  Such a node
1250    <em class=rfc2119>MUST</em> implement the
1251    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
1252    which extends the <a href="#Node"><code>Node</code></a> interface.</p>
1253    
1254    <p>An attribute definition represents a definition of the attribute
1255    associated to an element type.  It is corresponding to the attribute definition
1256    in the attribute list declaration in <abbr>DTD</abbr>.  However, an
1257    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
1258    not represent the attribute definition in <abbr>DTD</abbr> itself.  Even if
1259    there are more than one attribute definitions for an attribute of an element
1260    type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1261    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
1262    that attribute.</p>
1263    
1264    <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1265    node cannot be a child of any node.  An
1266    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1267    can have zero or more child nodes of same kinds as those allowed for
1268    <code>Attr</code> nodes
1269    <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
1270    
1271    <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1272    interface <em class=rfc2119>MUST</em> be implemented as the following
1273    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1274    <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
1275      <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
1276      const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
1277      const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1;
1278      const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2;
1279      const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3;
1280      const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4;
1281      const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5;
1282      const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6;
1283      const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7;
1284      const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8;
1285      const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
1286      const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
1287      const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
1288    
1289      <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
1290      const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
1291      const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
1292      const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
1293      const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
1294      const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
1295      
1296      readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
1297    
1298      readonly attribute unsigned short <a href="#declaredType">declaredType</a>;
1299      readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>;
1300      readonly attribute unsigned short <a href="#defaultType">defaultType</a>;
1301    }</code></pre>
1302    
1303    <dl>
1304    <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
1305    of type
1306    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1307    read$B!>(Bonly</dt>
1308      <dd><p>The
1309      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
1310      which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1311      node belongs.</p>
1312    
1313      <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
1314      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1315      It <em class=rfc2119>MUST</em> be such a node that whose
1316      <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
1317      attribute contains the <code>NamedNodeMap</code> object that contains
1318      the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1319      node.  If there is no such an
1320      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1321      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
1322    <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
1323    <code>unsigned short</code></dt>
1324      <dd><p>The declared type
1325      <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1326      <a href="#ref-XML11">XML11</a>]</cite> of the attribute.  It is expected that
1327      this attribute contains a value from the definition group
1328      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
1329    
1330      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1331      value associated to this attribute.</p>
1332    
1333      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1334      <code>NO_MODIFICATION_ALLOWED_ERR</code> if the
1335      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1336      is <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it
1337      <em class=rfc2119>MUST</em> set the specified value as the value
1338      associated to this attribute.</p>
1339    
1340      <p>If the <code>AttributeDefinition</code> node is created during the process
1341      to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
1342      appropriate value from the
1343      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
1344      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1345    
1346      <!-- DeclaredValueType -->
1347    <p>The definition group
1348    <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
1349    integers indicating the declared type of attributes.  The definition
1350    group contains the following constants:</p>
1351    
1352    <table>
1353    <thead>
1354    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1355    </thead>
1356    <tbody>
1357    <tr>
1358    <th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code>
1359    <td><code>0</code><td><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">No
1360    value</a>
1361    <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>.</tr>
1362    <tr>
1363    <th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code>
1364    <td><code>1</code><td><code>CDATA</code>
1365    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1366    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1367    <tr>
1368    <th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code>
1369    <td><code>2</code><td><code>ID</code>
1370    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1371    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1372    <tr>
1373    <th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code>
1374    <td><code>3</code><td><code>IDREF</code>
1375    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1376    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1377    <tr>
1378    <th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code>
1379    <td><code>4</code><td><code>IDREFS</code>
1380    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1381    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1382    <tr>
1383    <th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code>
1384    <td><code>5</code><td><code>ENTITY</code>
1385    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1386    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1387    <tr>
1388    <th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code>
1389    <td><code>6</code><td><code>ENTITIES</code>
1390    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1391    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1392    <tr>
1393    <th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code>
1394    <td><code>7</code><td><code>NMTOKEN</code>
1395    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1396    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1397    <tr>
1398    <th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code>
1399    <td><code>8</code><td><code>NMTOKENS</code>
1400    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1401    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1402    <tr>
1403    <th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code>
1404    <td><code>9</code><td><code>NOTATION</code>
1405    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1406    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1407    <tr>
1408    <th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code>
1409    <td><code>10</code><td>Enumeration
1410    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1411    <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1412    <tr>
1413    <th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code>
1414    <td><code>11</code><td><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">Unknown</a>,
1415    because no declaration for the attribute has been read but the
1416    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.document">[all declaration processed]</a>
1417    property
1418    <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>
1419    would be false.</tr>
1420    </tbody>
1421    </table>
1422    
1423    <p>If no attribute type information is available, or if the source
1424    of the information does not distinguish
1425    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">no
1426    value</a> and
1427    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">unknown</a>
1428    <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>,
1429    then the value
1430    <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>
1431    <em class=rfc2119>MUST</em> be used.</p>
1432    
1433  <div class="note memo">  <div class="note memo">
1434  <p>This character class contains all characters allowed in the production rule  <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1435  <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-PubidChar"><code>PubidChar</code></a>  created by the
1436  of <abbr>XML</abbr> 1.0  <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1437  <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p>  method has its <a href="#declaredType"><code>declaredType</code></a> attribute
1438    set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p>
1439    </div>
1440    
1441    <p>If the source of the information does not distinguish
1442    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">no
1443    value</a> and/or
1444    <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">unknown</a>
1445    <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite> and
1446    <code>CDATA</code>
1447    <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1448    <a href="#ref-XML11">XML11</a>]</cite>, then the value
1449    <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
1450    be used.</p>
1451    
1452    <p>In Perl binding
1453    <cite class="bibref normative">[<a href="#ref-DOMPERL">DOMPERL</a>]</cite>, the
1454    <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1455    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1456    definition group.</p>
1457    
1458      </dd>
1459    <dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of
1460    type <code>DOMStringList</code>, read$B!>(Bonly</dt>
1461      <dd><p>The list of allowed attribute values.</p>
1462    
1463      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1464      <code>DOMStringList</code> object associated to this attribute.  The object
1465      <em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of
1466      zero or more characters respectively, possibly with duplications.  The
1467      object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node
1468      is <a href="#read-only">read$B!>(Bonly</a>.</p>
1469    
1470      <p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1471      node is created during the process to create a <abbr>DOM</abbr> from an
1472      <abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain
1473      the names or name tokens allowed for the attribute defined by the node.
1474      If the document is well$B!>(Bformed, the object will be empty unless
1475      the <a href="#declaredType"><code>declaredType</code></a> is
1476      <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1477      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p>
1478    
1479      <p>If the <a href="#declaredType"><code>declaredType</code></a> is different
1480      from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1481      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute
1482      <em class=rfc2119>MUST</em> be ignored for the purpose of serializing
1483      into (part of) <abbr>XML</abbr> document.</p>
1484    
1485      <div class="note memo">
1486        <p>When serializing the node it should be noted that the object might
1487        be empty, might contain duplications, and might contain strings that are
1488        not names or name tokens.</p>
1489      </div></dd>
1490    <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1491    type <code>unsigned short</code></dt>
1492      <dd><p>The type of the default for the attribute.  It is expected that this
1493      attribute contains a value from the definition group
1494      <a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p>
1495    
1496      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1497      the value associated to this attribute.</p>
1498    
1499      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1500      <code>NO_MODIFICATION_ALLOWED_ERR</code> if the
1501      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1502      is <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it
1503      <em class=rfc2119>MUST</em> set the specified value as the value
1504      associated to this attribute.</p>
1505    
1506      <p>If the
1507      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1508      created during the process to create a <abbr>DOM</abbr> from an
1509      <abbr>XML</abbr> document, an appropriate value from the
1510      <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1511      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1512    
1513      <!-- DefaultValueType -->
1514      <p>The definition group
1515      <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1516      contains integers indicating the type of the default for the attribute.
1517      The definition group contains the following constans:</p>
1518    
1519      <table>
1520      <thead>
1521      <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1522      </thead>
1523      <tbody>
1524      <tr>
1525      <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1526      <td><code>0</code><td>Unknown.</tr>
1527      <tr>
1528      <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1529      <td><code>1</code><td>Provided explicitly and only the value is allowed.
1530      <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1531      <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1532      <tr>
1533      <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1534      <td><code>2</code><td>No default value and the attribute have to be
1535      explicitly specified.</tr>
1536      <tr>
1537      <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1538      <td><code>3</code><td>Implied
1539      <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1540      <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1541      <tr>
1542      <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1543      <td><code>4</code><td>Provided explicitly.</tr>
1544      </tbody>
1545      </table>
1546    
1547      <p>If the source of the default type does not distinguish
1548      implied and unknown default types, then the value
1549      <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1550      <em class=rfc2119>MUST</em> be used.</p>
1551    
1552      <div class="note memo">
1553      <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1554      node created by the
1555      <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1556      method has its <a href="#defaultType"><code>defaultType</code></a>
1557      attribute set to
1558      <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1559      </div></dd>
1560    </dl>
1561    
1562    </div>
1563    
1564    <div class=section id=section-entity>
1565    <h3>Modifications to the <code id=Entity>Entity</code> Interface</h3>
1566    
1567    <p>The implementation of the <a href="#Entity"><code>Entity</code></a>
1568    interface <em class=rfc2119>MUST</em> be modified as the following
1569    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1570    <pre class=idl><code>// Modifications to the Entity interface
1571      attribute DOMString <a href="#publicId">publicId</a>;
1572      attribute DOMString <a href="#systemId">systemId</a>;
1573      attribute DOMString <a href="#notationName">notationName</a>;
1574    
1575      // Additions to the Entity interface
1576      attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>;
1577      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1578    
1579      attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>;
1580    </code></pre>
1581    
1582    <p>The <code id=notationName>notationName</code> attribute of the
1583    <a href="#Entity"><code>Entity</code></a> interface is no longer
1584    read$B!>(Bonly.</p>
1585    
1586    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1587    <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1588    <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it <em class=rfc2119>MUST</em>
1589    set the specified value as the value associated to the attribute.  No lexical
1590    validation is performed.  The new value <em class=rfc2119>MAY</em> be
1591    <code>null</code>.</p>
1592    
1593    <dl>
1594    <dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn>
1595    of type boolean</dt>
1596      <dd><p>Whether the structure of the replacement text of the entity
1597      is available via the <code>NodeList</code> object in the
1598      <code>childNodes</code> attribute of the entity.</p>
1599    
1600      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1601      the value associated to this attribute.</p>
1602    
1603      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1604      <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1605      <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it
1606      <em class=rfc2119>MUST</em> set the specified value as the
1607      value associated to this attribute.</p>
1608    
1609      <div class="note memo">
1610      <p>The attribute can be set to <code>false</code> even if the
1611      <a href="#Entity"><code>Entity</code></a> node has any child node.
1612      If the attribute is set to <code>false</code>, then any child node of
1613      the <a href="#Entity"><code>Entity</code></a> node ought to be ignored,
1614      say, for the purpose of serialization.</p>
1615      </div>
1616    
1617      <p>When an <code>EntityReference</code> node is created by cloning
1618      the replacement subtree of the <a href="#Entity"><code>Entity</code></a>
1619      node, if the attribute is set to <code>false</code>, then any descendant
1620      of the node <em class=rfc2119>MUST</em> be ignored.</p>
1621    
1622      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1623      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1624      the following requirements are applied:  If the entity is an unparsed
1625      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1626      <code>false</code>.  Otherwise, if the entity is an external entity whose
1627      replacement text is not available, or whose replacement text is not converted
1628      to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set
1629      to <code>false</code>.  Otherwise, the attribute
1630      <em class=rfc2119>MUST</em> be set to <code>true</code>.</p>
1631    
1632      <div class="note memo">
1633      <p>An <a href="#Entity"><code>Entity</code></a> node created by the
1634      <a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method
1635      has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a>
1636      attribute set to <code>false</code>.</p>
1637      </div></dd>
1638    <dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn>
1639    of type boolean</dt>
1640      <dd><p>Whether the entity is declared by an external entity declaration or
1641      not.  If the value is <code>true</code>, the entity is declared in an entity
1642      declaration in the external subset entity or in an external parameter entity.
1643      If the value is <code>false</code>, the entity is declared in an entity
1644      declaration in the internal subset, or the node is created in memory.</p>
1645    
1646      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1647      the value associated to this attribute.</p>
1648    
1649      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1650      <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1651      <a href="#read-only">read$B!>(Bonly</a>.  Otherwise, it
1652      <em class=rfc2119>MUST</em> set the specified value as the value associated
1653      to this attribute.</p>
1654    
1655      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1656      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1657      the following requirements are applied:  If the entity is an unparsed
1658      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1659      <code>false</code>.  Otherwise, i.e. the entity is a parsed entity, then the
1660      attribute <em class=rfc2119>MUST</em> be set to the value of whether the
1661      entity is declared by an external markup declaration or not.</p></dd>
1662    </dl>
1663    </div>
1664    
1665    <div class=section id=section-notation>
1666    <h3>Modifications to the <code id=Notation>Notation</code> Interface</h3>
1667    
1668    <p>The implementation of the <a href="#Notation"><code>Notation</code></a>
1669    interface <em class=rfc2119>MUST</em> be modified as the following
1670    <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1671    <pre class=idl><code>// Modifications to the Notation interface
1672      attribute DOMString <a href="#publicId">publicId</a>;
1673      attribute DOMString <a href="#systemId">systemId</a>;
1674    
1675      // Addition to the Notation interface
1676      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1677    </code></pre>
1678  </div>  </div>
1679    
1680  </div>  </div>
# Line 1093  of <abbr>XML</abbr> 1.0 Line 1687  of <abbr>XML</abbr> 1.0
1687    
1688  <dl>  <dl>
1689  <dt id=ref-DOM3CORE>DOM3CORE</dt>  <dt id=ref-DOM3CORE>DOM3CORE</dt>
1690    <dd class=ed>@@ W3C DOM Level 3 Core</dd>    <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407">Document
1691  <dt id=ref-DOMDTDEF>DOMDTDEF</dt>    Object Model (<abbr>DOM</abbr>) Level 3 Core Specification, Version
1692    <dd class=ed>@@ manakai's extension to DOM for document type definitions</dd>    1.0</a></cite>, <abbr>W3C</abbr> Recommendation, <time datetime=2004-04-07>7
1693      April 2004</time>.  <em>This</em> version of the specification is referenced.
1694      The latest version of the specification is available at
1695      <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Level-3-Core">http://www.w3.org/TR/DOM-Level-3-Core</a>></code>.</dd>
1696    <dt id=ref-DOMBIND>DOMBIND</dt>
1697      <dd><cite><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">Language
1698      Bindings for <abbr>DOM</abbr> Specifications</a></cite>, <abbr>W3C</abbr>
1699      Working Draft, <time datetime=2007-10-17>17 October 2007</time>.  
1700      <em>This</em> version of the specification is referenced.  The latest version
1701      of the specification is available at
1702      <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Bindings/">http://www.w3.org/TR/DOM-Bindings/</a>></code>.</dd>
1703    <dt id=ref-DOMPERL>DOMPERL</dt>
1704      <dd><cite><a href="http://suika.fam.cx/gate/2005/sw/manakai/DOM%20Perl%20Binding">manakai's
1705      <abbr>DOM</abbr> Perl Binding</a></cite>, editor's draft.  Work in
1706      progress.</dd>
1707    <dt id=ref-HTML5>HTML5</dt>
1708      <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,
1709      <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
1710      Working Draft.  Work in progress.</dd>
1711    <dt id=ref-INFOSET>INFOSET</dt>
1712      <dd><cite><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204"><abbr>XML</abbr>
1713      Information Set (Second Edition)</a></cite>, <abbr>W3C</abbr> Recommendation,
1714      <time datetime=2004-02-04>4 February 2004</time>.  <em>This</em> version of
1715      the specification is referenced.  The latest version of the specification is
1716      available at
1717      <code class=uri>&lt;<a href="http://www.w3.org/TR/xml-infoset">http://www.w3.org/TR/xml-infoset</a>></code>.</dd>
1718  <dt id="ref-KEYWORDS">KEYWORDS</dt>  <dt id="ref-KEYWORDS">KEYWORDS</dt>
1719    <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in    <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
1720    <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,    <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
# Line 1104  of <abbr>XML</abbr> 1.0 Line 1723  of <abbr>XML</abbr> 1.0
1723    14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,    14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,
1724    <time datetime=1997-03>March 1997</time>.    <time datetime=1997-03>March 1997</time>.
1725    <em>This</em> version of the specification is referenced.</dd>    <em>This</em> version of the specification is referenced.</dd>
1726  <dt id=ref-INFOSET>INFOSET</dt>  <dt id=ref-MANAKAI>MANAKAI</dt>
1727    <dd class=ed>@@</dd>    <dd><cite><a href="http://suika.fam.cx/gate/2005/sw/manakai/DOM%20Extensions">
1728      manakai's <abbr>DOM</abbr> Extensions</a></cite>, editor's draft.  Work in
1729      progress.</dd>
1730  <dt id=ref-XML10">XML10</dt>  <dt id=ref-XML10">XML10</dt>
1731    <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible    <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible
1732    Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,    Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,
1733    <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August    <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
1734    2006</time>, edited in place <time datetime=2006-09-29>29 September    2006</time>, edited in place <time datetime=2006-09-29>29 September
1735    2006</time>.  Tje latest version of the specification is available at    2006</time>.  <em>This</em> version of the specification is referenced.  The
1736    <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.    latest version of the specification is available at
1737    <em>This</em> version of the specification is referenced.</dd>    <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.</dd>
1738  <dt id=ref-XML11>XML11</dt>  <dt id=ref-XML11>XML11</dt>
1739    <dd class=ed>@@</dd>    <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml11-20060816/">Extensible
1740      Markup Language (<abbr>XML</abbr>) 1.1 (Second Edition)</a></cite>,
1741      <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
1742      2006</time>, edited in place <time datetime=2006-09-29>29 September
1743      2006</time>.  <em>This</em> version of the specification is referenced.  The
1744      latest version of the specification is available at
1745      <code class=uri>&lt;<a href="http://www.w3.org/TR/xml11">http://www.w3.org/TR/xml11</a>></code>.</dd>
1746  </dl>  </dl>
1747  </div>  </div>
1748    
1749  <div id="informative-references" class="section informative reference">  <div id="informative-references" class="section informative reference">
1750  <h3>Non$B!>(Bnormative References</h3>  <h3>Non$B!>(Bnormative References</h3>
1751    
1752  <dl class=ed>  <dl>
1753  <dt id=ref-CSS>CSS</dt>  <dt id=ref-DOM1WD>DOM1WD</dt>
1754    <dd><cite><a href="http://www.w3.org/TR/2007/CR-CSS21-20070719">Cascading    <dd><cite><a href="http://www.w3.org/TR/WD-DOM-971209/">Document Object
1755    Style Sheets Level 2 Revision 1 (<abbr>CSS</abbr> 2.1)    Model Specification</a></cite>, <abbr>W3C</abbr> Working Draft,
1756    Specification</a></cite>,    <time datetime=1997-12-09>9 December 1998</time>.</dd>
1757    <abbr title="World Wide Web Consortium">W3C</abbr> Candidate    <dd><cite><a href="http://www.w3.org/TR/WD-DOM-19980318/">Document Object
1758    Recommendation, <time datetime=2007-07-19>19 July 2007</time>.    Model Specification</a></cite>, <abbr>W3C</abbr> Working Draft,
1759    Work in progress.  The latest version of the specification is    <time datetime=1998-03-18>18 March 1998</time>.</dd>
1760    available at    <dd><cite><a href="http://www.w3.org/TR/1998/WD-DOM-19980416/">Document
1761    <code class=URI>&lt;<a href="http://www.w3.org/TR/CSS21">http://www.w3.org/TR/CSS21</a>></code>.</dd>    Object Model Specification, Version 1.0</a></cite>, <abbr>W3C</abbr> Working
1762  <dt id=ref-CSSOM>CSSOM</dt>    Draft, <time datetime=1998-04-16>16 April 1998</time>.</dd>
1763    <dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/csswg/cssom/Overview.html?rev=1.55&amp;content-type=text/html;%20charset=utf-8">Cascading  <dt id=ref-DOM3AS>DOM3AS</dt>
1764    Style Sheets Object Model (<abbr>CSSOM</abbr>)</a></cite>,    <dd><cite><a href="http://www.w3.org/TR/2002/NOTE-DOM-Level-3-AS-20020725/">Document
1765    <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,    Object Model (<abbr>DOM</abbr>) Level 3 Abstract Schemas Specification,
1766    <time datetime=2007-06-18>18 June 2007</time>.  Work in progress.    Version 1.0</a></cite>, <abbr>W3C</abbr> Note, <time datetime=2002-07-25>25
1767    The latest Editor's Draft of the specification is available at    July 2002</time>.  The latest version of the specification is available at
1768    <code class=URI>&lt;<a href="http://dev.w3.org/csswg/cssom/Overview.html">http://dev.w3.org/csswg/cssom/Overview.html</a>></code>.</dd>    <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Level-3-AS">http://www.w3.org/TR/DOM-Level-3-AS</a>></code>.</dd>
1769  <dt id=ref-HTML5>HTML5</dt>  <dt id=ref-XSAPI>XSAPI</dt>
1770    <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,    <dd><cite><a href="http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/"><abbr>XML</abbr>
1771    <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>    Schema <abbr>API</abbr></a></cite>, <abbr>W3C</abbr> Member Submission,
1772    Working Draft.  Work in progress.</dd>    <time datetime=2004-03-09>9 March 2004</time>.  The latest version of the
1773  <dt id=ref-SAPI>SAPI</dt>    specification is available at
1774    <dd><cite><a href="http://dev.w3.org/cvsweb/~checkout~/2006/webapi/selectors-api/Overview.html?rev=1.28&amp;content-type=text/html;%20charset=utf-8">Selectors <abbr>API</abbr></a></cite>,    <code class=uri>&lt;<a href="http://www.w3.org/Submission/xmlschema-api/">http://www.w3.org/Submission/xmlschema-api/</a>></code>.</dd>
   <abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft,  
   <time datetime=2007-08-29>29 August 2007</time>.  Work in progress.  
   The latest Editor's Draft of the specification is available at  
   <code class=URI>&lt;<a href="http://dev.w3.org/2006/webapi/selectors-api/Overview.html">http://dev.w3.org/2006/webapi/selectors-api/Overview.html</a>></code>.  
   The latest published version of the specification is available at  
   <code class=URI>&lt;<a href="http://www.w3.org/TR/selectors-api/">http://www.w3.org/TR/selectors-api/</a>></code>.</dd>  
 <dt id=XBL2>XBL2</dt>  
   <dd><cite><a href="http://www.mozilla.org/projects/xbl/xbl2.html"><abbr>XBL</abbr>  
   2.0</a></cite>, Mozilla.org, <time datetime=2007-03-15>15 Mar 2007</time>.  
   Work in progress.  The latest  
   <abbr title="World Wide Web Consortium">W3C</abbr>$B!>(Bpublished  
   version of the specification is available at  
   <code class=URI>&lt;<a href="http://www.w3.org/TR/xbl/">http://www.w3.org/TR/xbl/</a>></code>.</dd>  
 <dt id=ref-XML5>XML5</dt>  
   <dd class=ed>@@</dd>  
1775  </dl>  </dl>
1776  </div>  </div>
1777    

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24