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> |
|
|
|
|
<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> |
|
539 |
</div> |
</div> |
540 |
|
|
541 |
</div> |
</div> |
543 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
544 |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
545 |
|
|
546 |
|
<p>The |
547 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
548 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
549 |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
550 |
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
551 |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
552 |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
553 |
|
|
554 |
<span class=ed>more members come here...</span> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
555 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
556 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
557 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
558 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
559 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
560 |
|
|
561 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
562 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
563 |
|
raises (DOMException); |
564 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
565 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
566 |
|
raises (DOMException); |
567 |
|
void <a href="#setNotationNode">setNotationNode</a> |
568 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
569 |
|
raises (DOMException); |
570 |
}</code></pre> |
}</code></pre> |
571 |
|
|
572 |
<pre class=ed> |
<pre class=ed> |
693 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
694 |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
695 |
|
|
696 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
697 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
698 |
}</code></pre> |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
699 |
|
readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
|
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
|
|
|
|
|
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
|
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
|
|
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
|
|
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] object. |
|
|
Note that it might be [CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
|
|
[['''MUST''']] return the name of the element type. |
|
|
|
|
|
[2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]] |
|
|
and [CODE(DOMa)@en[[[textContent]]]] attributes |
|
|
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
|
|
object [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
;; Thus, the setter of these attributes do nothing. |
|
|
|
|
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] |
|
|
attribute of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
|
|
object [['''MUST NOT''']] throw a |
|
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
700 |
|
|
701 |
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
<span class=ed>@@ more</span> |
702 |
|
}</code></pre> |
703 |
|
|
704 |
[5] The |
<pre class=ed> |
705 |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
706 |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
707 |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
710 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
711 |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
712 |
|
|
713 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
714 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
715 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
716 |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
717 |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
718 |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
727 |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
728 |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
729 |
|
|
730 |
<span class=ed>...</span> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
|
}</code></pre> |
|
|
|
|
|
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
|
731 |
|
|
732 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
733 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
734 |
|
|
735 |
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
<span class=ed>...</span> |
736 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
}</code></pre> |
|
[['''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. |
|
737 |
|
|
738 |
[2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
<dl> |
739 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
740 |
[['''MUST''']] return the normalized default value |
of type |
741 |
of the attribute. |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
742 |
|
read$B!>(Bonly</dt> |
743 |
|
<dd><p>The |
744 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
745 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
746 |
|
node belongs.</p> |
747 |
|
|
748 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
749 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
750 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
751 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
752 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
753 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
754 |
|
node. If there is no such an |
755 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
756 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
757 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
758 |
|
<code>unsigned short</code></dt> |
759 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
760 |
|
It is expected that this attribute contains a value from the definition group |
761 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
762 |
|
|
763 |
@@ |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
764 |
|
value associated to this attribute.</p> |
765 |
|
|
766 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
767 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
768 |
object [['''MUST''']] behave as if it were an |
exception if the |
769 |
[CODE(DOMi)@en[[[Attr]]]] object. |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
770 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
771 |
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
<em class=rfc2119>MUST</em> set the specified value as the value |
772 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
associated to this attribute.</p> |
773 |
[['''MUST''']] behave as if the following algorithm |
|
774 |
is performed: |
<p>If the <code>AttributeDefinition</code> node is created during the process |
775 |
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
776 |
object is read-only, then throw an |
appropriate value from the |
777 |
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
778 |
= Remove any child node the node has. |
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
|
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
|
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
|
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
|
|
</pre> |
|
779 |
|
|
780 |
|
<!-- DeclaredValueType --> |
781 |
<p>The definition group |
<p>The definition group |
782 |
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
783 |
integers indicating the declared type of attributes.</p> |
integers indicating the declared type of attributes. The definition |
784 |
|
group contains the following constants:</p> |
785 |
|
|
786 |
<table> |
<table> |
787 |
<thead> |
<thead> |
844 |
</div> |
</div> |
845 |
|
|
846 |
<p>If the source of the information does not distinguish <q>no value</q> |
<p>If the source of the information does not distinguish <q>no value</q> |
847 |
and/or <code>unknown</code> <span class=ed>[INFOSET]</span> and |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
848 |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
849 |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
850 |
be used.</p> |
be used.</p> |
852 |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
853 |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
854 |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
855 |
constant group.</p> |
definition group.</p> |
856 |
|
|
857 |
|
</dd> |
858 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
859 |
|
type <code>unsigned short</code></dt> |
860 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
861 |
|
attribute contains a value from the definition group |
862 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
863 |
|
|
864 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
865 |
|
the value associated to this attribute.</p> |
866 |
|
|
867 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
868 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
869 |
|
exception if the |
870 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
871 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
872 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
873 |
|
associated to this attribute.</p> |
874 |
|
|
875 |
|
<p>If the |
876 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
877 |
|
created during the process to create a <abbr>DOM</abbr> from an |
878 |
|
<abbr>XML</abbr> document, an appropriate value from the |
879 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
880 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
881 |
|
|
882 |
|
<!-- DefaultValueType --> |
883 |
|
<p>The definition group |
884 |
|
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
885 |
|
contains integers indicating the type of the default for the attribute. |
886 |
|
The definition group contains the following constans:</p> |
887 |
|
|
888 |
|
<table> |
889 |
|
<thead> |
890 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
891 |
|
</thead> |
892 |
|
<tbody> |
893 |
|
<tr> |
894 |
|
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
895 |
|
<td><code>0</code><td>Unknown.</tr> |
896 |
|
<tr> |
897 |
|
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
898 |
|
<td><code>1</code><td>Provided explicitly and fixed |
899 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
900 |
|
<tr> |
901 |
|
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
902 |
|
<td><code>2</code><td>No default value and the attribute have to be |
903 |
|
explicitly specified.</tr> |
904 |
|
<tr> |
905 |
|
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
906 |
|
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
907 |
|
<tr> |
908 |
|
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
909 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
910 |
|
</tbody> |
911 |
|
</table> |
912 |
|
|
913 |
|
<p>If the source of the default type does not distinguish |
914 |
|
implied and unknown default types, then the value |
915 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
916 |
|
<em class=rfc2119>MUST</em> be used.</p> |
917 |
|
|
918 |
|
<div class="note memo"> |
919 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
920 |
|
node created by the |
921 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
922 |
|
method has its <a href="#defaultType"><code>defaultType</code></a> |
923 |
|
attribute set to |
924 |
|
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
925 |
|
</div></dd> |
926 |
|
</dl> |
927 |
|
|
928 |
|
</div> |
929 |
|
|
930 |
|
<div class=section id=section-documenttype> |
931 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
932 |
|
Interface</h3> |
933 |
|
|
934 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
935 |
|
<em class=rfc2119>MAY</em> contain zero or more |
936 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
937 |
|
nodes in the <code>NodeList</code> object contained in the |
938 |
|
<code>childNodes</code> attribute of the |
939 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
940 |
|
|
941 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
942 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
943 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
944 |
|
object <em class=rfc2119>MUST</em> contains the |
945 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
946 |
|
nodes representing the processing instructions in the document type |
947 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
948 |
|
the <abbr>XML</abbr> processor. If the |
949 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
950 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
951 |
|
also be marked as read$B!>(Bonly.</p> |
952 |
|
|
953 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
954 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
955 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
956 |
|
of the node <em class=rfc2119>MUST</em> contain the |
957 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
958 |
|
created from the processing instruction information items in the list in the |
959 |
|
[children] property of the document type declaration item in the same |
960 |
|
order.</p> |
961 |
|
|
962 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
963 |
|
a document type declaration information item, the list in the [children] |
964 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
965 |
|
information items created from the |
966 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
967 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
968 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
969 |
|
|
970 |
|
<p>The implementation of the |
971 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
972 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
973 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
974 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
975 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
976 |
|
|
977 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
978 |
|
</code></pre> |
979 |
|
|
980 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
981 |
|
<code id=systemId>systemId</code> attribute of |
982 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
983 |
|
<a href="#Entity"><code>Entity</code></a>, and |
984 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
985 |
|
read$B!>(Bonly.</p> |
986 |
|
|
987 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
988 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
989 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
990 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
991 |
|
associated to the attribute. No normalization, relative reference resolution, |
992 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
993 |
|
value is <code>null</code>, ...</span></p> |
994 |
|
|
995 |
|
<div class="note memo"> |
996 |
|
<p>Setting an invalid identifier might make the node unserializable. |
997 |
|
Setting a public identifier while leaveing system identifier unspecified |
998 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
999 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
1000 |
|
</div> |
1001 |
|
|
1002 |
|
<div class=ed> |
1003 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
1004 |
|
</div> |
1005 |
|
|
1006 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
1007 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
1008 |
|
read$B!>(Bonly.</p> |
1009 |
|
|
1010 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1011 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1012 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1013 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
1014 |
|
associated to the attribute. No normalization, or lexical validation is |
1015 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
1016 |
|
...</span></p> |
1017 |
|
|
|
<pre class=ed> |
|
|
[7] The |
|
|
[DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]] |
|
|
contains integers indicating the type of |
|
|
default attribute value: |
|
|
,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown. |
|
|
,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value. |
|
|
,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute. |
|
|
,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]]. |
|
|
,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it. |
|
|
|
|
|
The type of these constants are |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
|
|
|
|
|
If the source of the attribute default value type |
|
|
does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]] |
|
|
default and unknown default, then the |
|
|
[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value |
|
|
[['''MUST''']] be used. |
|
|
|
|
|
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
|
|
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
|
|
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
|
|
|
|
|
** 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> |
|
1018 |
</div> |
</div> |
1019 |
|
|
1020 |
</div> |
</div> |