/[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.6 by wakaba, Sun Dec 2 06:00:30 2007 UTC revision 1.22 by wakaba, Sat Dec 8 08:16:53 2007 UTC
# Line 10  Line 10 
10    
11  <div class="header">  <div class="header">
12  <h1>DOM Document Type Definition Module</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>
# Line 50  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 80  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    
 <div class="issue ed">  
 <p>This is a work-in-progress specification for DOM Document Type  
 Definition module, as implemented by manakai and  
 <a href="http://suika.fam.cx/gate/2005/sw/DOM%20XML%20Document%20Type%20Definition">partially documented in the SuikaWiki</a>.</p>  
 </div>  
   
85  <p>The <dfn id=term-dom-dtdef><abbr>DOM</abbr> Document Type Definition</dfn>  <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  module is a set of <abbr>DOM</abbr> interfaces, including both new
87  interfaces and modifications to existing <abbr>DOM</abbr> interfaces,  interfaces and modifications to existing <abbr>DOM</abbr> interfaces,
# Line 99  early drafts of <abbr>DOM</abbr> level 1 Line 95  early drafts of <abbr>DOM</abbr> level 1
95  any of them as a whole.</p>  any of them as a whole.</p>
96  </div>  </div>
97    
98  <div class="section" id="terminology">  <div class="section" id=conformance>
99  <h2>Terminology</h2>  <h2>Conformance Requirements</h2>
100    
101  <p>The key words <q><em class="rfc2119">MUST</em></q>,  <div class=section id=terminology>
102  <q><em class="rfc2119">MUST NOT</em></q>,  <h3>Terminology</h3>
 <q><em class="rfc2119">SHOULD</em></q>,  
 <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  
 <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>  
 2119</a>  
 <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>  
103    
 <!-- Strictly speaking the paragraph below is not part of terminology. -->  
104  <p>All examples and notes in this specification are non$B!>(Bnormative,  <p>All examples and notes in this specification are non$B!>(Bnormative,
105  as are all sections explicitly marked non$B!>(Bnormative.  Everything  as are all sections explicitly marked non$B!>(Bnormative.  Everything
106  else in this specification is normative.</p>  else in this specification is normative.</p>
107    
108  <p><span class=ed>Algorithm is normative but non-normative</span>.  <p>The key words <q><em class="rfc2119">MUST</em></q>,
109  In addition, the order in which <a href="#errors">errors</a> are  <q><em class="rfc2119">MUST NOT</em></q>, and <q><em class=rfc2119>MAY</em></q>
110  raised is undefined.</p>  in this document are to be interpreted as described in
111    <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>
112    2119</a>
113    <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>
114    
115  <p class=ed><var>A</var> object is an object implementing <var>A</var>  <p>Conformance requirements phrased as algorithms or specific steps
116  interface.</p>  <em class=rfc2119>MAY</em> be implemented in any manner, so long as the end
117    result is equivalent.  Requirements phrased in the imperative as part of
118    algorithms are to be interpreted with the meaning of the key word used in
119    introducing the algorithm.</p>
120    
121    <p>Sometimes an exception is phrased as being required to be raised.  As
122    specified in the <abbr>DOM</abbr> Core specification
123    <span class=ed>[DOM3]</span>,
124    when the value of the <code>strictErrorChecking</code> attribute of the
125    <a href="#Document"><code>Document</code></a> node is <code>false</code>,
126    then the exception is not have to be raised.</p>
127    
128    <p>Some conformance requirements are phrased as requirements on interfaces,
129    attributes, methods, or objects.  Such requirements are applied to
130    implementations.</p>
131    
132    <p>The construction <q>a <code><var>Foo</var></code> object</q>, where
133    <code><var>Foo</var></code> is an interface, is used instead of the more
134    accurate <q>an object implementing the interface
135    <code><var>Foo</var></code></q>.</p>
136    
137    <p>The construction <q>raise a <code><var>Bar</var></code></q>, where
138    <code><var>Bar</var></code> is an exception code, is used instead of the more
139    accurate <q>raise an exception implementing the interface
140    <code>DOMException</code> <span class=ed>[DOM3]</span> with its
141    <code>code</code> attribute set to <code><var>Bar</var></code></q>.</p>
142    
143    <p>The term
144    <q id=live><a href="http://www.whatwg.org/specs/web-apps/current-work/#live">live</a></q>
145    is defined in the HTML5 specification <span class=ed>[HTML5]</span>.</p>
146    
147  <p class=ed>@@ ref to DOM Binding Spec</p>  <p class=ed>@@ ref to DOM Binding Spec</p>
148  </div>  </div>
149    
150    <div class=section id=conformance-categories>
151    <h3>Conformance Categories</h3>
152    
153    <p>There are several kinds of products that can be claim to conform to
154    this specification:</p>
155    <dl>
156    <dt id=category-dom-implementation><abbr>DOM</abbr> Implementation</dt>
157      <dd>A <abbr>DOM</abbr> implementation (or just written as
158      <q>implementation</q> in this document) provides a way to access
159      <abbr>DOM</abbr> trees for applications by implementing interfaces defined
160      by this and other documents.  Unless otherwise noted, requirements in this
161      document are applied to <abbr>DOM</abbr> implementations.  To implement
162      all the features in this document, the implementation have to implement
163      some version of <abbr>DOM</abbr> Core (e.g. <abbr>DOM</abbr> level 3
164      <span class=ed>[DOM3]</span>) with one or more language binding (e.g.
165      ECMAScript or Java binding <span class=ed>[BINDINGS]</span> or
166      Perl binding <span class=ed>[PERLBINDING]</span>).</dd>
167    <dt id=category-xml-parser><abbr>XML</abbr> Parser (<abbr>XML</abbr> document
168    to <abbr>DOM</abbr> tree converter)</dt>
169      <dd>A software component that converts
170      <abbr>XML</abbr> 1.0 or 1.1 document (or fragment thereof) into a
171      <abbr>DOM</abbr> tree (or fragment thereof) in the context of this
172      document.  Note that this document does not define any particular way to
173      parse an <abbr>XML</abbr> document or to construct an <abbr>DOM</abbr>
174      document, but it defines constraints for such processing.</dd>
175    <dt id=category-xml-serializer><abbr>XML</abbr> Serializer (<abbr>DOM</abbr>
176    tree to <abbr>XML</abbr> document converter)</dt>
177      <dd>A software component that converts
178      <abbr>DOM</abbr> tree (or fragment thereof) into an <abbr>XML</abbr> 1.0 or
179      1.1 document (or fragment thereof).  Note that this document does not define
180      any particular way to serialize a <abbr>DOM</abbr> tree, but it defines
181      constraints for such processing.</dd>
182    <dt id=category-infoset-dom><abbr>XML</abbr> Information Set to
183    <abbr>DOM</abbr> Tree Converter</dt>
184      <dd>A software component that converts an <abbr>XML</abbr> information set
185      into a <abbr>DOM</abbr> tree.  Note that this documetn does not define
186      any particular way for the convertion, but it defines constraints for
187      such processing.</dd>
188    <dt id=category-dom-infoset><abbr>DOM</abbr> Tree to <abbr>XML</abbr>
189    Information Set Converter</dt>
190      <dd>A software component that converts a <abbr>DOM</abbr> tree into
191      an <abbr>XML</abbr> information set.  Note that this documetn does not define
192      any particular way for the convertion, but it defines constraints for
193      such processing.</dd>
194    </dl>
195    </div>
196    </div>
197    
198  <div class=section id=dom-dtdef>  <div class=section id=dom-dtdef>
199  <h2><abbr>DOM</abbr> Document Type Definition Module</h2>  <h2><abbr>DOM</abbr> Document Type Definition Module</h2>
200    
201  <p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0,  <p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0,
202  consists of three interfaces:</p>  introduces four interfaces:
203  <ul>  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>,
204  <li><a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a></li>  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>,
205  <li><a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a></li>  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
206  <li><a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a></li>  and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>.
207  <li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li>  In addition, it modifies existing interfaces
 </ul>  
   
 <p>In addition, it adds methods, attributes, and/or constants to interfaces  
208  <a href="#Node"><code>Node</code></a>,  <a href="#Node"><code>Node</code></a>,
209  <a href="#Entity"><code>Entity</code></a>,  <a href="#Document"><code>Document</code></a>,
210  <a href="#EntityReference"><code>EntityReference</code></a>, and  <a href="#DocumentType"><code>DocumentType</code></a>,
211  <a href="#Notation"><code>Notation</code></a>.  <a href="#Entity"><code>Entity</code></a>, and
212  It modifies semantics of some of methods and attributes in  <a href="#Notation"><code>Notation</code></a>.</p>
 <a href="#Node"><code>Node</code></a> and  
 <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>  
 interfaces, for the support of new interfaces.</p>  
213    
214  <div class=section id=features>  <div class=section id=features>
215  <h3>Feature Name</h3>  <h3>Feature String</h3>
216    
217  <p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of  <p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of
218  the <abbr>DOM</abbr> Document Type Definition module, the  the <abbr>DOM</abbr> Document Type Definition module, the
219  <code>hasFeature</code> method of a <code>DOMImplementation</code> object  <code>hasFeature</code> method of a <code>DOMImplementation</code> object
220  <em class=rfc2119>MUST</em> return <code>true</code> when the parameters are  <em class=rfc2119>MUST</em> return <code>true</code> when the parameters are
221  set to <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and  set to
222  <code>3.0</code> respectively.</p>  <dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn>
223    and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively.  Any
224    method that takes one or more feature names, with or without version number,
225    such as <code>hasFeature</code> or <code>getFeature</code>,
226    <em class=rfc2119>MUST</em> behave in a manner consistent with it.</p>
227    </div>
228    
229    <div class=section id=section-node>
230    <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
231    
232    <p>The implementation of the
233    <a href="#Node"><code>Node</code></a> interface
234    <em class=rfc2119>MUST</em> be modified as following:</p>
235    <pre class=idl><code>// Additions to the Node interface
236    
237    // Additions to the NodeType definition group
238    const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
239    const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
240    </pre>
241    
242    <p>This specification adds two new types (subinterfaces) of
243    <a href="#Node"><code>Node</code></a>: element type definition (node type
244    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
245    interface
246    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
247    attribute definition (node type
248    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
249    interface
250    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).  For
251    these kinds of nodes, methods and attributes in the
252    <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
253    
254    <dl>
255    <dt><code id=attributes>attributes</code></dt>
256      <dd>
257        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
258        <code>null</code>.</p>
259      </dd>
260    <dt><code id=baseURI>baseURI</code></dt>
261      <dd>
262        <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
263        value of the <a href="#baseURI"><code>baseURI</code></a> attribute
264        of the node in the <code>ownerDocument</code> attribute of the node.
265        Note that the value might be <code>null</code>.</p>
266      </dd>
267    <dt><code id=cloneNode>cloneNode</code></dt>
268      <dd class=ed>
269        <p>A future version of the specification is expected to define the
270        behavior of the <a href="#cloneNode"><code>cloneNode</code></a> method
271        for those kinds of nodes.  In addition, it might revise behavior of
272        the method for <a href="#Entity"><code>Entity</code></a>,
273        <a href="#Notation"><code>Notation</code></a>, and/or
274        <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
275      </dd>
276      <!--
277      <dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd>
278      -->
279    <dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt>
280      <dd class=ed>
281        <p>A future version of the specification is expected to define the
282        behavior of the method
283        for those kinds of nodes.  In addition, it might revise behavior of
284        the method for <a href="#Entity"><code>Entity</code></a>,
285        <a href="#Notation"><code>Notation</code></a>, and/or
286        <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
287      </dd>
288    <dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt>
289      <dd><p>When invoked, the method <em class=rfc2119>MUST</em> return
290      <code>false</code>.</p></dd>
291    <dt><code id=isEqualNode>isEqualNode</code></dt>
292      <dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method,
293      following items are added to the list of conditions for equality:</p>
294    
295      <ul>
296      <li>
297        <p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a>
298        and at least one of them has the support for the feature
299        <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p>
300        <ul>
301        <li>they are equal according to <abbr>DOM</abbr> level 3 definition
302        <span class=ed>@@ ref</span>, and
303        <li>either:
304          <ul><!--
305          <li>both of them does not support the feature
306          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>-->
307          <li>exactly one of them support the feature
308          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
309          and the <code>length</code> attribute of the <code>NamedNodeMap</code>
310          object in the <a href="#elementTypes"><code>elementTypes</code></a>
311          attribute of it is equal to <code>0</code>, or</li>
312          <li>both of them support the feature
313          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
314          and the values of the
315          <a href="#elementTypes"><code>elementTypes</code></a> attributes are
316          equal (equality of the
317          <a href="#elementTypes"><code>elementTypes</code></a> attribute is same
318          as that for the <code>attributes</code> attribute).</li>
319          </ul>
320        </li>
321        </ul>
322      </li>
323    
324      <li><p>If the nodes are
325      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
326      the values of the
327      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
328      attributes are equal (equality of the
329      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
330      attribute is same as that for the <code>attributes</code> attribute).</p></li>
331    
332      <li><p>If the nodes are
333      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
334      the values of the <a href="#declaredType"><code>declaredType</code></a> and
335      the <a href="#defaultType"><code>defaultType</code></a> attributes are
336      equal respectively.</p></li>
337    
338      <li><p>If the nodes are
339      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
340      the values of the <code>DOMStringList</code> objects in the
341      <a href="#allowedTokens"><code>allowedTokens</code></a> attributes
342      are equal, i.e. their <code>length</code> attribute values are equal and
343      each string exists in a list is contained in another list (their indeces
344      may be different), with an additional constraint that the number of the
345      items that are equal to a string in a list is equal to the number
346      of the items equal to the string in another list.</p></li>
347      </ul></dd>
348    <dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and
349    <code id=lookupPrefix>lookupPrefix</code></dt>
350      <dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return
351      <code>null</code>.</p></dd>
352    <dt><code id=nodeName>nodeName</code></dt>
353      <dd>
354        <p>If the node is an
355        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
356        On getting, the attribute <em class=rfc2119>MUST</em> return the
357        name of the element type definition represented by the node.</p>
358    
359        <p>If the node is an
360        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
361        On getting, the attribute <em class=rfc2119>MUST</em> return the
362        name of the attribute definition represented by the node.</p>
363      </dd>
364    <dt><code id=nodeType>nodeType</code></dt>
365      <dd>
366        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
367        <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
368        (if the node is an
369        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
370        <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
371        (if the node is an
372        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
373    
374        <!-- NodeType -->
375    <p>Two constants are added to the <code id=NodeType>NodeType</code>
376    definition group of the <a href="#Node"><code>Node</code></a> interface as
377    following:</p>
378    <table>
379    <thead>
380    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
381    </thead>
382    <tbody>
383    <tr>
384    <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
385    <td><code>81001</code><td>The node is an
386    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
387    <tr>
388    <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
389    <td><code>81002</code><td>The node is an
390    <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
391    </tbody>
392    </table>
393      </dd>
394    <dt><code id=nodeValue>nodeValue</code> and
395    <code id=textContent>textContent</code></dt>
396      <dd>
397        <p>If the node is an
398        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
399        On getting, the attributes <em class=rfc2119>MUST</em> return
400        <code>null</code>.</p>
401    
402        <div class="note memo">
403          <p>Thus, on setting the attributes does nothing
404          <span class=ed>[DOM3]</span>.</p>
405        </div>
406    
407        <p>On setting, the <a href="#textContent"><code>textContent</code></a>
408        attribute <em class=rfc2119>MUST NOT</em> raise a
409        <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>.
410        <span class=ed>@@ I forgot why this requirement is necessary.</span></p>
411    
412      <p>If the node is an
413      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
414      The attribute <em class=rfc2119>MUST</em> behave as if the node
415      were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd>
416    <dt><code id=normalize>normalize</code></dt>
417      <dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is
418      normalized, any nodes in the <code>NamedNodeMap</code> object in the
419      <a href="#elementTypes"><code>elementTypes</code></a> attribute
420      <em class=rfc2119>MUST</em> be normalized as well.</p>
421    
422      <p>When an
423      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
424      is normalized, any nodes in the <code>NamedNodeMap</code> object in the
425      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
426      attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd>
427    </dl>
428    
429    </div>
430    
431    <div class=section id=section-document>
432    <h3>Modifications to the <code id=Document>Document</code> Interface</h3>
433    
434    <!--
435    <p>If an attempt is made to adopt an
436    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
437    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
438    the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em>
439    raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@
440    ref</span>.</p>
441    -->
442    
443    <div class=ed>
444    <p>Future version of the specification is expected to define what should
445    be done if <code>adoptNode</code> or <code>importNode</code> method have to
446    adopt or import an
447    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
448    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node.
449    In addition it might revise behavior of those methods for
450    <a href="#Entity"><code>Entity</code></a>,
451    <a href="#Notation"><code>Notation</code></a>, and/or
452    <a href="#DocumentType"><code>DocumentType</code></a> nodes.
453    Behavior of <code>normalizeDocument</code> method for these kinds of
454    nodes might also be defined in some day.</p>
455    </div>
456    
 <p>In such an implementation, the <code>getFeature</code> method of a  
 <code>Document</code> object <em class=rfc2119>MUST</em> return the (at least  
 conceptually) same object implementing the  
 <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when  
 the parameters are set to  
 <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and  
 <code>3.0</code> respectively.  Likewise, any method that takes one or more  
 feature names with or without version number, including the methods  
 <code>hasFeature</code> and <code>getFeature</code>,  
 <em class=rfc2119>MUST</em> behave in a manner consistent with the  
 aforementioned cases.</p>  
457  </div>  </div>
458    
459  <div class=section id=section-documentxdoctype>  <div class=section id=section-documentxdoctype>
460  <h2>The <code>DocumentXDoctype</code> Interface</h2>  <h3>The <code>DocumentXDoctype</code> Interface</h3>
461    
462    <p>The <a href="#Document"><code>Document</code></a> nodes
463    <em class=rfc2119>MUST</em> also implement the
464    <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface.</p>
465    
466    <p>An instance of the
467    <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>
468    interface <em class=rfc2119>MUST</em> be able to be obtained by using
469    binding$B!>(Bspecific casting methods on an instance of the
470    <a href="#Document"><code>Document</code></a> interface (if such
471    casting methods are available) or by using the method <code>getFeature</code>
472    with parameter values
473    <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
474    and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
475    <a href="#Document"><code>Document</code></a> node supports the
476    feature <code>Core</code> version <code>3.0</code>
477    <span class=ed>[DOM3]</span>).</p>
478    
479    <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
480    <em class=rfc2119>MUST</em> be implemented as following:</p>
481  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
482    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
483      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
484      raises (DOMException);      raises (DOMException);
485    ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
486      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
487      raises (DOMException);      raises (DOMException);
488    AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a>    <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
489      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
490      raises (DOMException);      raises (DOMException);
491    Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a>    <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
492      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
493      raises (DOMException);      raises (DOMException);
494    Notation <a href="#createNotation">createNotation</a>    <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
495      (in DOMString <a href="#createNotation-name"><var>name</var></a>)      (in DOMString <a href="#createNotation-name"><var>name</var></a>)
496      raises (DOMException);      raises (DOMException);
497  }</code></pre>  }</code></pre>
498    
 <div class=ed>@@ cast definition</div>  
   
499  <dl>  <dl>
500  <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,  <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,
501  method</dt>  method</dt>
# Line 309  attribute is set to <code>ID_ATTR</code> Line 610  attribute is set to <code>ID_ATTR</code>
610  <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,  <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,
611  method</dt>  method</dt>
612    <dd>    <dd>
613      <p>This method creates a <code>Entity</code> node with the      <p>This method creates a <a href="#Entity"><code>Entity</code></a> node
614      specified name, which represents a general entity, belonging to the      with the specified name, which represents a general entity, belonging to
615      document.</p>      the document.</p>
616      <p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn>      <p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn>
617      parameter is the name of the general entity.</p>      parameter is the name of the general entity.</p>
618    
619        <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
620        an <a href="#Entity"><code>Entity</code></a> node with the following
621        attributes:</p>
622        <dl>
623        <dt><code>attributes</code>, <code>notationName</code>,
624        <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
625        and <code>parentNode</code></dt>
626          <dd><code>null</code>.</dd>
627        <dt><code>childNodes</code></dt>
628          <dd>An empty <code>NodeList</code> object.</dd>
629        <dt><code>manakaiDeclarationBaseURI</code>,
630        <code>manakaiEntityBaseURI</code>, and
631        <code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt>
632          <dd>No explicit value is set.</dd>
633        <dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and
634        <code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
635          <dd><code>false</code>.</dd>
636        <dt><code>nodeName</code></dt>
637          <dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd>
638          <dd>
639            <div class="note memo">
640              <p>It is not an error for
641              <a href="#createGeneralEntity-name"><var>name</var></a> matching
642              to the name of one of predefined general parsed entities in
643              <abbr>XML</abbr> or <abbr>HTML</abbr>.  For example,
644              <a href="#createGeneralEntity-name"><var>name</var></a> might be
645              <code>amp</code>, resulting in an
646              <a href="#Entity"><code>Entity</code></a> node
647              with its <code>nodeName</code> attribute set to <code>amp</code>.</p>
648            </div>
649          </dd>
650        <dt><code>ownerDocument</code></dt>
651          <dd>The <code>Document</code> node over which the method is invoked.</dd>
652        <dt><code>publicId</code>, and <code>systemId</code></dt>
653          <dd><code>null</code>.</dd>
654          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
655        <dt class=ed>@@ Ensure all attributes are defined</dd>
656        </dl>
657    </dd>    </dd>
658  <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,  <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,
659  method</dt>  method</dt>
# Line 322  method</dt> Line 662  method</dt>
662      specified name, belonging to the document.</p>      specified name, belonging to the document.</p>
663      <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>      <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>
664      parameter is the name of the notation.</p>      parameter is the name of the notation.</p>
665    
666        <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
667        a <code>Notation</code> node with the following attributes:</p>
668        <dl>
669        <dt><code>attributes</code>,
670        <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
671        and <code>parentNode</code></dt>
672          <dd><code>null</code>.</dd>
673        <dt><code>childNodes</code></dt>
674          <dd>An empty <code>NodeList</code> object.</dd>
675        <dt><code>manakaiDeclarationBaseURI</code></dt>
676          <dd>No explicit value is set.</dd>
677        <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
678          <dd><code>false</code>.</dd>
679        <dt><code>nodeName</code></dt>
680          <dd><a href="#createNotation-name"><var>name</var></a>.</dd>
681        <dt><code>ownerDocument</code></dt>
682          <dd>The <code>Document</code> node over which the method is invoked.</dd>
683        <dt><code>publicId</code> and <code>systemId</code></dt>
684          <dd><code>null</code>.</dd>
685          <dd class=ed>@@ publicId and systemId should be empty string?</dd>
686        <dt class=ed>@@ Ensure all attributes are defined</dt>
687        </dl>
688    </dd>    </dd>
689  </dl>  </dl>
690    
691  <pre class=ed>  <p>These methods <em class=rfc2119>MUST</em> raise an
692  [11] The [CODE(DOMm)@en[[[createGeneralEntity]]]]  <code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span>
693  method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]]  if <var>name</var> is <em>not</em> a legal <code>Name</code> according to
694  node with the following attribute values:  the <abbr>XML</abbr> version in use, as specified in the
695  - [CODE(DOMa)@en[[[attributes]]]],  <code>xmlVersion</code> attribute of the <code>Document</code> node.</p>
696  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].  
697  - [CODE(DOMa)@en[[[childNodes]]]]: An empty  <div class="note memo">
698  [CODE(DOMi)@en[[[NodeList]]]].  <p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now,
699  - [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:  since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not
700  No explicit value is set.  define it for <code>Document</code> methods.</p>
701  - [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]:  
702  No explicit value is set.  <p><var>name</var> does not have to be a namespace qualified name.</p>
703  - [CODE(DOMa)@en[[[manakaiEntityURI]]]]:  </div>
704  No explicit value is set.  
705  - [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]:  </div>
 [CODE(IDL)@en[[[false]]]].  
 - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:  
 [CODE(IDL)@en[[[false]]]].  
 - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].  
 - [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[ownerDocument]]]]: The  
 [CODE(DOMi)@en[[[Document]]]] node on which the method  
 is invoked.  
 - [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:  
 [CODE(IDL)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].  
   
 @@ Ensure all attributes are defined  
   
 @@ publicId and systemId should be empty string?  
   
 [13] The [CODE(DOMm)@en[[[createNotation]]]]  
 method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]]  
 node with the following attribute values:  
 - [CODE(DOMa)@en[[[attributes]]]],  
 [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[childNodes]]]]: An empty  
 [CODE(DOMi)@en[[[NodeList]]]].  
 - [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:  
 No explicit value is set.  
 - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:  
 [CODE(IDL)@en[[[false]]]].  
 - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].  
 - [CODE(DOMa)@en[[[ownerDocument]]]]: The  
 [CODE(DOMi)@en[[[Document]]]] node on which the method  
 is invoked.  
 - [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:  
 [CODE(IDL)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].  
 - [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].  
   
 @@ Ensure all attributes are defined  
   
 [7]  
 These method [['''MUST''']] raise an  
 [CODE(DOMi)@en[[[INVALID_CHARACTER_ERR]]]]  
 [CODE(DOMi)@en[[[DOMException]]]]  
 if the [CODE(DOMp)@en[[[name]]]] is not a legal  
 name according to the XML version in use as  
 specified in the [CODE(DOMa)@en[[[xmlVersion]]]]  
 attribute of the [CODE(DOMi)@en[[[Document]]]] node.  
   
 ;; Non-XML case is intentionally left unspecified for now  
 since DOM3 does not define it.  
   
 ;; [CODE(DOMp)@en[[[name]]]] does not have to  
 be a namespace qualified name.  
   
 ;; Note also that it is not an error for the  
 [CODE(DOMp)@en[[[name]]]] parameter value  
 to match to the name of one of predefined general  
 parsed entities in XML or HTML.  
   
 ;; If the [CODE(DOMa)@en[[[strictErrorChecking]]]] attribute  
 is set to [CODE(IDL)@en[[[false]]]], then the implementation  
 is not required to raise this exception.  
706    
707  Otherwise, these method [['''MUST''']] return  
708  the newly created node.  <div class=section id=section-documenttype>
709  </pre>  <h3>Modifications to the <code id=DocumentType>DocumentType</code>
710    Interface</h3>
711    
712    <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
713    <em class=rfc2119>MAY</em> contain zero or more
714    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
715    nodes in the <code>NodeList</code> object contained in the
716    <code>childNodes</code> attribute of the
717    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
718    
719    <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
720    during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
721    document, the <code>NodeList</code> object in the <code>childNodes</code>
722    object <em class=rfc2119>MUST</em> contains the
723    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
724    nodes representing the processing instructions in the document type
725    definition of the document processed <span class=ed>@@ ref</span> by
726    the <abbr>XML</abbr> processor.  If the
727    <a href="#DocumentType"><code>DocumentType</code></a> node is marked
728    as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em>
729    also be marked as read$B!>(Bonly.</p>
730    
731    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
732    from a document type declaration information item <span class=ed>@@ ref</span>,
733    the <code>NodeList</code> object in the <code>childNodes</code> attribute
734    of the node <em class=rfc2119>MUST</em> contain the
735    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
736    created from the processing instruction information items in the list in the
737    [children] property of the document type declaration item in the same
738    order.</p>
739    
740    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
741    a document type declaration information item, the list in the [children]
742    property <em class=rfc2119>MUST</em> contain the processng instruction
743    information items created from the
744    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
745    in the <code>NodeList</code> object in the <code>childNodes</code> attribute
746    of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
747    
748    <p>The implementation of the
749    <a href="#DocumentType"><code>DocumentType</code></a> interface
750    <em class=rfc2119>MUST</em> be modified as following:</p>
751    <pre class=idl><code>// Modifications to the DocumentType interface
752      attribute DOMString <a href="#publicId">publicId</a>;
753      attribute DOMString <a href="#systemId">systemId</a>;
754    
755      attribute DOMString <a href="#internalSubset">internalSubset</a>;
756    </code></pre>
757    
758    <p>The <code id=publicId>publicId</code> attribute and the
759    <code id=systemId>systemId</code> attribute of
760    <a href="#DocumentType"><code>DocumentType</code></a>,
761    <a href="#Entity"><code>Entity</code></a>, and
762    <a href="#Notation"><code>Notation</code></a> interfaces are no longer
763    read$B!>(Bonly.</p>
764    
765    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
766    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
767    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
768    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
769    associated to the attribute.  No normalization, relative reference resolution,
770    or lexical validation is performed. <span class=ed>@@ If the new
771    value is <code>null</code>, ...</span></p>
772    
773    <div class="note memo">
774    <p>Setting an invalid identifier might make the node unserializable.
775    Setting a public identifier while leaveing system identifier unspecified
776    would also make the <a href="#DocumentType"><code>DocumentType</code></a>
777    or <a href="#Entity"><code>Entity</code></a> node unserializable.</p>
778    </div>
779    
780    <div class=ed>
781    <p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p>
782    </div>
783    
784    <p>The <code id=internalSubset>internalSubset</code> attribute of the
785    <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
786    read$B!>(Bonly.</p>
787    
788    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
789    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
790    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
791    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
792    associated to the attribute.  No normalization, or lexical validation is
793    performed. <span class=ed>@@ If the new value is <code>null</code>,
794    ...</span></p>
795    
796  </div>  </div>
797    
798  <div class=section id=section-documenttypedefinition>  <div class=section id=section-documenttypedefinition>
799  <h2>The <code>DocumentTypeDefinition</code> Interface</h2>  <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
800    
801  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {  <p>The <a href="#DocumentType"><code>DocumentType</code></a> nodes
802      <em class=rfc2119>MUST</em> also implement the
803  }</code></pre>  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
804    interface.</p>
805    
806  <pre class=ed>  <p>An instance of the
807  [1] In an implementation that supports the  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
808  [CODE(URI)@en[[[http://suika.fam.cx/www/2006/feature/XDoctype]]]]  interface <em class=rfc2119>MUST</em> be able to be obtained by using
809  feature, a [CODE(DOMi)@en[[[DocumentType]]]] node  binding$B!>(Bspecific casting methods on an instance of the
810  must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]  <a href="#DocumentType"><code>DocumentType</code></a> interface (if such
811  interface.  See [[DOM XML Document Type Definition]>>3] for  casting methods are available) or by using the method <code>getFeature</code>
812  details.  with parameter values
813    <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
814    and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
815  ** Children  <a href="#DocumentType"><code>DocumentType</code></a> node supports the
816    feature <code>Core</code> version <code>3.0</code>
817  [2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]]  <span class=ed>[DOM3]</span>).</p>
818  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface  
819  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that  <div class="note memo">
820  contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]  <p>This interface is a separated interface from the
821  node.  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].  <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
822  The attribute is read-only.  to the <a href="#DocumentType"><code>DocumentType</code></a>,
823    for the historical reason.</p>
 What are contained in this collection depends on how  
 the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created.  If the  
 node was created as the result of parsing of an XML document,  
 it [['''MUST''']]  contain all element types whose element type and / or  
 attribute definition list declaration are encountered by and provided for the DOM  
 implementation from the XML processor.  Note that the XML processor might not  
 provide a part of or entire such information depending on the configuration.  
 If more than one declarations for an element type or an attribute is available  
 at the time of the definition node construction, then declarations other than  
 the first ones [['''MUST''']] be discarded.  
824    
825  The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]  <p class=ed>Should the interface be merged with
826  object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes  <a href="#DocumentType"><code>DocumentType</code></a>?</p>
827  belong to the node.  The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object  </div>
 [['''MUST''']] be read-only if and only if the node is read-only.  
 Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live  
 and therefore any change of read-only flag on the node is immediately  
 reflected by that of the object.  
828    
829  [3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]]  <p>The
830  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface  <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
831  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the  interface <em class=rfc2119>MUST</em> be implemented as following:</p>
832  general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node.  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
833  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].    readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
834  The attribute is read-only.    readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
835      readonly attribute NamedNodeMap <a href="#notations">notations</a>;
836    
837      <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
838        (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
839      <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
840        (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
841      <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
842        (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
843    
844      void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
845        (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
846        raises (DOMException);
847      void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
848        (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
849        raises (DOMException);
850      void <a href="#setNotationNode">setNotationNode</a>
851        (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
852        raises (DOMException);
853    }</code></pre>
854    
855    <dl>
856    <dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of
857    type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
858      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
859      contains all the element type definitions belonging to the
860      <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
861    
862      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
863      <code>NamedNodeMap</code> object that contains all the
864      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
865      nodes belonging to the <code>DocumentType</code> node.  The
866      <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly
867      if and only if the node is read$B!>(Bonly.  The <code>NamedNodeMap</code>
868      object <em class=rfc2119>MUST</em> be <a href="#live">live</a>.</p>
869    
870      <p>If the <code>DocumentType</code> node is created during the process
871      to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following
872      requirements are applied:  The <code>NamedNodeMap</code> object in the
873      <a href="#elementTypes"><code>elementType</code></a> attribute
874      <em class=rfc2119>MUST</em> be so transformed that the object contains
875      the <code>ElementTypeDefinition</code> nodes for the element types
876      whose name is presented as the <code>Name</code> of the element type or
877      attribute definition list declarations processed by the <abbr>XML</abbr>
878      processor.  If there are more than one element type declarations for an
879      element type, then the declarations other than the first one
880      <em class=rfc2119>MUST</em> be ignored for the purpose of constructing the
881      <code>NamedNodeMap</code> object.</p></dd>
882    <dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn>
883    of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
884      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
885      contains all the general entities belonging to the
886      <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
887      
888      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
889      same value as the <code>entities</code> attribute (defined in the
890      <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
891      node.</p>
892    
893      <div class="note memo">
894        <p>This attribute is part of the interface for historical reason.</p>
895      </div></dd>
896    <!--
897  All entities declared in the document type definition  All entities declared in the document type definition
898  contained in or referenced from the document entity  contained in or referenced from the document entity
899  might not be exposed through this collection, depending  might not be exposed through this collection, depending
# Line 479  representing general entities belong to Line 913  representing general entities belong to
913  the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live  the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
914  and therefore any change of read-only flag on the node is immediately  and therefore any change of read-only flag on the node is immediately
915  reflected by that of the object.  reflected by that of the object.
916    -->
917  The attribute [['''MUST''']] return the same value as the  <dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type
918  [CODE(DOMa)@en[[[entites]]]] attribute of the  <code>notations</code>, read$B!>(Bonly</code>
919  [CODE(DOMi)@en[[[DocumentType]]]] interface on the same node.    <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
920      contains all the notations belonging to the
921  [4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]]    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
922  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface    
923  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
924  all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]    same value as the <code>notations</code> attribute (defined in the
925  node.  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].    <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
926  The attribute is read-only.    node.</p>
927    
928      <div class="note memo">
929        <p>This attribute is part of the interface for historical reason.</p>
930        <p>Implementations are not required to implement the
931        <code>notations</code> attribute twice (for
932        <a href="#DocumentType"><code>DocumentType</code></a> and
933        <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
934        interfaces); they share exactly same definition.</p>
935      </div></dd>
936    <!--
937  If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is  If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is
938  created from an XML document, duplicate notation declarations, if any, in DTD  created from an XML document, duplicate notation declarations, if any, in DTD
939  [['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]]  [['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]]
# Line 514  representing notations belong to the nod Line 957  representing notations belong to the nod
957  the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live  the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
958  and therefore any change of read-only flag on the node is immediately  and therefore any change of read-only flag on the node is immediately
959  reflected by that of the object.  reflected by that of the object.
960    -->
961    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
962    method</dt>
963      <dd><p>Returns the
964      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
965      with the specified name.</p>
966    
967      <p>The
968      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
969      parameter is the name of the element type.</p>
970    
971      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
972      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
973      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
974      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
975      <code>NamedNodeMap</code> object in the
976      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
977      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
978      <code>null</code>.</p></dd>
979    <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
980    method</dt>
981      <dd><p>Returns the
982      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
983      with the specified name.</p>
984    
985      <p>The
986      <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
987      parameter is the name of the element type.</p>
988    
989      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
990      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
991      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
992      <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
993      <code>NamedNodeMap</code> object in the
994      <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
995      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
996      <code>null</code>.</p></dd>
997    <dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>,
998    method</dt>
999      <dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node
1000      with the specified name.</p>
1001    
1002  A DOM implementation is not required to implement the    <p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn>
1003  [CODE(DOMa)@en[[[notations]]]] attribute twice    parameter is the name of the general entity.</p>
 for the [CODE(DOMi)@en[[[DocumentType]]]] and  
 the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interfaces;  
 the latter is defined to contain the same value as the former.  
1004    
1005      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1006      <a href="#Entity"><code>Entity</code></a> node,
1007      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1008      <a href="#getEntityNode-name"><var>name</var></a>, in the
1009      <code>NamedNodeMap</code> object in the
1010      <a href="#entities"><code>entities</code></a> attribute of the
1011      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1012      <code>null</code>.</p></dd>
1013    <dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>,
1014    method</dt>
1015      <dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node
1016      with the specified name.</p>
1017    
1018      <p>The
1019      <dfn id=getNotationNode-name class=dom-param><var>name</var></dfn>
1020      parameter is the name of the notation.</p>
1021    
1022      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1023      <a href="#Notation"><code>Notation</code></a> node,
1024      whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1025      <a href="#getNotationNode-name"><var>name</var></a>, in the
1026      <code>NamedNodeMap</code> object in the
1027      <a href="#notations"><code>notations</code></a> attribute of the
1028      node.  If there is no such node, it <em class=rfc2119>MUST</em> return
1029      <code>null</code>.</p></dd>
1030    <dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>,
1031    method</dt>
1032      <dd class=ed>@@</dd>
1033    <dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>,
1034    method</dt>
1035      <dd class=ed>@@</dd>
1036    <dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>,
1037    method</dt>
1038      <dd class=ed>@@</dd>
1039    </dl>
1040    
1041    <div class=ed>
1042    <p>A future version of this interface might define the
1043    <code>parameterEntities</code> and getter/setter for parameter entities.
1044    </div>
1045    
 ** Open Issues (informative)  
   
 [5] A future version of the interface might define the  
 [CODE(DOMa)@en[[[parameterEntities]]]] attribute and  
 getter/setter for parameter entities.  
 </pre>  
1046  </div>  </div>
1047    
1048  <div class=section id=section-elementtypedefinition>  <div class=section id=section-elementtypedefinition>
1049  <h2>The <code>ElementTypeDefinition</code> Interface</h2>  <h3>The <code>ElementTypeDefinition</code> Interface</h3>
1050    
1051  <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> {  <p>The nodes of type
1052      <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
1053    represents an element type definition.  Such a node
1054    <em class=rfc2119>MUST</em> implement the
1055    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1056    interface, which extends the <a href="#Node"><code>Node</code></a>
1057    interface.</p>
1058    
1059    <p>An element type definition represents a definition of the element type.
1060    It is corresponding to the element type declaration in <abbr>DTD</abbr>.
1061    However, an
1062    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1063    does not represent the element type definition in <abbr>DTD</abbr> itself.  
1064    Even if there are more than one element type declarations for an element type
1065    in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1066    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1067    node for that element type.  In addition, if there are attribute definition
1068    declarations for an element type, even when there is no element type
1069    declaration for that element type, the <abbr>DOM</abbr> will contain an
1070    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1071    node for that element type.</p>
1072    
1073    <p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1074    node cannot be a child of any node.  An
1075    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1076    cannot have any child node.</p>
1077    
1078    <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1079    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
1080    <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
1081      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1082    
1083      readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>;
1084      <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a>
1085        (in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>);
1086      void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a>
1087        (in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>)
1088        raises (DOMException);
1089  }</code></pre>  }</code></pre>
1090    
1091  <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members  <dl>
1092    <dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn>
1093    of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt>
1094      <dd><p>The
1095      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
1096      attribute of
1097      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1098      <a href="#Entity"><code>Entity</code></a>, and
1099      <a href="#Notation"><code>Notation</code></a> interface contains the
1100      <a href="#DocumentType"><code>DocumentType</code></a> node to which the node
1101      is attached.</p>
1102    
1103      <p>On getting, the attribute <em class=rfc2119>MUST</em> return a
1104      <a href="#DocumentType"><code>DocumentType</code></a> node.  It
1105      <em class=rfc2119>MUST</em> be such a node that whose
1106      <a href="#elementTypes"><code>elementTypes</code></a> (for an
1107      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1108      node), <a href="#entities"><code>entities</code></a> (for an
1109      <a href="#Entity"><code>Entity</code></a> node), or
1110      <a href="#notations"><code>notations</code></a> (for a
1111      <a href="#Notation"><code>Notation</code></a> node) attribute contains the
1112      <code>NamedNodeMap</code> object that contains the node.  If there is no such
1113      a <a href="#DocumentType"><code>DocumentType</code></a> node,
1114      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd>
1115    <dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn>
1116    of type NamedNodeMap, read$B!>(Bonly</dt>
1117      <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
1118      contains all the attribute definitions belonging to the
1119      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1120      node.</p>
1121    
1122      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1123      <code>NamedNodeMap</code> object that contains all the
1124      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1125      belonging to the
1126      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1127      The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1128      read$B!>(Bonly if and only if the node is read$B!>(Bonly.  The
1129      <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1130      <a href="#live">live</a>.</p>
1131      
1132      <p>If the
1133      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1134      is created during the process to create a <abbr>DOM</abbr> from an
1135      <abbr>XML</abbr> document, the following requirements are applied:  The
1136      <code>NamedNodeMap</code> object in the
1137      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1138      attribute <em class=rfc2119>MUST</em> be so transformed that the object
1139      contains the
1140      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1141      corresponding to the attribute definitions in the attribute definition
1142      list declarations processed by the <abbr>XML</abbr> processor and
1143      associated to the element type represented by the node.  If there are more
1144      than one attribute definitions for an attribute, then the definitions other
1145      than the first one <em class=rfc2119>MUST</em> be ignored for the purpose
1146      of constructing the <code>NamedNodeMap</code> object.</p></dd>
1147    <dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>,
1148    method</dt>
1149      <dd><p>Return the
1150      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1151      with the specified name.</p>
1152    
1153      <p>The
1154      <dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn>
1155      parameter is the name of the attribute.</p>
1156    
1157      <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1158      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
1159      whose <a href="#nodeName"><code>nodeName</code></a> attribute value is
1160      equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>,
1161      in the <code>NamedNodeMap</code> in the
1162      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1163      attribute of the node.  If there is no such node, it
1164      <em class=rfc2119>MUST</em> return <code>null</code>.</p></dd>
1165    <dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>,
1166    method</dt>
1167      <dd class=ed>@@</dd>
1168    </dl>
1169    
1170  [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute  <div class=ed>
1171  of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  <p>A future version of the specification might define a set of attributes
1172  [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  and methods for representing and accessing to the content model of the
1173    element type.</p>
1174  [4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute  </div>
 of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  
 [['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]]  
 of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the  
 [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object.  
 Note that it might be [CODE(IDL)@en[[[null]]]].  
   
 [1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute  
 of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  
 [['''MUST''']] return the name of the element type.  
   
 [2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]]  
 and [CODE(DOMa)@en[[[textContent]]]] attributes  
 of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]]  
 object [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  
   
 ;; Thus, the setter of these attributes do nothing.  
   
 The setter of the [CODE(DOMa)@en[[[textContent]]]]  
 attribute of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]]  
 object [['''MUST NOT''']] throw a  
 [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]].  
   
 ** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface  
   
 [5] The  
 [DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]]  
 of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]]  
 interface is defined in [[manakai//DOM Extensions]>>50].</pre>  
1175  </div>  </div>
1176    
1177  <div class=section id=section-attributedefinition>  <div class=section id=section-attributedefinition>
1178  <h2>The <code>AttributeDefinition</code> Interface</h2>  <h3>The <code>AttributeDefinition</code> Interface</h3>
1179    
1180  <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> {  <p>The nodes of type
1181    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
1182    represents an attribute definition.  Such a node
1183    <em class=rfc2119>MUST</em> implement the
1184    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
1185    which extends the <a href="#Node"><code>Node</code></a> interface.</p>
1186    
1187    <p>An attribute definition represents a definition of the attribute
1188    associated to an element type.  It is corresponding to the attribute definition
1189    in the attribute list declaration in <abbr>DTD</abbr>.  However, an
1190    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
1191    not represent the attribute definition in <abbr>DTD</abbr> itself.  Even if
1192    there are more than one attribute definitions for an attribute of an element
1193    type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1194    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
1195    that attribute.</p>
1196    
1197    <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1198    node cannot be a child of any node.  An
1199    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1200    can have zero or more child nodes of same kinds as those allowed for
1201    <code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p>
1202    
1203    <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1204    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
1205    <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
1206      <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
1207      const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
1208      const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1;
1209      const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2;
1210      const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3;
1211      const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4;
1212      const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5;
1213      const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6;
1214      const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7;
1215      const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8;
1216      const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
1217      const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
1218      const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
1219    
1220      <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
1221      const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
1222      const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
1223      const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
1224      const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
1225      const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
1226        
1227  }</code></pre>    readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
1228    
1229  <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members    readonly attribute unsigned short <a href="#declaredType">declaredType</a>;
1230      readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>;
1231      readonly attribute unsigned short <a href="#defaultType">defaultType</a>;
1232    }</code></pre>
1233    
1234  [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute  <dl>
1235  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
1236  [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  of type
1237    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1238  [9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute  read$B!>(Bonly</dt>
1239  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    <dd><p>The
1240  [['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]]    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
1241  of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the    which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1242  [CODE(DOMi)@en[[[AttributeDefinition]]]] object.    node belongs.</p>
1243  Note that it might be [CODE(IDL)@en[[[null]]]].  
1244      <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
1245  [1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1246  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    It <em class=rfc2119>MUST</em> be such a node that whose
1247  [['''MUST''']] return the name of the attribute.    <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
1248      attribute contains the <code>NamedNodeMap</code> object that contains
1249  [2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute    the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1250  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    node.  If there is no such an
1251  [['''MUST''']] return the normalized default value    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1252  of the attribute.    then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
1253    <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
1254  @@  <code>unsigned short</code></dt>
1255      <dd><p>The declared type <span class=ed>@@ ref</span> of the attribute.
1256  [4] The getter of the [CODE(DOMa)@en[[[textContent]]]]    It is expected that this attribute contains a value from the definition group
1257  attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]]    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
1258  object [['''MUST''']] behave as if it were an  
1259  [CODE(DOMi)@en[[[Attr]]]] object.    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1260      value associated to this attribute.</p>
1261  The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute  
1262  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1263  [['''MUST''']] behave as if the following algorithm    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1264  is performed:    exception if the
1265  = If the [CODE(DOMi)@en[[[AttributeDefinition]]]]    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1266  object is read-only, then throw an    is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
1267  [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]].    <em class=rfc2119>MUST</em> set the specified value as the value
1268  = Remove any child node the node has.    associated to this attribute.</p>
1269  = If the new value is not empty and not [CODE(IDL)@en[[[null]]]],  
1270  then create a [CODE(DOMi)@en[[[Text]]]] node    <p>If the <code>AttributeDefinition</code> node is created during the process
1271  whose [CODE(DOMa)@en[[[data]]]] is the new value    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
1272  and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]].    appropriate value from the
1273      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
1274  ** Definition groups    group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1275    
1276  [6] The    <!-- DeclaredValueType -->
1277  [DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]]  <p>The definition group
1278  contains integers indicating the type of  <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
1279  attribute value:  integers indicating the declared type of attributes.  The definition
1280  ,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set.  group contains the following constants:</p>
1281  ,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]].  
1282  ,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]].  <table>
1283  ,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]].  <thead>
1284  ,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]].  <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1285  ,[CODE(DOMc)@en[[[ENTITY_ATTR]]]],[CODE(IDL)[[[5]]]],The attribute value type is [CODE(XML)@en[[[ENTITY]]]].  </thead>
1286  ,[CODE(DOMc)@en[[[ENTITIES_ATTR]]]],[CODE(IDL)[[[6]]]],The attribute value type is [CODE(XML)@en[[[ENTITIES]]]].  <tbody>
1287  ,[CODE(DOMc)@en[[[NMTOKEN_ATTR]]]],[CODE(IDL)[[[7]]]],The attribute value type is [CODE(XML)@en[[[NMTOKEN]]]].  <tr>
1288  ,[CODE(DOMc)@en[[[NMTOKENS_ATTR]]]],[CODE(IDL)[[[8]]]],The attribute value type is [CODE(XML)@en[[[NMTOKENS]]]].  <th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code>
1289  ,[CODE(DOMc)@en[[[NOTATION_ATTR]]]],[CODE(IDL)[[[9]]]],The attribute value type is [CODE(XML)@en[[[NOTATION]]]].  <td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr>
1290  ,[CODE(DOMc)@en[[[ENUMERATION_ATTR]]]],[CODE(IDL)[[[10]]]],The attribute value is enumeration type.  <tr>
1291  ,[CODE(DOMc)@en[[[UNKNOWN_ATTR]]]],[CODE(IDL)[[[11]]]],"The attribute value type is unknown, because no declaration for the attribute has been read but not [CODE(InfoProp)@en[[[all declarations processed]]]] property would be false."  <th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code>
1292    <td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr>
1293  The type of these constants are  <tr>
1294  [CODE(IDL)@en[[[unsigned]] [[short]]]].  <th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code>
1295    <td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr>
1296  If no attribute type information is provided,  <tr>
1297  or if the source of that information does not  <th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code>
1298  distinguish [[no value]] and [[unknown]] as in  <td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr>
1299  XML Information Set, then the  <tr>
1300  [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] value  <th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code>
1301  [['''MUST''']] be used.  <td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr>
1302    <tr>
1303  ;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]]  <th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code>
1304  object by [CODE(DOMm)@en[[[createAttributeDefinition]]]]  <td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr>
1305  method has [CODE(DOMa)@en[[[declaredType]]]] attribute  <tr>
1306  set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].  <th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code>
1307    <td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr>
1308  If the source of the attribute type information  <tr>
1309  does not distinguish [[no value]] and / or [[unknown]]  <th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code>
1310  and [CODE(XML)@en[[[CDATA]]]], then the  <td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr>
1311  [CODE(DOMc)@en[[[CDATA_ATTR]]]] value [['''MUST''']]  <tr>
1312  be used.  <th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code>
1313    <td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr>
1314  [11]  <tr>
1315  In Perl binding, the objects implementing the  <th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code>
1316  [CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']]  <td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr>
1317  also implement the [CODE(DOM)@en[[[DeclaredValueType]]]]  <tr>
1318  constant group.  <th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code>
1319    <td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr>
1320  [7] The  <tr>
1321  [DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]]  <th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code>
1322  contains integers indicating the type of  <td><code>11</code><td>Unknown, because no declaration for the attribute
1323  default attribute value:  has been read but the [all declaration processed] property
1324  ,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown.  <span class=ed>[INFOSET]</span> would be false.</tr>
1325  ,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value.  </tbody>
1326  ,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute.  </table>
1327  ,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]].  
1328  ,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it.  <p>If no attribute type information is available, or if the source
1329    of the information does not distinguish <q>no value</q> and <q>unknown</q>
1330  The type of these constants are  <span class=ed>[INFOSET]</span>, then the value
1331  [CODE(IDL)@en[[[unsigned]] [[short]]]].  <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>
1332    <em class=rfc2119>MUST</em> be used.</p>
1333  If the source of the attribute default value type  
1334  does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]]  <div class="note memo">
1335  default and unknown default, then the  <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1336  [CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value  created by the
1337  [['''MUST''']] be used.  <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1338    method has its <a href="#declaredType"><code>declaredType</code></a> attribute
1339  ;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]]  set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p>
 object by [CODE(DOMm)@en[[[createAttributeDefinition]]]]  
 method has [CODE(DOMa)@en[[[declaredType]]]] attribute  
 set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].  
   
 ** Tree-relationship Attributes  
   
 [10]  
 The  
 [DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]]  
 of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface  
 is read-only and of type  
 [CODE(DOMi)@en[[[ElementTypeDefinition]]]].  
 It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node  
 which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node  
 belong to.  
   
 If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node  
 is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]]  
 list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node,  
 then the attribute [['''MUST''']] return the  
 [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node.  
 Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]].  
   
 ;; This attribute is analogue to the  
 [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute  
 for [CODE(DOMi)@en[[[ElementTypeDefinition]]]],  
 [CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]]  
 nodes, or the [CODE(DOMa)@en[[[ownerElement]]]]  
 attribute for [CODE(DOMi)@en[[[Attr]]]] nodes.  
   
 ** Attributes  
   
 [5]  
 The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]]  
 of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  
 represents the type of the attribute value.  
   
 This attribute is read-write.  
 The type of the attribute is  
 [CODE(IDL)@en[[[unsigned]] [[short]]]].  It is expected  
 that this attribute has a value from the definition group  
 [CODE(DOM)@en[[[DeclaredValueType]]]].  
   
 The getter [['''MUST''']] return a value associated  
 to this attribute.  
   
 The setter [['''MUST''']]  
 throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]  
 [CODE(DOMi)@en[[[DOMException]]]] if the  
 [CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only.  
 Otherwise, the setter [['''MUST''']] set the specified  
 value as the value associated to this attribute.  
   
 If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]]  
 object, then it [['''MUST''']] set a value  
 from the [CODE(DOM)@en[[[DeclaredValueType]]]]  
 definition group.  
   
 [8]  
 The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]]  
 of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  
 represents the type of the attribute default value.  
   
 This attribute is read-write.  
 The type of the attribute is  
 [CODE(IDL)@en[[[unsigned]] [[short]]]].  It is expected  
 that this attribute has a value from the definition group  
 [CODE(DOM)@en[[[DefaultValueType]]]].  
   
 The getter [['''MUST''']] return a value associated  
 to this attribute.  
   
 The setter [['''MUST''']]  
 throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]  
 [CODE(DOMi)@en[[[DOMException]]]] if the  
 [CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only.  
 Otherwise, the setter [['''MUST''']] set the specified  
 value as the value associated to this attribute.  
   
 If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]]  
 object, then it [['''MUST''']] set a value  
 from the [CODE(DOM)@en[[[DefaultValueType]]]]  
 definition group.</pre>  
