/[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.10 by wakaba, Mon Dec 3 09:51:56 2007 UTC revision 1.18 by wakaba, Tue Dec 4 11:08:48 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-03>3 December 2007</time></h2>  <h2>Working Draft <time datetime=2007-12-04>4 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 172  feature names with or without version nu Line 180  feature names with or without version nu
180  aforementioned cases.</p>  aforementioned cases.</p>
181  </div>  </div>
182    
183    <div class=section id=section-node>
184    <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
185    
186    <p>The implementation of the
187    <a href="#Node"><code>Node</code></a> interface
188    <em class=rfc2119>MUST</em> be modified as following:</p>
189    <pre class=idl><code>// Additions to the Node interface
190    
191    // Additions to the NodeType definition group
192    const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
193    const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
194    </pre>
195    
196    <p>This specification adds two new types (subinterfaces) of
197    <a href="#Node"><code>Node</code></a>: element type definition (node type
198    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
199    interface
200    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
201    attribute definition (node type
202    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
203    interface
204    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).  For
205    these kinds of nodes, methods and attributes in the
206    <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
207    
208    <dl>
209    <dt><code id=attributes>attributes</code></dt>
210      <dd>
211        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
212        <code>null</code>.</p>
213      </dd>
214    <dt><code id=baseURI>baseURI</code></dt>
215      <dd>
216        <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
217        value of the <a href="#baseURI"><code>baseURI</code></a> attribute
218        of the node in the <code>ownerDocument</code> attribute of the node.
219        Note that the value might be <code>null</code>.</p>
220      </dd>
221    <dt><code id=nodeName>nodeName</code></dt>
222      <dd>
223        <p>If the node is an
224        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
225        On getting, the attribute <em class=rfc2119>MUST</em> return the
226        name of the element type definition represented by the node.</p>
227    
228        <p>If the node is an
229        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
230        On getting, the attribute <em class=rfc2119>MUST</em> return the
231        name of the attribute definition represented by the node.</p>
232      </dd>
233    <dt><code id=nodeType>nodeType</code></dt>
234      <dd>
235        <p>On getting, the attribute <em class=rfc2119>MUST</em> return
236        <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
237        (if the node is an
238        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
239        <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
240        (if the node is an
241        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
242    
243        <!-- NodeType -->
244    <p>Two constants are added to the <code id=NodeType>NodeType</code>
245    definition group of the <a href="#Node"><code>Node</code></a> interface as
246    following:</p>
247    <table>
248    <thead>
249    <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
250    </thead>
251    <tbody>
252    <tr>
253    <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
254    <td><code>81001</code><td>The node is an
255    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
256    <tr>
257    <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
258    <td><code>81002</code><td>The node is an
259    <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
260    </tbody>
261    </table>
262      </dd>
263    <dt><code id=nodeValue>nodeValue</code> and
264    <code id=textContent>textContent</code></dt>
265      <dd>
266        <p>If the node is an
267        <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
268        On getting, the attributes <em class=rfc2119>MUST</em> return the
269        name of the element type.</p>
270    
271        <div class="note memo">
272          <p>Thus, on setting the attributes does nothing
273          <span class=ed>[DOM3]</span>.</p>
274        </div>
275    
276        <p>On setting, the <a href="#textContent"><code>textContent</code></a>
277        attribute <em class=rfc2119>MUST NOT</em> raise a
278        <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>.
279        <span class=ed>@@ I forgot why this requirement is necessary.</span></p>
280    
281        <p>If the node is an
282        <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p>
283    
284        <pre class=ed>
285    The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute
286    of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object
287    [['''MUST''']] return the normalized default value
288    of the attribute.
289    
290    @@
291    
292    [4] The getter of the [CODE(DOMa)@en[[[textContent]]]]
293    attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]]
294    object [['''MUST''']] behave as if it were an
295    [CODE(DOMi)@en[[[Attr]]]] object.
296    
297    The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute
298    of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object
299    [['''MUST''']] behave as if the following algorithm
300    is performed:
301    = If the [CODE(DOMi)@en[[[AttributeDefinition]]]]
302    object is read-only, then throw an
303    [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]].
304    = Remove any child node the node has.
305    = If the new value is not empty and not [CODE(IDL)@en[[[null]]]],
306    then create a [CODE(DOMi)@en[[[Text]]]] node
307    whose [CODE(DOMa)@en[[[data]]]] is the new value
308    and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]].
309    </pre>
310      </dd>
311    <dt class=ed>@@ ...</dt>
312    </dl>
313    
314    </div>
315    
316  <div class=section id=section-documentxdoctype>  <div class=section id=section-documentxdoctype>
317  <h3>The <code>DocumentXDoctype</code> Interface</h3>  <h3>The <code>DocumentXDoctype</code> Interface</h3>
318    
319    <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
320    <em class=rfc2119>MUST</em> be implemented as following:</p>
321  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {  <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
322    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>    DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
323      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
324      raises (DOMException);      raises (DOMException);
325    ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
326      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
327      raises (DOMException);      raises (DOMException);
328    AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a>    <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
329      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)      (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
330      raises (DOMException);      raises (DOMException);
331    Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a>    <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
332      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)      (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
333      raises (DOMException);      raises (DOMException);
334    Notation <a href="#createNotation">createNotation</a>    <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
335      (in DOMString <a href="#createNotation-name"><var>name</var></a>)      (in DOMString <a href="#createNotation-name"><var>name</var></a>)
336      raises (DOMException);      raises (DOMException);
337  }</code></pre>  }</code></pre>
# Line 399  since <abbr>DOM3</abbr> specification <s Line 542  since <abbr>DOM3</abbr> specification <s
542  define it for <code>Document</code> methods.</p>  define it for <code>Document</code> methods.</p>
543    
544  <p><var>name</var> does not have to be a namespace qualified name.</p>  <p><var>name</var> does not have to be a namespace qualified name.</p>
545    </div>
546    
 <p>If the <code>strictErrorChecking</code> attribute of the  
 <code>Document</code> node is <code>false</code>, the methods are  
 not required to raise the exception <span class=ed>[DOM3]</span>.</p>  
