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-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> |
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> |
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> |
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> |
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> |
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 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<p>The nodes of type |
801 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
802 |
}</code></pre> |
represents an element type definition. Such a node implements the |
803 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
804 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
interface, which extends the <a href="#Node"><code>Node</code></a> |
805 |
|
interface.</p> |
806 |
|
|
807 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<p>An element type definition represents a definition of the element type. |
808 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
809 |
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
However, an |
810 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
811 |
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
does not represent the element type definition in <abbr>DTD</abbr> itself. |
812 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
Even if there are more than one element type declarations for an element type |
813 |
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
814 |
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
815 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] object. |
node for that element type. In addition, if there are attribute definition |
816 |
Note that it might be [CODE(IDL)@en[[[null]]]]. |
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 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
819 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
node for that element type.</p> |
820 |
[['''MUST''']] return the name of the element type. |
|
821 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
822 |
[2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]] |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
823 |
and [CODE(DOMa)@en[[[textContent]]]] attributes |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
824 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
readonly attribute <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]]]]. |
|
825 |
|
|
826 |
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
<span class=ed>@@ more</span> |
827 |
|
}</code></pre> |
828 |
|
|
829 |
[5] The |
<pre class=ed> |
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> |
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 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<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> { |
857 |
|
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
858 |
|
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
859 |
|
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
860 |
|
const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2; |
861 |
|
const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3; |
862 |
|
const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4; |
863 |
|
const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5; |
864 |
|
const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6; |
865 |
|
const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7; |
866 |
|
const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8; |
867 |
|
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
868 |
|
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
869 |
|
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 |
}</code></pre> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
879 |
|
|
880 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
881 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
882 |
|
|
883 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<span class=ed>...</span> |
884 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
}</code></pre> |
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
885 |
|
|
886 |
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
<dl> |
887 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
888 |
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
of type |
889 |
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
890 |
[CODE(DOMi)@en[[[AttributeDefinition]]]] object. |
read$B!>(Bonly</dt> |
891 |
Note that it might be [CODE(IDL)@en[[[null]]]]. |
<dd><p>The |
892 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
893 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
894 |
|
node belongs.</p> |
895 |
|
|
896 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
897 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
898 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
899 |
|
<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 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
912 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
value associated to this attribute.</p> |
|
[['''MUST''']] return the name of the attribute. |
|
913 |
|
|
914 |
[2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
915 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
916 |
[['''MUST''']] return the normalized default value |
exception if the |
917 |
of the attribute. |
<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 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
923 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
924 |
|
appropriate value from the |
925 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
926 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
927 |
|
|
928 |
|
<!-- DeclaredValueType --> |
929 |
|
<p>The definition group |
930 |
|
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
931 |
|
integers indicating the declared type of attributes. The definition |
932 |
|
group contains the following constants:</p> |
933 |
|
|
934 |
|
<table> |
935 |
|
<thead> |
936 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
937 |
|
</thead> |
938 |
|
<tbody> |
939 |
|
<tr> |
940 |
|
<th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code> |
941 |
|
<td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr> |
942 |
|
<tr> |
943 |
|
<th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code> |
944 |
|
<td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr> |
945 |
|
<tr> |
946 |
|
<th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code> |
947 |
|
<td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr> |
948 |
|
<tr> |
949 |
|
<th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code> |
950 |
|
<td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr> |
951 |
|
<tr> |
952 |
|
<th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code> |
953 |
|
<td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr> |
954 |
|
<tr> |
955 |
|
<th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code> |
956 |
|
<td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr> |
957 |
|
<tr> |
958 |
|
<th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code> |
959 |
|
<td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr> |
960 |
|
<tr> |
961 |
|
<th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code> |
962 |
|
<td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr> |
963 |
|
<tr> |
964 |
|
<th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code> |
965 |
|
<td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr> |
966 |
|
<tr> |
967 |
|
<th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code> |
968 |
|
<td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr> |
969 |
|
<tr> |
970 |
|
<th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code> |
971 |
|
<td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr> |
972 |
|
<tr> |
973 |
|
<th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code> |
974 |
|
<td><code>11</code><td>Unknown, because no declaration for the attribute |
975 |
|
has been read but the [all declaration processed] property |
976 |
|
<span class=ed>[INFOSET]</span> would be false.</tr> |
977 |
|
</tbody> |
978 |
|
</table> |
979 |
|
|
980 |
|
<p>If no attribute type information is available, or if the source |
981 |
|
of the information does not distinguish <q>no value</q> and <q>unknown</q> |
982 |
|
<span class=ed>[INFOSET]</span>, then the value |
983 |
|
<a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a> |
984 |
|
<em class=rfc2119>MUST</em> be used.</p> |
985 |
|
|
986 |
@@ |
<div class="note memo"> |
987 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
988 |
|
created by the |
989 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
990 |
|
method has its <a href="#declaredType"><code>declaredType</code></a> attribute |
991 |
|
set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p> |
992 |
|
</div> |
993 |
|
|
994 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<p>If the source of the information does not distinguish <q>no value</q> |
995 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
996 |
object [['''MUST''']] behave as if it were an |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
997 |
[CODE(DOMi)@en[[[Attr]]]] object. |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
998 |
|
be used.</p> |
999 |
|
|
1000 |
|
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
1001 |
|
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
1002 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
1003 |
|
definition group.</p> |
1004 |
|
|
1005 |
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
</dd> |
1006 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1007 |
[['''MUST''']] behave as if the following algorithm |
type <code>unsigned short</code></dt> |
1008 |
is performed: |
<dd><p>The type of the default for the attribute. It is expected that this |
1009 |
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
attribute contains a value from the definition group |
1010 |
object is read-only, then throw an |
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1011 |
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
1012 |
= Remove any child node the node has. |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1013 |
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
the value associated to this attribute.</p> |
1014 |
then create a [CODE(DOMi)@en[[[Text]]]] node |
|
1015 |
whose [CODE(DOMa)@en[[[data]]]] is the new value |
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1016 |
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1017 |
|
exception if the |
1018 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1019 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1020 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1021 |
|
associated to this attribute.</p> |
1022 |
|
|
1023 |
|
<p>If the |
1024 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1025 |
|
created during the process to create a <abbr>DOM</abbr> from an |
1026 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1027 |
|
<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 |
** Definition groups |
<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> |
1075 |
|
|
|
[6] The |
|
|
[DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]] |
|
|
contains integers indicating the type of |
|
|
attribute value: |
|
|
,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set. |
|
|
,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]]. |
|
|
,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]]. |
|
|
,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]]. |
|
|
,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]]. |
|
|
,[CODE(DOMc)@en[[[ENTITY_ATTR]]]],[CODE(IDL)[[[5]]]],The attribute value type is [CODE(XML)@en[[[ENTITY]]]]. |
|
|
,[CODE(DOMc)@en[[[ENTITIES_ATTR]]]],[CODE(IDL)[[[6]]]],The attribute value type is [CODE(XML)@en[[[ENTITIES]]]]. |
|
|
,[CODE(DOMc)@en[[[NMTOKEN_ATTR]]]],[CODE(IDL)[[[7]]]],The attribute value type is [CODE(XML)@en[[[NMTOKEN]]]]. |
|
|
,[CODE(DOMc)@en[[[NMTOKENS_ATTR]]]],[CODE(IDL)[[[8]]]],The attribute value type is [CODE(XML)@en[[[NMTOKENS]]]]. |
|
|
,[CODE(DOMc)@en[[[NOTATION_ATTR]]]],[CODE(IDL)[[[9]]]],The attribute value type is [CODE(XML)@en[[[NOTATION]]]]. |
|
|
,[CODE(DOMc)@en[[[ENUMERATION_ATTR]]]],[CODE(IDL)[[[10]]]],The attribute value is enumeration type. |
|
|
,[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." |
|
|
|
|
|
The type of these constants are |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
|
|
|
|
|
If no attribute type information is provided, |
|
|
or if the source of that information does not |
|
|
distinguish [[no value]] and [[unknown]] as in |
|
|
XML Information Set, then the |
|
|
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] 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]]]]. |
|
|
|
|
|
If the source of the attribute type information |
|
|
does not distinguish [[no value]] and / or [[unknown]] |
|
|
and [CODE(XML)@en[[[CDATA]]]], then the |
|
|
[CODE(DOMc)@en[[[CDATA_ATTR]]]] value [['''MUST''']] |
|
|
be used. |
|
|
|
|
|
[11] |
|
|
In Perl binding, the objects implementing the |
|
|
[CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']] |
|
|
also implement the [CODE(DOM)@en[[[DeclaredValueType]]]] |
|
|
constant group. |
|
|
|
|
|
[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]]]]. |
|
|
|
|
|
** Tree-relationship Attributes |
|
|
|
|
|
[10] |
|
|
The |
|
|
[DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]] |
|
|
of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface |
|
|
is read-only and of type |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]. |
|
|
It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
|
|
which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
belong to. |
|
|
|
|
|
If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]] |
|
|
list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node, |
|
|
then the attribute [['''MUST''']] return the |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] node. |
|
|
Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]]. |
|
|
|
|
|
;; This attribute is analogue to the |
|
|
[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute |
|
|
for [CODE(DOMi)@en[[[ElementTypeDefinition]]]], |
|
|
[CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] |
|
|
nodes, or the [CODE(DOMa)@en[[[ownerElement]]]] |
|
|
attribute for [CODE(DOMi)@en[[[Attr]]]] nodes. |
|
|
|
|
|
** Attributes |
|
|
|
|
|
[5] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DeclaredValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DeclaredValueType]]]] |
|
|
definition group. |
|
|
|
|
|
[8] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute default value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DefaultValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DefaultValueType]]]] |
|
|
definition group.</pre> |
|
1076 |
</div> |
</div> |
1077 |
|
|
1078 |
</div> |
</div> |