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-03>3 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 |
</div> |
</div> |
133 |
|
|
134 |
<div class=section id=dom-dtdef> |
<div class=section id=dom-dtdef> |
143 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
144 |
</ul> |
</ul> |
145 |
|
|
146 |
<p>In addition, it adds methods, attributes, and/or constants to interfaces |
<p>In addition, it modifies interfaces |
147 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
148 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
149 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Entity"><code>Entity</code></a>, |
150 |
<a href="#EntityReference"><code>EntityReference</code></a>, and |
<a href="#EntityReference"><code>EntityReference</code></a>, |
151 |
<a href="#Notation"><code>Notation</code></a>. |
<a href="#Notation"><code>Notation</code></a>, and |
152 |
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> |
|
153 |
|
|
154 |
<div class=section id=features> |
<div class=section id=features> |
155 |
<h3>Feature Name</h3> |
<h3>Feature Name</h3> |
174 |
aforementioned cases.</p> |
aforementioned cases.</p> |
175 |
</div> |
</div> |
176 |
|
|
177 |
|
<div class=section id=section-node> |
178 |
|
<h3>Modifications to the <code id=Node>Node</code> Interface</h3> |
179 |
|
|
180 |
|
<p>The implementation of the |
181 |
|
<a href="#Node"><code>Node</code></a> interface |
182 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
183 |
|
<pre class=idl><code>// Additions to the Node interface |
184 |
|
|
185 |
|
// Additions to the NodeType definition group |
186 |
|
const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001; |
187 |
|
const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002; |
188 |
|
</pre> |
189 |
|
|
190 |
|
<p>This specification adds two new types (subinterfaces) of |
191 |
|
<a href="#Node"><code>Node</code></a>: element type definition (node type |
192 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>, |
193 |
|
interface |
194 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and |
195 |
|
attribute definition (node type |
196 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>, |
197 |
|
interface |
198 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For |
199 |
|
these kinds of nodes, methods and attributes in the |
200 |
|
<a href="#Node"><code>Node</code></a> interface must behave as following:</p> |
201 |
|
|
202 |
|
<dl> |
203 |
|
<dt><code id=attributes>attributes</code></dt> |
204 |
|
<dd> |
205 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
206 |
|
<code>null</code>.</p> |
207 |
|
</dd> |
208 |
|
<dt><code id=baseURI>baseURI</code></dt> |
209 |
|
<dd> |
210 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
211 |
|
value of the <a href="#baseURI"><code>baseURI</code></a> attribute |
212 |
|
of the node in the <code>ownerDocument</code> attribute of the node. |
213 |
|
Note that the value might be <code>null</code>.</p> |
214 |
|
</dd> |
215 |
|
<dt><code id=nodeName>nodeName</code></dt> |
216 |
|
<dd> |
217 |
|
<p>If the node is an |
218 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
219 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
220 |
|
name of the element type definition represented by the node.</p> |
221 |
|
|
222 |
|
<p>If the node is an |
223 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
224 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
225 |
|
name of the attribute definition represented by the node.</p> |
226 |
|
</dd> |
227 |
|
<dt><code id=nodeType>nodeType</code></dt> |
228 |
|
<dd> |
229 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
230 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
231 |
|
(if the node is an |
232 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or |
233 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
234 |
|
(if the node is an |
235 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p> |
236 |
|
|
237 |
|
<!-- NodeType --> |
238 |
|
<p>Two constants are added to the <code id=NodeType>NodeType</code> |
239 |
|
definition group of the <a href="#Node"><code>Node</code></a> interface as |
240 |
|
following:</p> |
241 |
|
<table> |
242 |
|
<thead> |
243 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
244 |
|
</thead> |
245 |
|
<tbody> |
246 |
|
<tr> |
247 |
|
<th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn> |
248 |
|
<td><code>81001</code><td>The node is an |
249 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr> |
250 |
|
<tr> |
251 |
|
<th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn> |
252 |
|
<td><code>81002</code><td>The node is an |
253 |
|
<a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr> |
254 |
|
</tbody> |
255 |
|
</table> |
256 |
|
</dd> |
257 |
|
<dt><code id=nodeValue>nodeValue</code> and |
258 |
|
<code id=textContent>textContent</code></dt> |
259 |
|
<dd> |
260 |
|
<p>If the node is an |
261 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
262 |
|
On getting, the attributes <em class=rfc2119>MUST</em> return the |
263 |
|
name of the element type.</p> |
264 |
|
|
265 |
|
<div class="note memo"> |
266 |
|
<p>Thus, on setting the attributes does nothing |
267 |
|
<span class=ed>[DOM3]</span>.</p> |
268 |
|
</div> |
269 |
|
|
270 |
|
<p>On setting, the <a href="#textContent"><code>textContent</code></a> |
271 |
|
attribute <em class=rfc2119>MUST NOT</em> raise a |
272 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
273 |
|
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
274 |
|
|
275 |
|
<p>If the node is an |
276 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p> |
277 |
|
|
278 |
|
<pre class=ed> |
279 |
|
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
280 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
281 |
|
[['''MUST''']] return the normalized default value |
282 |
|
of the attribute. |
283 |
|
|
284 |
|
@@ |
285 |
|
|
286 |
|
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
287 |
|
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
288 |
|
object [['''MUST''']] behave as if it were an |
289 |
|
[CODE(DOMi)@en[[[Attr]]]] object. |
290 |
|
|
291 |
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
292 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
293 |
|
[['''MUST''']] behave as if the following algorithm |
294 |
|
is performed: |
295 |
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
296 |
|
object is read-only, then throw an |
297 |
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
298 |
|
= Remove any child node the node has. |
299 |
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
300 |
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
301 |
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
302 |
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
303 |
|
</pre> |
304 |
|
</dd> |
305 |
|
<dt class=ed>@@ ...</dt> |
306 |
|
</dl> |
307 |
|
|
308 |
|
</div> |
309 |
|
|
310 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
311 |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
312 |
|
|
313 |
|
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
314 |
|
<em class=rfc2119>MUST</em> be implemented as following:</p> |
315 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
316 |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
317 |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
318 |
raises (DOMException); |
raises (DOMException); |
319 |
ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
320 |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
321 |
raises (DOMException); |
raises (DOMException); |
322 |
AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a> |
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
323 |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
324 |
raises (DOMException); |
raises (DOMException); |
325 |
Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
326 |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
327 |
raises (DOMException); |
raises (DOMException); |
328 |
Notation <a href="#createNotation">createNotation</a> |
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
329 |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
330 |
raises (DOMException); |
raises (DOMException); |
331 |
}</code></pre> |
}</code></pre> |
536 |
define it for <code>Document</code> methods.</p> |
define it for <code>Document</code> methods.</p> |
537 |
|
|
538 |
<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> |
539 |
|
</div> |
540 |
|
|
|
<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> |
|
541 |
</div> |
</div> |
542 |
|
|
543 |
|
|
544 |
|
<div class=section id=section-documenttype> |
545 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
546 |
|
Interface</h3> |
547 |
|
|
548 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
549 |
|
<em class=rfc2119>MAY</em> contain zero or more |
550 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
551 |
|
nodes in the <code>NodeList</code> object contained in the |
552 |
|
<code>childNodes</code> attribute of the |
553 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
554 |
|
|
555 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
556 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
557 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
558 |
|
object <em class=rfc2119>MUST</em> contains the |
559 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
560 |
|
nodes representing the processing instructions in the document type |
561 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
562 |
|
the <abbr>XML</abbr> processor. If the |
563 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
564 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
565 |
|
also be marked as read$B!>(Bonly.</p> |
566 |
|
|
567 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
568 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
569 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
570 |
|
of the node <em class=rfc2119>MUST</em> contain the |
571 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
572 |
|
created from the processing instruction information items in the list in the |
573 |
|
[children] property of the document type declaration item in the same |
574 |
|
order.</p> |
575 |
|
|
576 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
577 |
|
a document type declaration information item, the list in the [children] |
578 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
579 |
|
information items created from the |
580 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
581 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
582 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
583 |
|
|
584 |
|
<p>The implementation of the |
585 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
586 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
587 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
588 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
589 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
590 |
|
|
591 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
592 |
|
</code></pre> |
593 |
|
|
594 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
595 |
|
<code id=systemId>systemId</code> attribute of |
596 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
597 |
|
<a href="#Entity"><code>Entity</code></a>, and |
598 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
599 |
|
read$B!>(Bonly.</p> |
600 |
|
|
601 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
602 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
603 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
604 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
605 |
|
associated to the attribute. No normalization, relative reference resolution, |
606 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
607 |
|
value is <code>null</code>, ...</span></p> |
608 |
|
|
609 |
|
<div class="note memo"> |
610 |
|
<p>Setting an invalid identifier might make the node unserializable. |
611 |
|
Setting a public identifier while leaveing system identifier unspecified |
612 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
613 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
614 |
|
</div> |
615 |
|
|
616 |
|
<div class=ed> |
617 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
618 |
|
</div> |
619 |
|
|
620 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
621 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
622 |
|
read$B!>(Bonly.</p> |
623 |
|
|
624 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
625 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
626 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
627 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
628 |
|
associated to the attribute. No normalization, or lexical validation is |
629 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
630 |
|
...</span></p> |
631 |
|
|
632 |
</div> |
</div> |
633 |
|
|
634 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
635 |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
636 |
|
|
637 |
|
<div class="note memo"> |
638 |
|
<p>This interface is a separated interface from the |
639 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
640 |
|
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
641 |
|
for the historical reason.</p> |
642 |
|
</div> |
643 |
|
|
644 |
|
<p>The |
645 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
646 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
647 |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
648 |
|
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
649 |
|
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
650 |
|
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
651 |
|
|
652 |
|
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
653 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
654 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
655 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
656 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
657 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
658 |
|
|
659 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
660 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
661 |
|
raises (DOMException); |
662 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
663 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
664 |
|
raises (DOMException); |
665 |
|
void <a href="#setNotationNode">setNotationNode</a> |
666 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
667 |
|
raises (DOMException); |
668 |
}</code></pre> |
}</code></pre> |
669 |
|
|
670 |
<pre class=ed> |
<pre class=ed> |
674 |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
675 |
interface. See [[DOM XML Document Type Definition]>>3] for |
interface. See [[DOM XML Document Type Definition]>>3] for |
676 |
details. |
details. |
677 |
|
</pre> |
678 |
|
|
679 |
|
<dl> |
680 |
** Children |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
681 |
|
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
682 |
[2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the element |
683 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
type definitions belonging to the <code>DocumentType</code> node.</p> |
684 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that |
|
685 |
contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
686 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
<code>NamedNodeMap</code> object that contains all the |
687 |
The attribute is read-only. |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
688 |
|
nodes belonging to the <code>DocumentType</code> node. The |
689 |
What are contained in this collection depends on how |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
690 |
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created. If the |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
691 |
node was created as the result of parsing of an XML document, |
object <em class=rfc2119>MUST</em> be live and the same object |
692 |
it [['''MUST''']] contain all element types whose element type and / or |
<em class=rfc2119>MUST</em> be returned for any invocation.</p> |
693 |
attribute definition list declaration are encountered by and provided for the DOM |
|
694 |
implementation from the XML processor. Note that the XML processor might not |
<p>If the <code>DocumentType</code> node is created during the process |
695 |
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 |
696 |
If more than one declarations for an element type or an attribute is available |
requirements are applied: The <code>NamedNodeMap</code> object in the |
697 |
at the time of the definition node construction, then declarations other than |
<a href="#elementTypes"><code>elementType</code></a> attribute |
698 |
the first ones [['''MUST''']] be discarded. |
<em class=rfc2119>MUST</em> be so transformed that the object contains |
699 |
|
the <code>ElementTypeDefinition</code> nodes for the element types |
700 |
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
whose name is presented as the <code>Name</code> of the element type or |
701 |
object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes |
attribute definition list declarations processed by the <abbr>XML</abbr> |
702 |
belong to the node. The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object |
processor. If there is more than one element type declarations for an |
703 |
[['''MUST''']] be read-only if and only if the node is read-only. |
element type, then the declarations other than the first one |
704 |
Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
705 |
and therefore any change of read-only flag on the node is immediately |
<code>NamedNodeMap</code> object.</p></dd> |
706 |
reflected by that of the object. |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
707 |
|
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
708 |
[3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the general |
709 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
entities belonging to the <code>DocumentType</code> node.</p> |
710 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the |
|
711 |
general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node. |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
712 |
The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
same value as the <code>entities</code> attribute (defined in the |
713 |
The attribute is read-only. |
<code>DocumentType</code> interface) of the same node.</p> |
714 |
|
|
715 |
|
<div class="note memo"> |
716 |
|
<p>This attribute is part of the interface for historical reason.</p> |
717 |
|
</div></dd> |
718 |
|
<!-- |
719 |
All entities declared in the document type definition |
All entities declared in the document type definition |
720 |
contained in or referenced from the document entity |
contained in or referenced from the document entity |
721 |
might not be exposed through this collection, depending |
might not be exposed through this collection, depending |
735 |
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 |
736 |
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 |
737 |
reflected by that of the object. |
reflected by that of the object. |
738 |
|
--> |
739 |
The attribute [['''MUST''']] return the same value as the |
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
740 |
[CODE(DOMa)@en[[[entites]]]] attribute of the |
<code>notations</code>, read$B!>(Bonly</code> |
741 |
[CODE(DOMi)@en[[[DocumentType]]]] interface on the same node. |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
742 |
|
notations belonging to the <code>DocumentType</code> node.</p> |
743 |
[4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]] |
|
744 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
745 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains |
same value as the <code>notations</code> attribute (defined in the |
746 |
all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<code>DocumentType</code> interface) of the same node.</p> |
747 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
|
748 |
The attribute is read-only. |
<div class="note memo"> |
749 |
|
<p>This attribute is part of the interface for historical reason.</p> |
750 |
|
<p>Implementations are not required to implement the |
751 |
|
<code>notations</code> attribute twice (for <code>DocumentType</code> |
752 |
|
and <code>DocumentTypeDefinition</code> interfaces); they share exactly |
753 |
|
same definition.</p> |
754 |
|
</div></dd> |
755 |
|
<!-- |
756 |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
757 |
created from an XML document, duplicate notation declarations, if any, in DTD |
created from an XML document, duplicate notation declarations, if any, in DTD |
758 |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
776 |
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 |
777 |
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 |
778 |
reflected by that of the object. |
reflected by that of the object. |
779 |
|
--> |
780 |
|
|
781 |
A DOM implementation is not required to implement the |
<dt class=ed>@@ other members... |
782 |
[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. |
|
783 |
|
|
784 |
|
<div class=ed> |
785 |
|
<p>A future version of this interface might define the |
786 |
|
<code>parameterEntities</code> and getter/setter for parameter entities. |
787 |
|
</div> |
788 |
|
|
|
** 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> |
|
789 |
</div> |
</div> |
790 |
|
|
791 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
792 |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
793 |
|
|
794 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<p>The nodes of type |
795 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
796 |
}</code></pre> |
represents an element type definition. Such a node implements the |
797 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
798 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
interface, which extends the <a href="#Node"><code>Node</code></a> |
799 |
|
interface.</p> |
800 |
|
|
801 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<p>An element type definition represents a definition of the element type. |
802 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
803 |
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
However, an |
804 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
805 |
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
does not represent the element type definition in <abbr>DTD</abbr> itself. |
806 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
Even if there are more than one element type declarations for an element type |
807 |
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
808 |
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
809 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] object. |
node for that element type. In addition, if there are attribute definition |
810 |
Note that it might be [CODE(IDL)@en[[[null]]]]. |
declarations for an element type, even when there is no element type |
811 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
812 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
813 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
node for that element type.</p> |
814 |
[['''MUST''']] return the name of the element type. |
|
815 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
816 |
[2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]] |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
817 |
and [CODE(DOMa)@en[[[textContent]]]] attributes |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
818 |
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]]]]. |
|
819 |
|
|
820 |
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
<span class=ed>@@ more</span> |
821 |
|
}</code></pre> |
822 |
|
|
823 |
[5] The |
<pre class=ed> |
824 |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
825 |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
826 |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
829 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
830 |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
831 |
|
|
832 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<p>The nodes of type |
833 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
834 |
|
represents an attribute definition. Such a node implements the |
835 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
836 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
837 |
|
|
838 |
|
<p>An attribute definition represents a definition of the attribute |
839 |
|
associated to an element type. It is corresponding to the attribute definition |
840 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
841 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
842 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
843 |
|
there are more than one attribute definitions for an attribute of an element |
844 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
845 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
846 |
|
that attribute.</p> |
847 |
|
|
848 |
|
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
849 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
850 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
851 |
|
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
852 |
|
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
853 |
|
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
854 |
|
const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2; |
855 |
|
const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3; |
856 |
|
const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4; |
857 |
|
const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5; |
858 |
|
const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6; |
859 |
|
const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7; |
860 |
|
const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8; |
861 |
|
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
862 |
|
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
863 |
|
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
864 |
|
|
865 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
866 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
867 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
868 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
869 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
870 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
871 |
|
|
872 |
}</code></pre> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
873 |
|
|
874 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
875 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
876 |
|
|
877 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<span class=ed>...</span> |
878 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
}</code></pre> |
|
[['''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]]]]. |
|
|
|
|
|
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
[['''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. |
|
879 |
|
|
880 |
@@ |
<dl> |
881 |
|
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
882 |
|
of type |
883 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
884 |
|
read$B!>(Bonly</dt> |
885 |
|
<dd><p>The |
886 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
887 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
888 |
|
node belongs.</p> |
889 |
|
|
890 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
891 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
892 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
893 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
894 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
895 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
896 |
|
node. If there is no such an |
897 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
898 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
899 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
900 |
|
<code>unsigned short</code></dt> |
901 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
902 |
|
It is expected that this attribute contains a value from the definition group |
903 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
904 |
|
|
905 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
906 |
|
value associated to this attribute.</p> |
907 |
|
|
908 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
909 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
910 |
|
exception if the |
911 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
912 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
913 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
914 |
|
associated to this attribute.</p> |
915 |
|
|
916 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
917 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
918 |
|
appropriate value from the |
919 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
920 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
921 |
|
|
922 |
|
<!-- DeclaredValueType --> |
923 |
|
<p>The definition group |
924 |
|
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
925 |
|
integers indicating the declared type of attributes. The definition |
926 |
|
group contains the following constants:</p> |
927 |
|
|
928 |
|
<table> |
929 |
|
<thead> |
930 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
931 |
|
</thead> |
932 |
|
<tbody> |
933 |
|
<tr> |
934 |
|
<th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code> |
935 |
|
<td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr> |
936 |
|
<tr> |
937 |
|
<th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code> |
938 |
|
<td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr> |
939 |
|
<tr> |
940 |
|
<th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code> |
941 |
|
<td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr> |
942 |
|
<tr> |
943 |
|
<th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code> |
944 |
|
<td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr> |
945 |
|
<tr> |
946 |
|
<th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code> |
947 |
|
<td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr> |
948 |
|
<tr> |
949 |
|
<th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code> |
950 |
|
<td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr> |
951 |
|
<tr> |
952 |
|
<th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code> |
953 |
|
<td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr> |
954 |
|
<tr> |
955 |
|
<th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code> |
956 |
|
<td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr> |
957 |
|
<tr> |
958 |
|
<th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code> |
959 |
|
<td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr> |
960 |
|
<tr> |
961 |
|
<th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code> |
962 |
|
<td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr> |
963 |
|
<tr> |
964 |
|
<th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code> |
965 |
|
<td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr> |
966 |
|
<tr> |
967 |
|
<th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code> |
968 |
|
<td><code>11</code><td>Unknown, because no declaration for the attribute |
969 |
|
has been read but the [all declaration processed] property |
970 |
|
<span class=ed>[INFOSET]</span> would be false.</tr> |
971 |
|
</tbody> |
972 |
|
</table> |
973 |
|
|
974 |
|
<p>If no attribute type information is available, or if the source |
975 |
|
of the information does not distinguish <q>no value</q> and <q>unknown</q> |
976 |
|
<span class=ed>[INFOSET]</span>, then the value |
977 |
|
<a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a> |
978 |
|
<em class=rfc2119>MUST</em> be used.</p> |
979 |
|
|
980 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<div class="note memo"> |
981 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
982 |
object [['''MUST''']] behave as if it were an |
created by the |
983 |
[CODE(DOMi)@en[[[Attr]]]] object. |
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
984 |
|
method has its <a href="#declaredType"><code>declaredType</code></a> attribute |
985 |
|
set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p> |
986 |
|
</div> |
987 |
|
|
988 |
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
<p>If the source of the information does not distinguish <q>no value</q> |
989 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
990 |
[['''MUST''']] behave as if the following algorithm |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
991 |
is performed: |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
992 |
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
be used.</p> |
993 |
object is read-only, then throw an |
|
994 |
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
995 |
= Remove any child node the node has. |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
996 |
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
997 |
then create a [CODE(DOMi)@en[[[Text]]]] node |
definition group.</p> |
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
|
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
|
998 |
|
|
999 |
** Definition groups |
</dd> |
1000 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1001 |
|
type <code>unsigned short</code></dt> |
1002 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
1003 |
|
attribute contains a value from the definition group |
1004 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1005 |
|
|
1006 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1007 |
|
the value associated to this attribute.</p> |
1008 |
|
|
1009 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1010 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1011 |
|
exception if the |
1012 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1013 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1014 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1015 |
|
associated to this attribute.</p> |
1016 |
|
|
1017 |
|
<p>If the |
1018 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1019 |
|
created during the process to create a <abbr>DOM</abbr> from an |
1020 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1021 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
1022 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1023 |
|
|
1024 |
|
<!-- DefaultValueType --> |
1025 |
|
<p>The definition group |
1026 |
|
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
1027 |
|
contains integers indicating the type of the default for the attribute. |
1028 |
|
The definition group contains the following constans:</p> |
1029 |
|
|
1030 |
|
<table> |
1031 |
|
<thead> |
1032 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1033 |
|
</thead> |
1034 |
|
<tbody> |
1035 |
|
<tr> |
1036 |
|
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
1037 |
|
<td><code>0</code><td>Unknown.</tr> |
1038 |
|
<tr> |
1039 |
|
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
1040 |
|
<td><code>1</code><td>Provided explicitly and fixed |
1041 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
1042 |
|
<tr> |
1043 |
|
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
1044 |
|
<td><code>2</code><td>No default value and the attribute have to be |
1045 |
|
explicitly specified.</tr> |
1046 |
|
<tr> |
1047 |
|
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
1048 |
|
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
1049 |
|
<tr> |
1050 |
|
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
1051 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
1052 |
|
</tbody> |
1053 |
|
</table> |
1054 |
|
|
1055 |
|
<p>If the source of the default type does not distinguish |
1056 |
|
implied and unknown default types, then the value |
1057 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
1058 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1059 |
|
|
1060 |
|
<div class="note memo"> |
1061 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1062 |
|
node created by the |
1063 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1064 |
|
method has its <a href="#defaultType"><code>defaultType</code></a> |
1065 |
|
attribute set to |
1066 |
|
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
1067 |
|
</div></dd> |
1068 |
|
</dl> |
1069 |
|
|
|
[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> |
|
1070 |
</div> |
</div> |
1071 |
|
|
1072 |
</div> |
</div> |