547  </div>  </div>
548    
549    
550    <div class=section id=section-documenttype>
551    <h3>Modifications to the <code id=DocumentType>DocumentType</code>
552    Interface</h3>
553    
554    <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
555    <em class=rfc2119>MAY</em> contain zero or more
556    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
557    nodes in the <code>NodeList</code> object contained in the
558    <code>childNodes</code> attribute of the
559    <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
560    
561    <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
562    during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
563    document, the <code>NodeList</code> object in the <code>childNodes</code>
564    object <em class=rfc2119>MUST</em> contains the
565    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
566    nodes representing the processing instructions in the document type
567    definition of the document processed <span class=ed>@@ ref</span> by
568    the <abbr>XML</abbr> processor.  If the
569    <a href="#DocumentType"><code>DocumentType</code></a> node is marked
570    as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em>
571    also be marked as read$B!>(Bonly.</p>
572    
573    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
574    from a document type declaration information item <span class=ed>@@ ref</span>,
575    the <code>NodeList</code> object in the <code>childNodes</code> attribute
576    of the node <em class=rfc2119>MUST</em> contain the
577    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
578    created from the processing instruction information items in the list in the
579    [children] property of the document type declaration item in the same
580    order.</p>
581    
582    <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
583    a document type declaration information item, the list in the [children]
584    property <em class=rfc2119>MUST</em> contain the processng instruction
585    information items created from the
586    <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
587    in the <code>NodeList</code> object in the <code>childNodes</code> attribute
588    of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
589    
590    <p>The implementation of the
591    <a href="#DocumentType"><code>DocumentType</code></a> interface
592    <em class=rfc2119>MUST</em> be modified as following:</p>
593    <pre class=idl><code>// Modifications to the DocumentType interface
594      attribute DOMString <a href="#publicId">publicId</a>;
595      attribute DOMString <a href="#systemId">systemId</a>;
596    
597      attribute DOMString <a href="#internalSubset">internalSubset</a>;
598    </code></pre>
599    
600    <p>The <code id=publicId>publicId</code> attribute and the
601    <code id=systemId>systemId</code> attribute of
602    <a href="#DocumentType"><code>DocumentType</code></a>,
603    <a href="#Entity"><code>Entity</code></a>, and
604    <a href="#Notation"><code>Notation</code></a> interfaces are no longer
605    read$B!>(Bonly.</p>
606    
607    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
608    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
609    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
610    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
611    associated to the attribute.  No normalization, relative reference resolution,
612    or lexical validation is performed. <span class=ed>@@ If the new
613    value is <code>null</code>, ...</span></p>
614    
615    <div class="note memo">
616    <p>Setting an invalid identifier might make the node unserializable.
617    Setting a public identifier while leaveing system identifier unspecified
618    would also make the <a href="#DocumentType"><code>DocumentType</code></a>
619    or <a href="#Entity"><code>Entity</code></a> node unserializable.</p>
620    </div>
621    
622    <div class=ed>
623    <p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p>
624    </div>
625    
626    <p>The <code id=internalSubset>internalSubset</code> attribute of the
627    <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
628    read$B!>(Bonly.</p>
629    
630    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
631    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
632    exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>.  
633    Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value
634    associated to the attribute.  No normalization, or lexical validation is
635    performed. <span class=ed>@@ If the new value is <code>null</code>,
636    ...</span></p>
637    
638  </div>  </div>
639    
640  <div class=section id=section-documenttypedefinition>  <div class=section id=section-documenttypedefinition>
641  <h3>The <code>DocumentTypeDefinition</code> Interface</h3>  <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
642    
643    <div class="note memo">
644    <p>This interface is a separated interface from the
645    <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
646    to the <a href="#DocumentType"><code>DocumentType</code></a>,
647    for the historical reason.</p>
648    </div>
649    
650    <p>The
651    <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
652    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
653  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {  <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
654    readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;    readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
655    readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;    readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
656    readonly attribute NamedNodeMap <a href="#notations">notations</a>;    readonly attribute NamedNodeMap <a href="#notations">notations</a>;
657    
658    <span class=ed>more members come here...</span>    <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
659        (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
660      <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
661        (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
662      <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
663        (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
664    
665      void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
666        (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
667        raises (DOMException);
668      void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
669        (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
670        raises (DOMException);
671      void <a href="#setNotationNode">setNotationNode</a>
672        (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
673        raises (DOMException);
674  }</code></pre>  }</code></pre>
675    
676  <pre class=ed>  <pre class=ed>
# Line 542  reflected by that of the object. Line 797  reflected by that of the object.
797  <div class=section id=section-elementtypedefinition>  <div class=section id=section-elementtypedefinition>
798  <h3>The <code>ElementTypeDefinition</code> Interface</h3>  <h3>The <code>ElementTypeDefinition</code> Interface</h3>
799    
800    <p>The nodes of type
801    <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
802    represents an element type definition.  Such a node implements the
803    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
804    interface, which extends the <a href="#Node"><code>Node</code></a>
805    interface.</p>
806    
807    <p>An element type definition represents a definition of the element type.
808    It is corresponding to the element type declaration in <abbr>DTD</abbr>.
809    However, an
810    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
811    does not represent the element type definition in <abbr>DTD</abbr> itself.  
812    Even if there are more than one element type declarations for an element type
813    in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
814    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
815    node for that element type.  In addition, if there are attribute definition
816    declarations for an element type, even when there is no element type
817    declaration for that element type, the <abbr>DOM</abbr> will contain an
818    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
819    node for that element type.</p>
820    
821    <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
822    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
823  <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {  <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
824    readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;    readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
825    
826    <span class=ed>@@ more</span>    <span class=ed>@@ more</span>
827  }</code></pre>  }</code></pre>
828    
829  <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members  <pre class=ed>
   
 [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute  
 of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object  
 [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  
   
 [4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute  
 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  
830  [DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]]  [DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]]
831  of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]]  of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]]
832  interface is defined in [[manakai//DOM Extensions]>>50].</pre>  interface is defined in [[manakai//DOM Extensions]>>50].</pre>
# Line 588  interface is defined in [[manakai//DOM E Line 835  interface is defined in [[manakai//DOM E
835  <div class=section id=section-attributedefinition>  <div class=section id=section-attributedefinition>
836  <h3>The <code>AttributeDefinition</code> Interface</h3>  <h3>The <code>AttributeDefinition</code> Interface</h3>
837    
838    <p>The nodes of type
839    <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
840    represents an attribute definition.  Such a node implements the
841    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
842    which extends the <a href="#Node"><code>Node</code></a> interface.</p>
843    
844    <p>An attribute definition represents a definition of the attribute
845    associated to an element type.  It is corresponding to the attribute definition
846    in the attribute list declaration in <abbr>DTD</abbr>.  However, an
847    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
848    not represent the attribute definition in <abbr>DTD</abbr> itself.  Even if
849    there are more than one attribute definitions for an attribute of an element
850    type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
851    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
852    that attribute.</p>
853    
854    <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
855    interface <em class=rfc2119>MUST</em> be implemented as following:</p>
856  <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {  <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
857    <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>    <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
858    const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;    const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
# Line 602  interface is defined in [[manakai//DOM E Line 867  interface is defined in [[manakai//DOM E
867    const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;    const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
868    const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;    const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
869    const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;    const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
870    
871      <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
872      const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
873      const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
874      const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
875      const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
876      const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
877        
878    readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;    readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
879    
# Line 611  interface is defined in [[manakai//DOM E Line 883  interface is defined in [[manakai//DOM E
883    <span class=ed>...</span>    <span class=ed>...</span>
884  }</code></pre>  }</code></pre>
885    
886  <pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members  <dl>
887    <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
888  [3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute  of type
889  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object  <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
890  [['''MUST''']] return [CODE(IDL)@en[[[null]]]].  read$B!>(Bonly</dt>
891      <dd><p>The
892  [9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
893  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
894  [['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]]    node belongs.</p>
 of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the  
 [CODE(DOMi)@en[[[AttributeDefinition]]]] 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[[[AttributeDefinition]]]] object  
 [['''MUST''']] return the name of the attribute.  
895    
896  [2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute    <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
897  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
898  [['''MUST''']] return the normalized default value    It <em class=rfc2119>MUST</em> be such a node that whose
899  of the attribute.    <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
900      attribute contains the <code>NamedNodeMap</code> object that contains
901      the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
902      node.  If there is no such an
903      <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
904      then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
905    <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
906    <code>unsigned short</code></dt>
907      <dd><p>The declared type <span class=ed>@@ ref</span> of the attribute.
908      It is expected that this attribute contains a value from the definition group
909      <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
910    
911  @@    <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
912      value associated to this attribute.</p>
913    
914  [4] The getter of the [CODE(DOMa)@en[[[textContent]]]]    <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
915  attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]]    <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>
916  object [['''MUST''']] behave as if it were an    exception if the
917  [CODE(DOMi)@en[[[Attr]]]] object.    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
918      is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it
919      <em class=rfc2119>MUST</em> set the specified value as the value
920      associated to this attribute.</p>
921    
922  The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute    <p>If the <code>AttributeDefinition</code> node is created during the process
923  of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
924  [['''MUST''']] behave as if the following algorithm    appropriate value from the
925  is performed:    <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
926  = If the [CODE(DOMi)@en[[[AttributeDefinition]]]]    group <em class=rfc2119>MUST</em> be set to the attribute.</p>
 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]]]].  
 </pre>  
927    
928      <!-- DeclaredValueType -->
929  <p>The definition group  <p>The definition group
930  <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains  <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
931  integers indicating the declared type of attributes.</p>  integers indicating the declared type of attributes.  The definition
932    group contains the following constants:</p>
933    
934  <table>  <table>
935  <thead>  <thead>
# Line 719  set to <a href="#NO_TYPE_ATTR"><code>NO_ Line 992  set to <a href="#NO_TYPE_ATTR"><code>NO_
992  </div>  </div>
993    
994  <p>If the source of the information does not distinguish <q>no value</q>  <p>If the source of the information does not distinguish <q>no value</q>
995  and/or <code>unknown</code> <span class=ed>[INFOSET]</span> and  and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and
996  <code>CDATA</code> <span class=ed>[XML]</span>, then the value  <code>CDATA</code> <span class=ed>[XML]</span>, then the value
997  <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>  <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
998  be used.</p>  be used.</p>
# Line 727  be used.</p> Line 1000  be used.</p>
1000  <p>In Perl binding <span class=ed>[PERLBINDING]</span>, the  <p>In Perl binding <span class=ed>[PERLBINDING]</span>, the
1001  <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the  <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1002  <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>  <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1003  constant group.</p>  definition group.</p>
   
 <pre class=ed>  
 [7] The  
 [DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]]  
 contains integers indicating the type of  
 default attribute value:  
 ,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown.  
 ,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value.  
 ,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute.  
 ,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]].  
 ,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it.  
   
 The type of these constants are  
 [CODE(IDL)@en[[[unsigned]] [[short]]]].  
   
 If the source of the attribute default value type  
 does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]]  
 default and unknown default, then the  
 [CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value  
 [['''MUST''']] be used.  
   
 ;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]]  
 object by [CODE(DOMm)@en[[[createAttributeDefinition]]]]  
 method has [CODE(DOMa)@en[[[declaredType]]]] attribute  
 set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].  
 </pre>  
   
 <dl>  
 <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>  
 of type  
 <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,  
 read$B!>(Bonly</dt>  
   <dd><p>The  
   <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to  
   which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>  
   node belongs.</p>  
1004    
1005    <p>On getting, the attribute <em class=rfc2119>MUST</em> return an    </dd>
   <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.  
   It <em class=rfc2119>MUST</em> be such a node that whose  
   <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>  
   attribute contains the <code>NamedNodeMap</code> object that contains  
   the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>  
   node.  If there is no such an  
   <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,  
   then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>  
 <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type  
 <code>unsigned short</code></dt>  
   <dd><p>The declared type <span class=ed>@@ ref</span> of the attribute.  
   It is expected that this attribute contains a value from the definition group  
   <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>  
   
   <p>On getting, the attribute <em class=rfc2119>MUST</em> return the  
   value associated to this attribute.</p>  
   
   <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a  
   <code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>  
   exception if the  
   <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node  
   is read$B!>(Bonly <span class=ed>@@ ref</span>.  Otherwise, it  
   <em class=rfc2119>MUST</em> set the specified value as the value  
   associated to this attribute.</p>  
   
   <p>If the <code>AttributeDefinition</code> node is created during the process  
   to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an  
   appropriate value from the  
   <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant  
   group <em class=rfc2119>MUST</em> be set to the attribute.</p></dd>  
1006  <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of  <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1007  type <code>unsigned short</code></dt>  type <code>unsigned short</code></dt>
1008    <dd><p>The type of the default for the attribute.  It is expected that this    <dd><p>The type of the default for the attribute.  It is expected that this
# Line 813  type <code>unsigned short</code></dt> Line 1020  type <code>unsigned short</code></dt>
1020    <em class=rfc2119>MUST</em> set the specified value as the value    <em class=rfc2119>MUST</em> set the specified value as the value
1021    associated to this attribute.</p>    associated to this attribute.</p>
1022    
1023    <p>If the <code>AttributeDefinition</code> node is created during the process    <p>If the
1024    to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an    <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1025    appropriate value from the    created during the process to create a <abbr>DOM</abbr> from an
1026    <a href="#DefaultValueType"><code>DefaultValueType</code></a> constant    <abbr>XML</abbr> document, an appropriate value from the
1027    group <em class=rfc2119>MUST</em> be set to the attribute.</p></dd>    <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1028      group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1029    
1030      <!-- DefaultValueType -->
1031      <p>The definition group
1032      <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1033      contains integers indicating the type of the default for the attribute.
1034      The definition group contains the following constans:</p>
1035    
1036      <table>
1037      <thead>
1038      <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1039      </thead>
1040      <tbody>
1041      <tr>
1042      <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1043      <td><code>0</code><td>Unknown.</tr>
1044      <tr>
1045      <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1046      <td><code>1</code><td>Provided explicitly and fixed
1047      <span class=ed>@@ ref</span> to that value.</tr>
1048      <tr>
1049      <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1050      <td><code>2</code><td>No default value and the attribute have to be
1051      explicitly specified.</tr>
1052      <tr>
1053      <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1054      <td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr>
1055      <tr>
1056      <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1057      <td><code>4</code><td>Provided explicitly.</tr>
1058      </tbody>
1059      </table>
1060    
1061      <p>If the source of the default type does not distinguish
1062      implied and unknown default types, then the value
1063      <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1064      <em class=rfc2119>MUST</em> be used.</p>
1065    
1066      <div class="note memo">
1067      <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1068      node created by the
1069      <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1070      method has its <a href="#defaultType"><code>defaultType</code></a>
1071      attribute set to
1072      <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1073      </div></dd>
1074  </dl>  </dl>
1075    
1076  </div>  </div>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.18

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24