1340  </div>  </div>
1341    
1342    <p>If the source of the information does not distinguish <q>no value</q>
1343    and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and
1344    <code>CDATA</code> <span class=ed>[XML]</span>, then the value
1345    <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
1346    be used.</p>
1347    
1348    <p>In Perl binding <span class=ed>[PERLBINDING]</span>, the
1349    <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1350    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1351    definition group.</p>
1352    
1353      </dd>
1354    <dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of
1355    type <code>DOMStringList</code>, read$B!>(Bonly</dt>
1356      <dd><p>The list of allowed attribute values.</p>
1357    
1358      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1359      <code>DOMStringList</code> object associated to this attribute.  The object
1360      <em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of
1361      zero or more characters respectively, possibly with duplications.  The
1362      object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node
1363      is read$B!>(Bonly.</p>
1364    
1365      <p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1366      node is created during the process to create a <abbr>DOM</abbr> from an
1367      <abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain
1368      the names or name tokens allowed for the attribute defined by the node.
1369      If the document is well$B!>(Bformed, the object will be empty unless
1370      the <a href="#declaredType"><code>declaredType</code></a> is
1371      <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1372      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p>
1373    
1374      <p>If the <a href="#declaredType"><code>declaredType</code></a> is different
1375      from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1376      <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute
1377      <em class=rfc2119>MUST</em> be ignored for the purpose of serializing
1378      into (part of) <abbr>XML</abbr> document.</p>
1379    
1380      <div class="note memo">
1381        <p>When serializing the node it should be noted that the object might
1382        be empty, might contain duplications, and might contain strings that are
1383        not names or name tokens.</p>
1384      </div></dd>
1385    <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1386    type <code>unsigned short</code></dt>
1387      <dd><p>The type of the default for the attribute.  It is expected that this
1388      attribute contains a value from the definition group
1389      <a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p>
1390    
1391      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1392      the value associated to this attribute.</p>
1393    
1394      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1395      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1396      exception if the
1397      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1398      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
1399      <em class=rfc2119>MUST</em> set the specified value as the value
1400      associated to this attribute.</p>
1401    
1402      <p>If the
1403      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1404      created during the process to create a <abbr>DOM</abbr> from an
1405      <abbr>XML</abbr> document, an appropriate value from the
1406      <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1407      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1408    
1409      <!-- DefaultValueType -->
1410      <p>The definition group
1411      <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1412      contains integers indicating the type of the default for the attribute.
1413      The definition group contains the following constans:</p>
1414    
1415      <table>
1416      <thead>
1417      <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1418      </thead>
1419      <tbody>
1420      <tr>
1421      <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1422      <td><code>0</code><td>Unknown.</tr>
1423      <tr>
1424      <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1425      <td><code>1</code><td>Provided explicitly and fixed
1426      <span class=ed>@@ ref</span> to that value.</tr>
1427      <tr>
1428      <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1429      <td><code>2</code><td>No default value and the attribute have to be
1430      explicitly specified.</tr>
1431      <tr>
1432      <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1433      <td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr>
1434      <tr>
1435      <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1436      <td><code>4</code><td>Provided explicitly.</tr>
1437      </tbody>
1438      </table>
1439    
1440      <p>If the source of the default type does not distinguish
1441      implied and unknown default types, then the value
1442      <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1443      <em class=rfc2119>MUST</em> be used.</p>
1444    
1445      <div class="note memo">
1446      <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1447      node created by the
1448      <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1449      method has its <a href="#defaultType"><code>defaultType</code></a>
1450      attribute set to
1451      <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1452      </div></dd>
1453    </dl>
1454    
1455  </div>  </div>
1456    
1457    <div class=section id=section-entity>
1458    <h3>Modifications to the <code id=Entity>Entity</code> Interface</h3>
1459    
1460    <p>The implementation of the <a href="#Entity"><code>Entity</code></a>
1461    interface <em class=rfc2119>MUST</em> be modified as following:</p>
1462    <pre class=idl><code>// Modifications to the Entity interface
1463      attribute DOMString <a href="#publicId">publicId</a>;
1464      attribute DOMString <a href="#systemId">systemId</a>;
1465      attribute DOMString <a href="#notationName">notationName</a>;
1466    
1467      // Additions to the Entity interface
1468      attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>;
1469      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1470    
1471      attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>;
1472    </code></pre>
1473    
1474    <p>The <code id=notationName>notationName</code> attribute of the
1475    <a href="#Entity"><code>Entity</code></a> interface is no longer
1476    read$B!>(Bonly.</p>
1477    
1478    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1479    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1480    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.
1481    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
1482    associated to the attribute.  No lexical validation is performed.  The new
1483    value <em class=rfc2119>MAY</em> be <code>null</code>.</p>
1484    
1485    <dl>
1486    <dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn>
1487    of type boolean</dt>
1488      <dd><p>Whether the structure of the replacement text of the entity
1489      is available via the <code>NodeList</code> object in the
1490      <code>childNodes</code> attribute of the entity.</p>
1491    
1492      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1493      the value associated to this attribute.</p>
1494    
1495      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1496      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1497      exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
1498      Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the
1499      value associated to this attribute.</p>
1500    
1501      <div class="note memo">
1502      <p>The attribute can be set to <code>false</code> even if the
1503      <a href="#Entity"><code>Entity</code></a> node has any child node.
1504      If the attribute is set to <code>false</code>, then any child node of
1505      the <a href="#Entity"><code>Entity</code></a> node ought to be ignored,
1506      say, for the purpose of serialization.</p>
1507      </div>
1508    
1509      <p>When an <code>EntityReference</code> node is created by cloning
1510      the replacement subtree of the <a href="#Entity"><code>Entity</code></a>
1511      node, if the attribute is set to <code>false</code>, then any descendant
1512      of the node <em class=rfc2119>MUST</em> be ignored.</p>
1513    
1514      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1515      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1516      the following requirements are applied:  If the entity is an unparsed
1517      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1518      <code>false</code>.  Otherwise, if the entity is an external entity whose
1519      replacement text is not available, or whose replacement text is not converted
1520      to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set
1521      to <code>false</code>.  Otherwise, the attribute
1522      <em class=rfc2119>MUST</em> be set to <code>true</code>.</p>
1523    
1524      <div class="note memo">
1525      <p>An <a href="#Entity"><code>Entity</code></a> node created by the
1526      <a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method
1527      has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a>
1528      attribute set to <code>false</code>.</p>
1529      </div></dd>
1530    <dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn>
1531    of type boolean</dt>
1532      <dd><p>Whether the entity is declared by an external entity declaration or
1533      not.  If the value is <code>true</code>, the entity is declared in an entity
1534      declaration in the external subset entity or in an external parameter entity.
1535      If the value is <code>false</code>, the entity is declared in an entity
1536      declaration in the internal subset, or the node is created in memory.</p>
1537    
1538      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1539      the value associated to this attribute.</p>
1540    
1541      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1542      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1543      exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
1544      Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the
1545      value associated to this attribute.</p>
1546    
1547      <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1548      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1549      the following requirements are applied:  If the entity is an unparsed
1550      entity, then the attribute <em class=rfc2119>MUST</em> be set to
1551      <code>false</code>.  Otherwise, i.e. the entity is a parsed entity, then the
1552      attribute <em class=rfc2119>MUST</em> be set to the value of whether the
1553      entity is declared by an external markup declaration or not.</p></dd>
1554    </dl>
1555    </div>
1556    
1557    <div class=section id=section-notation>
1558    <h3>Modifications to the <code id=Notation>Notation</code> Interface</h3>
1559    
1560    <p>The implementation of the <a href="#Notation"><code>Notation</code></a>
1561    interface <em class=rfc2119>MUST</em> be modified as following:</p>
1562    <pre class=idl><code>// Modifications to the Notation interface
1563      attribute DOMString <a href="#publicId">publicId</a>;
1564      attribute DOMString <a href="#systemId">systemId</a>;
1565    
1566      // Addition to the Notation interface
1567      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1568    </code></pre>
1569    </div>
1570    
1571    </div>
1572    
1573  <div id="references" class="section reference">  <div id="references" class="section reference">
1574  <h2>References</h2>  <h2>References</h2>

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.22

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24