/[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.4 by wakaba, Sun Dec 2 05:00:26 2007 UTC revision 1.19 by wakaba, Wed Dec 5 07:38:14 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-05>5 December 2007</time></h2>
14    
15  <dl class="versions-uri">  <dl class="versions-uri">
16  <dt>This Version</dt>  <dt>This Version</dt>
# Line 125  raised is undefined.</p> Line 125  raised is undefined.</p>
125  interface.</p>  interface.</p>
126    
127  <p class=ed>@@ ref to DOM Binding Spec</p>  <p class=ed>@@ ref to DOM Binding Spec</p>
128    
129    <p>If the <code>strictErrorChecking</code> attribute of the
130    <code>Document</code> node is <code>false</code>, the methods are
131    not required to raise exceptions <span class=ed>[DOM3]</span>.</p>
132    
133    <div class=ed>
134    <p>Conformant product classes: implementation, XML parser (XML document ->
135    DOM converter), XML serializer (DOM -> XML document covnerter).
136    XML Infoset -> DOM converter, and DOM -> XML Infoset converter.</p>
137    </div>
138  </div>  </div>
139    
140  <div class=section id=dom-dtdef>  <div class=section id=dom-dtdef>
# Line 139  consists of three interfaces:</p> Line 149  consists of three interfaces:</p>
149  <li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li>  <li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li>
150  </ul>  </ul>
151    
152  <p>In addition, it adds methods, attributes, and/or constants to interfaces  <p>In addition, it modifies interfaces
153  <a href="#Node"><code>Node</code></a>,  <a href="#Node"><code>Node</code></a>,
154    <a href="#DocumentType"><code>DocumentType</code></a>,
155  <a href="#Entity"><code>Entity</code></a>,  <a href="#Entity"><code>Entity</code></a>,
156  <a href="#EntityReference"><code>EntityReference</code></a>, and  <a href="#EntityReference"><code>EntityReference</code></a>,
157  <a href="#Notation"><code>Notation</code></a>.  <a href="#Notation"><code>Notation</code></a>, and
158  It modifies semantics of some of methods and attributes in  <a href="#ProcessingInstruction"><code>ProcessingInstruction</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>  
159    
160  <div class=section id=features>  <div class=section id=features>
161  <h3>Feature Name</h3>  <h3>Feature Name</h3>
# Line 156  interfaces, for the support of new inter Line 164  interfaces, for the support of new inter
164  the <abbr>DOM</abbr> Document Type Definition module, the  the <abbr>DOM</abbr> Document Type Definition module, the
165  <code>hasFeature</code> method of a <code>DOMImplementation</code> object  <code>hasFeature</code> method of a <code>DOMImplementation</code> object
166  <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
167  set to <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and  set to
168  <code>3.0</code> respectively.</p>  <dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn>
169    and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively.</p>
170    
171  <p>In such an implementation, the <code>getFeature</code> method of a  <p>In such an implementation, the <code>getFeature</code> method of a
172  <code>Document</code> object <em class=rfc2119>MUST</em> return the (at least  <code>Document</code> object <em class=rfc2119>MUST</em> return the (at least
173  conceptually) same object implementing the  conceptually) same object implementing the
174  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when  <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when
175  the parameters are set to  the parameters are set to
176  <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and  <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
177  <code>3.0</code> respectively.  Likewise, any method that takes one or more  and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively.  
178  feature names with or without version number, including the methods  Likewise, any method that takes one or more feature names with or without
179  <code>hasFeature</code> and <code>getFeature</code>,  version number, including the methods <code>hasFeature</code> and
180  <em class=rfc2119>MUST</em> behave in a manner consistent with the  <code>getFeature</code>, <em class=rfc2119>MUST</em> behave in a manner
181  aforementioned cases.</p>  consistent with the aforementioned cases.</p>
182    </div>
183    
184    <div class=section id=section-node>
185    <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
186    
187    <p>The implementation of the
188    <a href="#Node"><code>Node</code></a> interface
189    <em class=rfc2119>MUST</em> be modified as following:</p>
190    <pre class=idl><code>// Additions to the Node interface
191    
192    // Additions to the NodeType definition group
193    const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
194    const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
195    </pre>
196    
197    <p>This specification adds two new types (subinterfaces) of
198    <a href="#Node"><code>Node</code></a>: element type definition (node type
199    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
200    interface
201    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
202    attribute definition (node type
203    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
204    interface
205    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).  For
206    these kinds of nodes, methods and attributes in the
207    <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
208    
209    <dl>
210    <dt><code id=attributes>attributes</code></dt>
211      <dd>
212        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
213        <code>null</code>.</p>
214      </dd>
215    <dt><code id=baseURI>baseURI</code></dt>
216      <dd>
217        <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
218        value of the <a href="#baseURI"><code>baseURI</code></a> attribute
219        of the node in the <code>ownerDocument</code> attribute of the node.
220        Note that the value might be <code>null</code>.</p>
221      </dd>
222    <dt><code id=isEqualNode>isEqualNode</code></dt>
223      <dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method,
224      following items are added to the list of conditions for equality:</p>
225    
226      <ul>
227      <li>
228        <p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a>
229        and at least one of them has the support for the feature
230        <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p>
231        <ul>
232        <li>they are equal according to <abbr>DOM</abbr> level 3 definition
233        <span class=ed>@@ ref</span>, and
234        <li>either:
235          <ul><!--
236          <li>both of them does not support the feature
237          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>-->
238          <li>exactly one of them support the feature
239          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
240          and the <code>length</code> attribute of the <code>NamedNodeMap</code>
241          object in the <a href="#elementTypes"><code>elementTypes</code></a>
242          attribute of it is equal to <code>0</code>, or</li>
243          <li>both of them support the feature
244          <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
245          and the values of the
246          <a href="#elementTypes"><code>elementTypes</code></a> attributes are
247          equal (equality of the
248          <a href="#elementTypes"><code>elementTypes</code></a> attribute is same
249          as that for the <code>attributes</code> attribute).</li>
250          </ul>
251        </li>
252        </ul>
253      </li>
254    
255      <li><p>If the nodes are
256      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
257      the values of the
258      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
259      attributes are equal (equality of the
260      <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
261      attribute is same as that for the <code>attributes</code> attribute).</p></li>
262    
263      <li><p>If the nodes are
264      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
265      the values of the <a href="#declaredType"><code>declaredType</code></a> and
266      the <a href="#defaultType"><code>defaultType</code></a> attributes are
267      equal respectively.</p></li>
268    
269      <li><p>If the nodes are
270      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
271      the values of the <code>DOMStringList</code> objects in the
272      <a href="#allowedTokens"><code>allowedTokens</code></a> attributes
273      are equal, i.e. their <code>length</code> attribute values are equal and
274      each string exists in a list is contained in another list (their indeces
275      may be different), with an additional constraint that the number of the
276      items that are equal to a string in a list is equal to the number
277      of the items equal to the string in another list.</p></li>
278      </ul></dd>
279    <dt><code id=nodeName>nodeName</code></dt>
280      <dd>
281        <p>If the node is an
282        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
283        On getting, the attribute <em class=rfc2119>MUST</em> return the
284        name of the element type definition represented by the node.</p>
285    
286        <p>If the node is an
287        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
288        On getting, the attribute <em class=rfc2119>MUST</em> return the
289        name of the attribute definition represented by the node.</p>
290      </dd>
291    <dt><code id=nodeType>nodeType</code></dt>
292      <dd>
293        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
294        <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
295        (if the node is an
296        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
297        <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
298        (if the node is an
299        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
300    
301        <!-- NodeType -->
302    <p>Two constants are added to the <code id=NodeType>NodeType</code>
303    definition group of the <a href="#Node"><code>Node</code></a> interface as
304    following:</p>
305    <table>
306    <thead>
307    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
308    </thead>
309    <tbody>
310    <tr>
311    <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
312    <td><code>81001</code><td>The node is an
313    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
314    <tr>
315    <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
316    <td><code>81002</code><td>The node is an
317    <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
318    </tbody>
319    </table>
320      </dd>
321    <dt><code id=nodeValue>nodeValue</code> and
322    <code id=textContent>textContent</code></dt>
323      <dd>
324        <p>If the node is an
325        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
326        On getting, the attributes <em class=rfc2119>MUST</em> return the
327        name of the element type.</p>
328    
329        <div class="note memo">
330          <p>Thus, on setting the attributes does nothing
331          <span class=ed>[DOM3]</span>.</p>
332        </div>
333    
334        <p>On setting, the <a href="#textContent"><code>textContent</code></a>
335        attribute <em class=rfc2119>MUST NOT</em> raise a
336        <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>.
337        <span class=ed>@@ I forgot why this requirement is necessary.</span></p>
338    
339        <p>If the node is an
340        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p>
341    
342        <pre class=ed>
343    The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute
344    of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object
345    [['''MUST''']] return the normalized default value
346    of the attribute.
347    
348    @@
349    
350    [4] The getter of the [CODE(DOMa)@en[[[textContent]]]]
351    attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]]
352    object [['''MUST''']] behave as if it were an
353    [CODE(DOMi)@en[[[Attr]]]] object.
354    
355    The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute
356    of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object
357    [['''MUST''']] behave as if the following algorithm
358    is performed:
359    = If the [CODE(DOMi)@en[[[AttributeDefinition]]]]
360    object is read-only, then throw an
361    [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]].
362    = Remove any child node the node has.
363    = If the new value is not empty and not [CODE(IDL)@en[[[null]]]],
364    then create a [CODE(DOMi)@en[[[Text]]]] node
365    whose [CODE(DOMa)@en[[[data]]]] is the new value
366    and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]].
367    </pre>
368      </dd>
369    <dt class=ed>@@ ...</dt>
370    </dl>
371    
372  </div>  </div>
373    
374  <div class=section id=section-documentxdoctype>  <div class=section id=section-documentxdoctype>
375  <h2>The <code>DocumentXDoctype</code> Interface</h2>  <h3>The <code>DocumentXDoctype</code> Interface</h3>
376    
377    <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
378    <em class=rfc2119>MUST</em> be implemented as following:</p>
379  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
380        DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
381        (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
382        raises (DOMException);
383      <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
384        (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
385        raises (DOMException);
386      <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
387        (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
388        raises (DOMException);
389      <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
390        (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
391        raises (DOMException);
392      <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
393        (in DOMString <a href="#createNotation-name"><var>name</var></a>)
394        raises (DOMException);
395  }</code></pre>  }</code></pre>
396    
397  <pre class=ed>  <div class=ed>@@ cast definition</div>
 * The [CODE(DOMi)@en[DocumentXDoctype]] Interface Specification  
398    
399  [1] [[manakai//DOM Extensions]] > New Interfaces >  <dl>
400  [[DOM XML Document Type Definition]] module >  <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,
401  The [CODE(DOMi)@en[[[DocumentXDoctype]]]] Interface  method</dt>
402      <dd>
403  [2]      <p>This method creates a <code>DocumentType</code> node with the specified
404  @@ cast      name, belonging to the document.</p>
405        <p>The <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn>
406  ** Constructors      parameter is the name of the document type.</p>
407    
408  [3] The      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
409  [DFN@en[[CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] method]]      return a <code>DocumentType</code> node with the following attributes:</p>
410  returns a [CODE(DOMi)@en[[[DocumentType]]]] node      <dl>
411  or raises a [CODE(DOMi)@en[[[DOMException]]]].      <dt><code>attributes</code>, <code>parentNode</code></dt>
412  It creates a [CODE(DOMi)@en[[[DocumentType]]]] node        <dd><code>null</code>.</dd>
413  of the given name, belonging to the document.      <dt><code>elementTypes</code>, <code>generalEntities</code>, and
414        <code>notations</code></dt>
415  [3] The        <dd>Empty <code>NamedNodeMap</code> objects.</dd>
416  [DFN@en[[CODE(DOMm)@en[[[createElementTypeDefinition]]]] method]]      <dt><code>entities</code></dt>
417  returns an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node        <dd>The same value as the <code>generalEntities</code> attribute.</dd>
418  or raises a [CODE(DOMi)@en[[[DOMException]]]].      <dt><code>childNodes</code></dt>
419  It creates an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node        <dd>An empty <code>NodeList</code> object.</dd>
420  of the given name, belonging to the document.      <dt><code>internalSubset</code>, <code>publicId</code>, and
421        <code>systemId</code></dt>
422  [4] The        <dd>Empty strings.</dd>
423  [DFN@en[[CODE(DOMm)@en[[[createAttributeDefinition]]]] method]]      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
424  returns an [CODE(DOMi)@en[[[AttributeDefinition]]]] node        <dd><code>false</code>.</dd>
425  or raises a [CODE(DOMi)@en[[[DOMException]]]].      <dt><code>nodeName</code></dt>
426  It creates an [CODE(DOMi)@en[[[AttributeDefinition]]]] node        <dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd>
427  of the given name, belonging to the document.      <dt><code>ownerDocument</code></dt>
428          <dd>The <code>Document</code> over which the method is invoked.</dd>
429  [10] The      </dl>
430  [DFN@en[[CODE(DOMm)@en[[[createGeneralEntity]]]] method]]      <p>In addition, the method <em class=rfc2119>MUST</em> be marked as
431  returns an [CODE(DOMi)@en[[[Entity]]]] node      containing five general entity declarations: <code>amp</code>,
432  or raises a [CODE(DOMi)@en[[[DOMException]]]].      <code>lt</code>, <code>gt</code>, <code>quot</code>, and
433  It creates an [CODE(DOMi)@en[[[Entity]]]] node,      <code>apos</code>.</p>
434  which represents a general entity,    </dd>
435  of the given name, belonging to the document.  <dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>,
436    method</dt>
437  [12] The    <dd>
438  [DFN@en[[CODE(DOMm)@en[[[createNotation]]]] method]]      <p>This method creates a <code>ElementTypeDefinition</code> node with the
439  returns a [CODE(DOMi)@en[[[Notation]]]] node      specified name, belonging to the document.</p>
440  or raises a [CODE(DOMi)@en[[[DOMException]]]].      <p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn>
441  It creates a [CODE(DOMi)@en[[[Notation]]]] node      parameter is the name of the element type defined by the element
442  of the given name, belonging to the document.      type definition.</p>
443    
444  [5]      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
445  These method take a parameter [CODE(DOMp)@en[[[name]]]],      return an
446  of type [CODE(DOMi)@en[[[DOMString]]]].  It is      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
447  the document type name, element type name,      node with the following attributes:</p>
448  or attribute name of the node to be created.      <dl>
449        <dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt>
450  [6]        <dd>An empty <code>NamedNodeMap</code> object.</dd>
451  The [CODE(DOMm)@en[[[createDocumentTypeDefinition]]]]      <dt><code>attributes</code>, <code>parentNode</code></dt>
452  method [['''MUST''']] create a [CODE(DOMi)@en[[[DocumentType]]]]        <dd><code>null</code>.</dd>
453  object with the following attribute values:      <dt><code>childNodes</code></dt>
454  - [CODE(DOMa)@en[[[attributes]]]],        <dd>An empty <code>NodeList</code> object.</dd>
455  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
456  - [CODE(DOMa)@en[[[elementTypes]]]],        <dd><code>false</code>.</dd>
457  [CODE(DOMa)@en[[[generalEntities]]]],      <dt><code>nodeName</code></dt>
458  [CODE(DOMa)@en[[[notations]]]]: Empty        <dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd>
459  [CODE(DOMi)@en[[[NamedNodeMap]]]]s.      <dt><code>ownerDocument</code></dt>
460  - [CODE(DOMa)@en[[[childNodes]]]]: An empty        <dd>The <code>Document</code> node over which the method is invoked.</dd>
461  [CODE(DOMi)@en[[[NodeList]]]].      <dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt>
462  - [CODE(DOMa)@en[[[entities]]]]: The same        <dd><code>null</code>.</dd>
463  [CODE(DOMi)@en[[[NamedNodeMap]]]] as      <dt class=ed>@@ Ensure all attributes are defined</dt>
464  [CODE(DOMa)@en[[[generalEntities]]]].      </dl>
465  - [CODE(DOMa)@en[[[internalSubset]]]],    </dd>
466  [CODE(DOMa)@en[[[publicId]]]], [CODE(DOMa)@en[[[systemId]]]]:  <dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>,
467  Empty strings.  method</dt>
468  - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:    <dd>
469  [CODE(IDL)@en[[[false]]]].      <p>This method creates a <code>AttributeDefinition</code> node with the
470  - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].      specified name, belonging to the document.</p>
471  - [CODE(DOMa)@en[[[ownerDocument]]]]: The      <p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn>
472  [CODE(DOMi)@en[[[Document]]]] node on which the method      parameter is the name of the attribute defined by the attribute
473  is invoked.      definition.</p>
474    
475  In addition, it [['''MUST''']] be marked as containing      <p>When invoked, the method <em class=rfc2119>MUST</em> create and
476  five general entity declarations for XML predefined      return an
477  entities, i.e. [CODE(XML)@en[[[amp]]]], [CODE(XML)@en[[[lt]]]],      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
478  [CODE(XML)@en[[[gt]]]], [CODE(XML)@en[[[quot]]]], and      node with the following attributes:</p>
479  [CODE(XML)@en[[[apos]]]].      <dl>
480        <dt><code>allowedTokens</code></dt>
481  [8]        <dd>An empty <code>DOMStringList</code> object.</dd>
482  The [CODE(DOMm)@en[[[createElementTypeDefinition]]]]      <dt><code>attributes</code>,
483  method [['''MUST''']] create an      <a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>,
484  [CODE(DOMi)@en[[[ElementTypeDefinition]]]]      and <code>parentNode</code></dt>
485  object with the following attribute values:        <dd><code>null</code>.</dd>
486  - [CODE(DOMa)@en[[[attributeDefinitions]]]]:      <dt><code>childNodes</code></dt>
487  An empty [CODE(DOMi)@en[[[NamedNodeMap]]]].        <dd>An empty <code>NodeList</code> object.</dd>
488  - [CODE(DOMa)@en[[[attributes]]]],      <dt><code>declaredType</code></dt>
489  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].        <dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd>
490  - [CODE(DOMa)@en[[[childNodes]]]]: An empty      <dt><code>defaultType</code></dt>
491  [CODE(DOMi)@en[[[NodeList]]]].        <dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd>
492  - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
493  [CODE(IDL)@en[[[false]]]].        <dd><code>false</code>.</dd>
494  - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].      <dt><code>nodeName</code></dt>
495  - [CODE(DOMa)@en[[[ownerDocument]]]]: The        <dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd>
496  [CODE(DOMi)@en[[[Document]]]] node on which the method      <dt><code>ownerDocument</code></dt>
497  is invoked.        <dd>The <code>Document</code> node over which the method is invoked.</dd>
498  - [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:      <dt class=ed>@@ Ensure all attributes are defined</dt>
499  [CODE(IDL)@en[[[null]]]].      </dl>
500    
501  @@ Ensure all attributes are defined      <div class=ed>
502        <p>@@ Should we keep these statements?:
503  [9] The [CODE(DOMm)@en[[[createAttributeDefinition]]]]  However, if the &lt;cfg::cfg|xml-id> configuration
504  method [['''MUST''']] create an  parameter is set to <code>true</code> and the <var>name</var>
505  [CODE(DOMi)@en[[[AttributeDefinition]]]]  is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]]
506  object with the following attribute values:  attribute is set to <code>ID_ATTR</code>.
507  - [CODE(DOMa)@en[[[allowedTokens]]]]:  [CODE(DOMa)@en[[[defaultType]]]]?</p>
508  An empty [CODE(DOMi)@en[[[DOMStringList]]]].      </div>
509  - [CODE(DOMa)@en[[[attributes]]]],    </dd>
510  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].  <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,
511  - [CODE(DOMa)@en[[[childNodes]]]]: An empty  method</dt>
512  [CODE(DOMi)@en[[[NodeList]]]].    <dd>
513  - [CODE(DOMa)@en[[[declaredType]]]]:      <p>This method creates a <a href="#Entity"><code>Entity</code></a> node
514  [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].      with the specified name, which represents a general entity, belonging to
515  - [CODE(DOMa)@en[[[defaultType]]]]:      the document.</p>
516  [CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]].      <p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn>
517  - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:      parameter is the name of the general entity.</p>
518  [CODE(IDL)@en[[[false]]]].  
519  - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].      <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
520  - [CODE(DOMa)@en[[[ownerDocument]]]]: The      an <a href="#Entity"><code>Entity</code></a> node with the following
521  [CODE(DOMi)@en[[[Document]]]] node on which the method      attributes:</p>
522  is invoked.      <dl>
523  - [CODE(DOMa)@en[[[ownerElementTypeDefinition]]]]:      <dt><code>attributes</code>, <code>notationName</code>,
524  [CODE(IDL)@en[[[null]]]].      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
525        and <code>parentNode</code></dt>
526  @@ Ensure all attributes are defined        <dd><code>null</code>.</dd>
527        <dt><code>childNodes</code></dt>
528  @@ Should we keep these statements?:        <dd>An empty <code>NodeList</code> object.</dd>
529  However, if the <cfg::cfg|xml-id> configuration      <dt><code>manakaiDeclarationBaseURI</code>,
530  parameter is set to <DOM::true> and the <P::name>      <code>manakaiEntityBaseURI</code>, and
531  is <XA::xml:id>, then the [CODE(DOMa)@en[[[declaredType]]]]      <code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt>
532  attribute is set to        <dd>No explicit value is set.</dd>
533  <C::AttributeDefinition.ID_ATTR>.      <dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and
534  [CODE(DOMa)@en[[[defaultType]]]]?      <code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
535          <dd><code>false</code>.</dd>
536  [11] The [CODE(DOMm)@en[[[createGeneralEntity]]]]      <dt><code>nodeName</code></dt>
537  method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]]        <dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd>
538  node with the following attribute values:        <dd>
539  - [CODE(DOMa)@en[[[attributes]]]],          <div class="note memo">
540  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].            <p>It is not an error for
541  - [CODE(DOMa)@en[[[childNodes]]]]: An empty            <a href="#createGeneralEntity-name"><var>name</var></a> matching
542  [CODE(DOMi)@en[[[NodeList]]]].            to the name of one of predefined general parsed entities in
543  - [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:            <abbr>XML</abbr> or <abbr>HTML</abbr>.  For example,
544  No explicit value is set.            <a href="#createGeneralEntity-name"><var>name</var></a> might be
545  - [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]:            <code>amp</code>, resulting in an
546  No explicit value is set.            <a href="#Entity"><code>Entity</code></a> node
547  - [CODE(DOMa)@en[[[manakaiEntityURI]]]]:            with its <code>nodeName</code> attribute set to <code>amp</code>.</p>
548  No explicit value is set.          </div>
549  - [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]:        </dd>
550  [CODE(IDL)@en[[[false]]]].      <dt><code>ownerDocument</code></dt>
551  - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:        <dd>The <code>Document</code> node over which the method is invoked.</dd>
552  [CODE(IDL)@en[[[false]]]].      <dt><code>publicId</code>, and <code>systemId</code></dt>
553  - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].        <dd><code>null</code>.</dd>
554  - [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]].        <dd class=ed>@@ publicId and systemId should be empty string?</dd>
555  - [CODE(DOMa)@en[[[ownerDocument]]]]: The      <dt class=ed>@@ Ensure all attributes are defined</dd>
556  [CODE(DOMi)@en[[[Document]]]] node on which the method      </dl>
557  is invoked.    </dd>
558  - [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:  <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,
559  [CODE(IDL)@en[[[null]]]].  method</dt>
560  - [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].    <dd>
561  - [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].      <p>This method creates a <code>Notation</code> node with the
562        specified name, belonging to the document.</p>
563  @@ Ensure all attributes are defined      <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>
564        parameter is the name of the notation.</p>
565  @@ publicId and systemId should be empty string?  
566        <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
567  [13] The [CODE(DOMm)@en[[[createNotation]]]]      a <code>Notation</code> node with the following attributes:</p>
568  method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]]      <dl>
569  node with the following attribute values:      <dt><code>attributes</code>,
570  - [CODE(DOMa)@en[[[attributes]]]],      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
571  [CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].      and <code>parentNode</code></dt>
572  - [CODE(DOMa)@en[[[childNodes]]]]: An empty        <dd><code>null</code>.</dd>
573  [CODE(DOMi)@en[[[NodeList]]]].      <dt><code>childNodes</code></dt>
574  - [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:        <dd>An empty <code>NodeList</code> object.</dd>
575  No explicit value is set.      <dt><code>manakaiDeclarationBaseURI</code></dt>
576  - [CODE(DOMa)@en[[[manakaiReadOnly]]]]:        <dd>No explicit value is set.</dd>
577  [CODE(IDL)@en[[[false]]]].      <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
578  - [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].        <dd><code>false</code>.</dd>
579  - [CODE(DOMa)@en[[[ownerDocument]]]]: The      <dt><code>nodeName</code></dt>
580  [CODE(DOMi)@en[[[Document]]]] node on which the method        <dd><a href="#createNotation-name"><var>name</var></a>.</dd>
581  is invoked.      <dt><code>ownerDocument</code></dt>
582  - [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:        <dd>The <code>Document</code> node over which the method is invoked.</dd>
583  [CODE(IDL)@en[[[null]]]].      <dt><code>publicId</code> and <code>systemId</code></dt>
584  - [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].        <dd><code>null</code>.</dd>
585  - [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].        <dd class=ed>@@ publicId and systemId should be empty string?</dd>
586        <dt class=ed>@@ Ensure all attributes are defined</dt>
587  @@ Ensure all attributes are defined      </dl>
588      </dd>
589  [7]  </dl>
 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.  
590    
591  Otherwise, these method [['''MUST''']] return  <p>These methods <em class=rfc2119>MUST</em> raise an
592  the newly created node.  <code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span>
593  </pre>  if <var>name</var> is <em>not</em> a legal <code>Name</code> according to
594    the <abbr>XML</abbr> version in use, as specified in the
595    <code>xmlVersion</code> attribute of the <code>Document</code> node.</p>
596    
597    <div class="note memo">
598    <p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now,
599    since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not
600    define it for <code>Document</code> methods.</p>
601    
602    <p><var>name</var> does not have to be a namespace qualified name.</p>
603    </div>
604    
605    </div>
606    
607    
608    <div class=section id=section-documenttype>
609    <h3>Modifications to the <code id=DocumentType>DocumentType</code>
610    Interface</h3>
611    
612    <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
613    <em class=rfc2119>MAY</em> contain zero or more
614    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
615    nodes in the <code>NodeList</code> object contained in the
616    <code>childNodes</code> attribute of the
617    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
618    
619    <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
620    during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
621    document, the <code>NodeList</code> object in the <code>childNodes</code>
622    object <em class=rfc2119>MUST</em> contains the
623    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
624    nodes representing the processing instructions in the document type
625    definition of the document processed <span class=ed>@@ ref</span> by
626    the <abbr>XML</abbr> processor.  If the
627    <a href="#DocumentType"><code>DocumentType</code></a> node is marked
628    as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em>
629    also be marked as read$B!>(Bonly.</p>
630    
631    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
632    from a document type declaration information item <span class=ed>@@ ref</span>,
633    the <code>NodeList</code> object in the <code>childNodes</code> attribute
634    of the node <em class=rfc2119>MUST</em> contain the
635    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
636    created from the processing instruction information items in the list in the
637    [children] property of the document type declaration item in the same
638    order.</p>
639    
640    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
641    a document type declaration information item, the list in the [children]
642    property <em class=rfc2119>MUST</em> contain the processng instruction
643    information items created from the
644    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
645    in the <code>NodeList</code> object in the <code>childNodes</code> attribute
646    of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
647    
648    <p>The implementation of the
649    <a href="#DocumentType"><code>DocumentType</code></a> interface
650    <em class=rfc2119>MUST</em> be modified as following:</p>
651    <pre class=idl><code>// Modifications to the DocumentType interface
652      attribute DOMString <a href="#publicId">publicId</a>;
653      attribute DOMString <a href="#systemId">systemId</a>;
654    
655      attribute DOMString <a href="#internalSubset">internalSubset</a>;
656    </code></pre>
657    
658    <p>The <code id=publicId>publicId</code> attribute and the
659    <code id=systemId>systemId</code> attribute of
660    <a href="#DocumentType"><code>DocumentType</code></a>,
661    <a href="#Entity"><code>Entity</code></a>, and
662    <a href="#Notation"><code>Notation</code></a> interfaces are no longer
663    read$B!>(Bonly.</p>
664    
665    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
666    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
667    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
668    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
669    associated to the attribute.  No normalization, relative reference resolution,
670    or lexical validation is performed. <span class=ed>@@ If the new
671    value is <code>null</code>, ...</span></p>
672    
673    <div class="note memo">
674    <p>Setting an invalid identifier might make the node unserializable.
675    Setting a public identifier while leaveing system identifier unspecified
676    would also make the <a href="#DocumentType"><code>DocumentType</code></a>
677    or <a href="#Entity"><code>Entity</code></a> node unserializable.</p>
678    </div>
679    
680    <div class=ed>
681    <p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p>
682    </div>
683    
684    <p>The <code id=internalSubset>internalSubset</code> attribute of the
685    <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
686    read$B!>(Bonly.</p>
687    
688    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
689    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
690    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
691    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
692    associated to the attribute.  No normalization, or lexical validation is
693    performed. <span class=ed>@@ If the new value is <code>null</code>,
694    ...</span></p>
695    
696  </div>  </div>
697    
698  <div class=section id=section-documenttypedefinition>  <div class=section id=section-documenttypedefinition>
699  <h2>The <code>DocumentTypeDefinition</code> Interface</h2>  <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
700    
701    <div class="note memo">
702    <p>This interface is a separated interface from the
703    <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
704    to the <a href="#DocumentType"><code>DocumentType</code></a>,
705    for the historical reason.</p>
706    </div>
707    
708    <p>The
709    <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
710    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
711  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
712        readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
713      readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
714      readonly attribute NamedNodeMap <a href="#notations">notations</a>;
715    
716      <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
717        (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
718      <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
719        (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
720      <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
721        (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
722    
723      void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
724        (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
725        raises (DOMException);
726      void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
727        (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
728        raises (DOMException);
729      void <a href="#setNotationNode">setNotationNode</a>
730        (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
731        raises (DOMException);
732  }</code></pre>  }</code></pre>
733    
734  <pre class=ed>  <pre class=ed>
# Line 416  feature, a [CODE(DOMi)@en[[[DocumentType Line 738  feature, a [CODE(DOMi)@en[[[DocumentType
738  must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]  must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]
739  interface.  See [[DOM XML Document Type Definition]>>3] for  interface.  See [[DOM XML Document Type Definition]>>3] for
740  details.  details.
741    </pre>
742    
743    <dl>
744  ** Children  <dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of
745    type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
746  [2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]]    <dd><p>A live <code>NamedNodeMap</code> object that contains all the element
747  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface    type definitions belonging to the <code>DocumentType</code> node.</p>
748  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that  
749  contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
750  node.  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].    <code>NamedNodeMap</code> object that contains all the
751  The attribute is read-only.    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
752      nodes belonging to the <code>DocumentType</code> node.  The
753  What are contained in this collection depends on how    <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly
754  the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created.  If the    if and only if the node is read$B!>(Bonly.  The <code>NamedNodeMap</code>
755  node was created as the result of parsing of an XML document,    object <em class=rfc2119>MUST</em> be live and the same object
756  it [['''MUST''']]  contain all element types whose element type and / or    <em class=rfc2119>MUST</em> be returned for any invocation.</p>
757  attribute definition list declaration are encountered by and provided for the DOM  
758  implementation from the XML processor.  Note that the XML processor might not    <p>If the <code>DocumentType</code> node is created during the process
759  provide a part of or entire such information depending on the configuration.    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following
760  If more than one declarations for an element type or an attribute is available    requirements are applied:  The <code>NamedNodeMap</code> object in the
761  at the time of the definition node construction, then declarations other than    <a href="#elementTypes"><code>elementType</code></a> attribute
762  the first ones [['''MUST''']] be discarded.    <em class=rfc2119>MUST</em> be so transformed that the object contains
763      the <code>ElementTypeDefinition</code> nodes for the element types
764  The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]    whose name is presented as the <code>Name</code> of the element type or
765  object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes    attribute definition list declarations processed by the <abbr>XML</abbr>
766  belong to the node.  The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object    processor.  If there is more than one element type declarations for an
767  [['''MUST''']] be read-only if and only if the node is read-only.    element type, then the declarations other than the first one
768  Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live    <em class=rfc2119>MUST</em> be ignored for the purpose of constructing the
769  and therefore any change of read-only flag on the node is immediately    <code>NamedNodeMap</code> object.</p></dd>
770  reflected by that of the object.  <dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn>
771    of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
772  [3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]]    <dd><p>A live <code>NamedNodeMap</code> object that contains all the general
773  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface    entities belonging to the <code>DocumentType</code> node.</p>
774  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the    
775  general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node.    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
776  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].    same value as the <code>entities</code> attribute (defined in the
777  The attribute is read-only.    <code>DocumentType</code> interface) of the same node.</p>
778    
779      <div class="note memo">
780        <p>This attribute is part of the interface for historical reason.</p>
781      </div></dd>
782    <!--
783  All entities declared in the document type definition  All entities declared in the document type definition
784  contained in or referenced from the document entity  contained in or referenced from the document entity
785  might not be exposed through this collection, depending  might not be exposed through this collection, depending
# Line 472  representing general entities belong to Line 799  representing general entities belong to
799  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
800  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
801  reflected by that of the object.  reflected by that of the object.
802    -->
803  The attribute [['''MUST''']] return the same value as the  <dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type
804  [CODE(DOMa)@en[[[entites]]]] attribute of the  <code>notations</code>, read$B!>(Bonly</code>
805  [CODE(DOMi)@en[[[DocumentType]]]] interface on the same node.    <dd><p>A live <code>NamedNodeMap</code> object that contains all the
806      notations belonging to the <code>DocumentType</code> node.</p>
807  [4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]]    
808  of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
809  is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains    same value as the <code>notations</code> attribute (defined in the
810  all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]]    <code>DocumentType</code> interface) of the same node.</p>
811  node.  The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]].  
812  The attribute is read-only.    <div class="note memo">
813        <p>This attribute is part of the interface for historical reason.</p>
814        <p>Implementations are not required to implement the
815        <code>notations</code> attribute twice (for <code>DocumentType</code>
816        and <code>DocumentTypeDefinition</code> interfaces); they share exactly
817        same definition.</p>
818      </div></dd>
819    <!--
820  If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is  If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is
821  created from an XML document, duplicate notation declarations, if any, in DTD  created from an XML document, duplicate notation declarations, if any, in DTD
822  [['''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 507  representing notations belong to the nod Line 840  representing notations belong to the nod
840  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
841  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
842  reflected by that of the object.  reflected by that of the object.
843    -->
844    
845  A DOM implementation is not required to implement the  <dt class=ed>@@ other members...
846  [CODE(DOMa)@en[[[notations]]]] attribute twice  </dl>
 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.  
847    
848    <div class=ed>
849    <p>A future version of this interface might define the
850    <code>parameterEntities</code> and getter/setter for parameter entities.
851    </div>
852    
 ** 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>  
853  </div>  </div>
854    
855  <div class=section id=section-elementtypedefinition>  <div class=section id=section-elementtypedefinition>
856  <h2>The <code>ElementTypeDefinition</code> Interface</h2>  <h3>The <code>ElementTypeDefinition</code> Interface</h3>
   
 <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> {  
     
 }</code></pre>  
857    
858  <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members  <p>The nodes of type
859    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
860    represents an element type definition.  Such a node implements the
861    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
862    interface, which extends the <a href="#Node"><code>Node</code></a>
863    interface.</p>
864    
865  [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute  <p>An element type definition represents a definition of the element type.
866  of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  It is corresponding to the element type declaration in <abbr>DTD</abbr>.
867  [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  However, an
868    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
869  [4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute  does not represent the element type definition in <abbr>DTD</abbr> itself.  
870  of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  Even if there are more than one element type declarations for an element type
871  [['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]]  in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
872  of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
873  [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object.  node for that element type.  In addition, if there are attribute definition
874  Note that it might be [CODE(IDL)@en[[[null]]]].  declarations for an element type, even when there is no element type
875    declaration for that element type, the <abbr>DOM</abbr> will contain an
876  [1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
877  of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  node for that element type.</p>
878  [['''MUST''']] return the name of the element type.  
879    <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
880  [2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]]  interface <em class=rfc2119>MUST</em> be implemented as following:</p>
881  and [CODE(DOMa)@en[[[textContent]]]] attributes  <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
882  of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]]    readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
 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]]]].  
883    
884  ** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface    <span class=ed>@@ more</span>
885    }</code></pre>
886    
887  [5] The  <dl>
888  [DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]]  <dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn>
889  of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]]  of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt>
890  interface is defined in [[manakai//DOM Extensions]>>50].</pre>    <dd><p>The
891      <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
892      attribute of
893      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
894      <a href="#Entity"><code>Entity</code></a>, and
895      <a href="#Notation"><code>Notation</code></a> interface contains the
896      <a href="#DocumentType"><code>DocumentType</code></a> node to which the node
897      is attached.</p>
898    
899      <p>On getting, the attribute <em class=rfc2119>MUST</em> return a
900      <a href="#DocumentType"><code>DocumentType</code></a> node.  It
901      <em class=rfc2119>MUST</em> be such a node that whose
902      <a href="#elementTypes"><code>elementTypes</code></a> (for an
903      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
904      node), <a href="#entities"><code>entities</code></a> (for an
905      <a href="#Entity"><code>Entity</code></a> node), or
906      <a href="#notations"><code>notations</code></a> (for a
907      <a href="#Notation"><code>Notation</code></a> node) attribute contains the
908      <code>NamedNodeMap</code> object that contains the node.  If there is no such
909      a <a href="#DocumentType"><code>DocumentType</code></a> node,
910      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd>
911    </dl>
912  </div>  </div>
913    
914  <div class=section id=section-attributedefinition>  <div class=section id=section-attributedefinition>
915  <h2>The <code>AttributeDefinition</code> Interface</h2>  <h3>The <code>AttributeDefinition</code> Interface</h3>
916    
917  <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> {  <p>The nodes of type
918    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
919    represents an attribute definition.  Such a node implements the
920    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
921    which extends the <a href="#Node"><code>Node</code></a> interface.</p>
922    
923    <p>An attribute definition represents a definition of the attribute
924    associated to an element type.  It is corresponding to the attribute definition
925    in the attribute list declaration in <abbr>DTD</abbr>.  However, an
926    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
927    not represent the attribute definition in <abbr>DTD</abbr> itself.  Even if
928    there are more than one attribute definitions for an attribute of an element
929    type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
930    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
931    that attribute.</p>
932    
933    <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
934    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
935    <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
936      <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
937      const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
938      const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1;
939      const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2;
940      const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3;
941      const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4;
942      const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5;
943      const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6;
944      const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7;
945      const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8;
946      const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
947      const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
948      const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
949    
950      <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
951      const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
952      const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
953      const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
954      const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
955      const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
956        
957  }</code></pre>    readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
   
 <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members  
958    
959  [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute    readonly attribute unsigned short <a href="#declaredType">declaredType</a>;
960  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    readonly attribute unsigned short <a href="#defaultType">defaultType</a>;
 [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  
   
 [9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute  
 of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  
 [['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]]  
 of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the  
 [CODE(DOMi)@en[[[AttributeDefinition]]]] object.  
 Note that it might be [CODE(IDL)@en[[[null]]]].  
961    
962  [1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute    <span class=ed>...</span>
963  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  }</code></pre>
 [['''MUST''']] return the name of the attribute.  
   
 [2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute  
 of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  
 [['''MUST''']] return the normalized default value  
 of the attribute.  
964    
965  @@  <dl>
966    <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
967    of type
968    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
969    read$B!>(Bonly</dt>
970      <dd><p>The
971      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
972      which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
973      node belongs.</p>
974    
975      <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
976      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
977      It <em class=rfc2119>MUST</em> be such a node that whose
978      <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
979      attribute contains the <code>NamedNodeMap</code> object that contains
980      the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
981      node.  If there is no such an
982      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
983      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
984    <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
985    <code>unsigned short</code></dt>
986      <dd><p>The declared type <span class=ed>@@ ref</span> of the attribute.
987      It is expected that this attribute contains a value from the definition group
988      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
989    
990      <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
991      value associated to this attribute.</p>
992    
993      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
994      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
995      exception if the
996      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
997      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
998      <em class=rfc2119>MUST</em> set the specified value as the value
999      associated to this attribute.</p>
1000    
1001      <p>If the <code>AttributeDefinition</code> node is created during the process
1002      to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
1003      appropriate value from the
1004      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
1005      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1006    
1007      <!-- DeclaredValueType -->
1008    <p>The definition group
1009    <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
1010    integers indicating the declared type of attributes.  The definition
1011    group contains the following constants:</p>
1012    
1013    <table>
1014    <thead>
1015    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1016    </thead>
1017    <tbody>
1018    <tr>
1019    <th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code>
1020    <td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr>
1021    <tr>
1022    <th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code>
1023    <td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr>
1024    <tr>
1025    <th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code>
1026    <td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr>
1027    <tr>
1028    <th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code>
1029    <td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr>
1030    <tr>
1031    <th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code>
1032    <td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr>
1033    <tr>
1034    <th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code>
1035    <td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr>
1036    <tr>
1037    <th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code>
1038    <td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr>
1039    <tr>
1040    <th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code>
1041    <td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr>
1042    <tr>
1043    <th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code>
1044    <td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr>
1045    <tr>
1046    <th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code>
1047    <td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr>
1048    <tr>
1049    <th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code>
1050    <td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr>
1051    <tr>
1052    <th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code>
1053    <td><code>11</code><td>Unknown, because no declaration for the attribute
1054    has been read but the [all declaration processed] property
1055    <span class=ed>[INFOSET]</span> would be false.</tr>
1056    </tbody>
1057    </table>
1058    
1059    <p>If no attribute type information is available, or if the source
1060    of the information does not distinguish <q>no value</q> and <q>unknown</q>
1061    <span class=ed>[INFOSET]</span>, then the value
1062    <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>
1063    <em class=rfc2119>MUST</em> be used.</p>
1064    
1065    <div class="note memo">
1066    <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1067    created by the
1068    <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1069    method has its <a href="#declaredType"><code>declaredType</code></a> attribute
1070    set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p>
1071    </div>
1072    
1073  [4] The getter of the [CODE(DOMa)@en[[[textContent]]]]  <p>If the source of the information does not distinguish <q>no value</q>
1074  attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]]  and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and
1075  object [['''MUST''']] behave as if it were an  <code>CDATA</code> <span class=ed>[XML]</span>, then the value
1076  [CODE(DOMi)@en[[[Attr]]]] object.  <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
1077    be used.</p>
1078    
1079    <p>In Perl binding <span class=ed>[PERLBINDING]</span>, the
1080    <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1081    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1082    definition group.</p>
1083    
1084      </dd>
1085    <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1086    type <code>unsigned short</code></dt>
1087      <dd><p>The type of the default for the attribute.  It is expected that this
1088      attribute contains a value from the definition group
1089      <a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p>
1090    
1091      <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1092      the value associated to this attribute.</p>
1093    
1094      <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1095      <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1096      exception if the
1097      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1098      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
1099      <em class=rfc2119>MUST</em> set the specified value as the value
1100      associated to this attribute.</p>
1101    
1102      <p>If the
1103      <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1104      created during the process to create a <abbr>DOM</abbr> from an
1105      <abbr>XML</abbr> document, an appropriate value from the
1106      <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1107      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1108    
1109      <!-- DefaultValueType -->
1110      <p>The definition group
1111      <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1112      contains integers indicating the type of the default for the attribute.
1113      The definition group contains the following constans:</p>
1114    
1115      <table>
1116      <thead>
1117      <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1118      </thead>
1119      <tbody>
1120      <tr>
1121      <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1122      <td><code>0</code><td>Unknown.</tr>
1123      <tr>
1124      <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1125      <td><code>1</code><td>Provided explicitly and fixed
1126      <span class=ed>@@ ref</span> to that value.</tr>
1127      <tr>
1128      <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1129      <td><code>2</code><td>No default value and the attribute have to be
1130      explicitly specified.</tr>
1131      <tr>
1132      <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1133      <td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr>
1134      <tr>
1135      <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1136      <td><code>4</code><td>Provided explicitly.</tr>
1137      </tbody>
1138      </table>
1139    
1140      <p>If the source of the default type does not distinguish
1141      implied and unknown default types, then the value
1142      <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1143      <em class=rfc2119>MUST</em> be used.</p>
1144    
1145      <div class="note memo">
1146      <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1147      node created by the
1148      <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1149      method has its <a href="#defaultType"><code>defaultType</code></a>
1150      attribute set to
1151      <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1152      </div></dd>
1153    </dl>
1154    
1155  The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute  </div>
 of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  
 [['''MUST''']] behave as if the following algorithm  
 is performed:  
 = If the [CODE(DOMi)@en[[[AttributeDefinition]]]]  
 object is read-only, then throw an  
 [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]].  
 = Remove any child node the node has.  
 = If the new value is not empty and not [CODE(IDL)@en[[[null]]]],  
 then create a [CODE(DOMi)@en[[[Text]]]] node  
 whose [CODE(DOMa)@en[[[data]]]] is the new value  
 and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]].  
1156    
1157  ** Definition groups  <div class=section id=section-entity>
1158    <h3>Modifications to the <code id=Entity>Entity</code> Interface</h3>
1159    
1160  [6] The  <p>The implementation of the <a href="#Entity"><code>Entity</code></a>
1161  [DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]]  interface <em class=rfc2119>MUST</em> be modified as following:</p>
1162  contains integers indicating the type of  <pre class=idl><code>// Modifications to the Entity interface
1163  attribute value:    attribute DOMString <a href="#publicId">publicId</a>;
1164  ,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set.    attribute DOMString <a href="#systemId">systemId</a>;
1165  ,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]].    attribute DOMString <a href="#notationName">notationName</a>;
1166  ,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]].  
1167  ,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]].    // Additions to the Entity interface
1168  ,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]].    attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>;
1169  ,[CODE(DOMc)@en[[[ENTITY_ATTR]]]],[CODE(IDL)[[[5]]]],The attribute value type is [CODE(XML)@en[[[ENTITY]]]].    readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1170  ,[CODE(DOMc)@en[[[ENTITIES_ATTR]]]],[CODE(IDL)[[[6]]]],The attribute value type is [CODE(XML)@en[[[ENTITIES]]]].  </code></pre>
1171  ,[CODE(DOMc)@en[[[NMTOKEN_ATTR]]]],[CODE(IDL)[[[7]]]],The attribute value type is [CODE(XML)@en[[[NMTOKEN]]]].  
1172  ,[CODE(DOMc)@en[[[NMTOKENS_ATTR]]]],[CODE(IDL)[[[8]]]],The attribute value type is [CODE(XML)@en[[[NMTOKENS]]]].  <p>The <code id=notationName>notationName</code> attribute of the
1173  ,[CODE(DOMc)@en[[[NOTATION_ATTR]]]],[CODE(IDL)[[[9]]]],The attribute value type is [CODE(XML)@en[[[NOTATION]]]].  <a href="#Entity"><code>Entity</code></a> interface is no longer
1174  ,[CODE(DOMc)@en[[[ENUMERATION_ATTR]]]],[CODE(IDL)[[[10]]]],The attribute value is enumeration type.  read$B!>(Bonly.</p>
1175  ,[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."  
1176    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1177  The type of these constants are  <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1178  [CODE(IDL)@en[[[unsigned]] [[short]]]].  exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.
1179    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
1180  If no attribute type information is provided,  associated to the attribute.  No lexical validation is performed.  The new
1181  or if the source of that information does not  value <em class=rfc2119>MAY</em> be <code>null</code>.</p>
1182  distinguish [[no value]] and [[unknown]] as in  
1183  XML Information Set, then the  <dl>
1184  [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] value  <dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn>
1185  [['''MUST''']] be used.  of type boolean</dt>
1186      <dd><p>Whether the structure of the replacement text of the entity
1187  ;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]]    is available via the <code>NodeList</code> object in the
1188  object by [CODE(DOMm)@en[[[createAttributeDefinition]]]]    <code>childNodes</code> attribute of the entity.</p>
1189  method has [CODE(DOMa)@en[[[declaredType]]]] attribute  
1190  set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].    <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1191      the value associated to this attribute.</p>
1192  If the source of the attribute type information  
1193  does not distinguish [[no value]] and / or [[unknown]]    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1194  and [CODE(XML)@en[[[CDATA]]]], then the    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
1195  [CODE(DOMc)@en[[[CDATA_ATTR]]]] value [['''MUST''']]    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
1196  be used.    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the
1197      value associated to this attribute.</p>
1198  [11]  
1199  In Perl binding, the objects implementing the    <div class="note memo">
1200  [CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']]    <p>The attribute can be set to <code>false</code> even if the
1201  also implement the [CODE(DOM)@en[[[DeclaredValueType]]]]    <a href="#Entity"><code>Entity</code></a> node has any child node.
1202  constant group.    If the attribute is set to <code>false</code>, then any child node of
1203      the <a href="#Entity"><code>Entity</code></a> node ought to be ignored,
1204  [7] The    say, for the purpose of serialization.</p>
1205  [DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]]    </div>
1206  contains integers indicating the type of  
1207  default attribute value:    <p>When an <code>EntityReference</code> node is created by cloning
1208  ,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown.    the replacement subtree of the <a href="#Entity"><code>Entity</code></a>
1209  ,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value.    node, if the attribute is set to <code>false</code>, then any descendant
1210  ,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute.    of the node <em class=rfc2119>MUST</em> be ignored.</p>
1211  ,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]].  
1212  ,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it.    <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1213      the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1214  The type of these constants are    the following requirements are applied:  If the entity is an unparsed
1215  [CODE(IDL)@en[[[unsigned]] [[short]]]].    entity, then the attribute <em class=rfc2119>MUST</em> be set to
1216      <code>false</code>.  Otherwise, if the entity is an external entity whose
1217  If the source of the attribute default value type    replacement text is not available, or whose replacement text is not converted
1218  does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]]    to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set
1219  default and unknown default, then the    to <code>false</code>.  Otherwise, the attribute
1220  [CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value    <em class=rfc2119>MUST</em> be set to <code>true</code>.</p>
1221  [['''MUST''']] be used.  
1222      <div class="note memo">
1223  ;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]]    <p>An <a href="#Entity"><code>Entity</code></a> node created by the
1224  object by [CODE(DOMm)@en[[[createAttributeDefinition]]]]    <a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method
1225  method has [CODE(DOMa)@en[[[declaredType]]]] attribute    has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a>
1226  set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].    attribute set to <code>false</code>.</p>
1227      </div></dd>
1228  ** Tree-relationship Attributes  </dl>
   
 [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>  
1229  </div>  </div>
1230    
1231  </div>  <div class=section id=section-notation>
1232    <h3>Modifications to the <code id=Notation>Notation</code> Interface</h3>
1233    
1234    <p>The implementation of the <a href="#Notation"><code>Notation</code></a>
1235    interface <em class=rfc2119>MUST</em> be modified as following:</p>
1236    <pre class=idl><code>// Modifications to the Notation interface
1237      attribute DOMString <a href="#publicId">publicId</a>;
1238      attribute DOMString <a href="#systemId">systemId</a>;
1239    
1240      // Addition to the Notation interface
1241      readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1242    </code></pre>
1243    </div>
1244    
1245    <div class=section id=section-processinginstruction>
1246    <h3>Modifications to the
1247    <code id=ProcessingInstruction>ProcessingInstruction</code> Interface</h3>
1248    
1249    <div class=ed>...</div>
1250    </div>
1251    
1252    </div>
1253    
1254  <div id="references" class="section reference">  <div id="references" class="section reference">
1255  <h2>References</h2>  <h2>References</h2>

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.19

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24