10 |
|
|
11 |
<div class="header"> |
<div class="header"> |
12 |
<h1>DOM Document Type Definition Module</h1> |
<h1>DOM Document Type Definition Module</h1> |
13 |
<h2>Working Draft <time datetime=2007-12-01>1 December 2007</time></h2> |
<h2>Working Draft <time datetime=2007-12-04>4 December 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
125 |
interface.</p> |
interface.</p> |
126 |
|
|
127 |
<p class=ed>@@ ref to DOM Binding Spec</p> |
<p class=ed>@@ ref to DOM Binding Spec</p> |
128 |
|
|
129 |
|
<p>If the <code>strictErrorChecking</code> attribute of the |
130 |
|
<code>Document</code> node is <code>false</code>, the methods are |
131 |
|
not required to raise exceptions <span class=ed>[DOM3]</span>.</p> |
132 |
|
|
133 |
|
<div class=ed> |
134 |
|
<p>Conformant product classes: implementation, XML parser (XML document -> |
135 |
|
DOM converter), XML serializer (DOM -> XML document covnerter). |
136 |
|
XML Infoset -> DOM converter, and DOM -> XML Infoset converter.</p> |
137 |
|
</div> |
138 |
</div> |
</div> |
139 |
|
|
140 |
<div class=section id=dom-dtdef> |
<div class=section id=dom-dtdef> |
149 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
150 |
</ul> |
</ul> |
151 |
|
|
152 |
<p>In addition, it adds methods, attributes, and/or constants to interfaces |
<p>In addition, it modifies interfaces |
153 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
154 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
155 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Entity"><code>Entity</code></a>, |
156 |
<a href="#EntityReference"><code>EntityReference</code></a>, and |
<a href="#EntityReference"><code>EntityReference</code></a>, |
157 |
<a href="#Notation"><code>Notation</code></a>. |
<a href="#Notation"><code>Notation</code></a>, and |
158 |
It modifies semantics of some of methods and attributes in |
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>.</p> |
|
<a href="#Node"><code>Node</code></a> and |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
|
|
interfaces, for the support of new interfaces.</p> |
|
159 |
|
|
160 |
<div class=section id=features> |
<div class=section id=features> |
161 |
<h3>Feature Name</h3> |
<h3>Feature Name</h3> |
180 |
aforementioned cases.</p> |
aforementioned cases.</p> |
181 |
</div> |
</div> |
182 |
|
|
183 |
|
<div class=section id=section-node> |
184 |
|
<h3>Modifications to the <code id=Node>Node</code> Interface</h3> |
185 |
|
|
186 |
|
<p>The implementation of the |
187 |
|
<a href="#Node"><code>Node</code></a> interface |
188 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
189 |
|
<pre class=idl><code>// Additions to the Node interface |
190 |
|
|
191 |
|
// Additions to the NodeType definition group |
192 |
|
const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001; |
193 |
|
const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002; |
194 |
|
</pre> |
195 |
|
|
196 |
|
<p>This specification adds two new types (subinterfaces) of |
197 |
|
<a href="#Node"><code>Node</code></a>: element type definition (node type |
198 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>, |
199 |
|
interface |
200 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and |
201 |
|
attribute definition (node type |
202 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>, |
203 |
|
interface |
204 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For |
205 |
|
these kinds of nodes, methods and attributes in the |
206 |
|
<a href="#Node"><code>Node</code></a> interface must behave as following:</p> |
207 |
|
|
208 |
|
<dl> |
209 |
|
<dt><code id=attributes>attributes</code></dt> |
210 |
|
<dd> |
211 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
212 |
|
<code>null</code>.</p> |
213 |
|
</dd> |
214 |
|
<dt><code id=baseURI>baseURI</code></dt> |
215 |
|
<dd> |
216 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
217 |
|
value of the <a href="#baseURI"><code>baseURI</code></a> attribute |
218 |
|
of the node in the <code>ownerDocument</code> attribute of the node. |
219 |
|
Note that the value might be <code>null</code>.</p> |
220 |
|
</dd> |
221 |
|
<dt><code id=nodeName>nodeName</code></dt> |
222 |
|
<dd> |
223 |
|
<p>If the node is an |
224 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
225 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
226 |
|
name of the element type definition represented by the node.</p> |
227 |
|
|
228 |
|
<p>If the node is an |
229 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
230 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
231 |
|
name of the attribute definition represented by the node.</p> |
232 |
|
</dd> |
233 |
|
<dt><code id=nodeType>nodeType</code></dt> |
234 |
|
<dd> |
235 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
236 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
237 |
|
(if the node is an |
238 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or |
239 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
240 |
|
(if the node is an |
241 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p> |
242 |
|
|
243 |
|
<!-- NodeType --> |
244 |
|
<p>Two constants are added to the <code id=NodeType>NodeType</code> |
245 |
|
definition group of the <a href="#Node"><code>Node</code></a> interface as |
246 |
|
following:</p> |
247 |
|
<table> |
248 |
|
<thead> |
249 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
250 |
|
</thead> |
251 |
|
<tbody> |
252 |
|
<tr> |
253 |
|
<th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn> |
254 |
|
<td><code>81001</code><td>The node is an |
255 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr> |
256 |
|
<tr> |
257 |
|
<th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn> |
258 |
|
<td><code>81002</code><td>The node is an |
259 |
|
<a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr> |
260 |
|
</tbody> |
261 |
|
</table> |
262 |
|
</dd> |
263 |
|
<dt><code id=nodeValue>nodeValue</code> and |
264 |
|
<code id=textContent>textContent</code></dt> |
265 |
|
<dd> |
266 |
|
<p>If the node is an |
267 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
268 |
|
On getting, the attributes <em class=rfc2119>MUST</em> return the |
269 |
|
name of the element type.</p> |
270 |
|
|
271 |
|
<div class="note memo"> |
272 |
|
<p>Thus, on setting the attributes does nothing |
273 |
|
<span class=ed>[DOM3]</span>.</p> |
274 |
|
</div> |
275 |
|
|
276 |
|
<p>On setting, the <a href="#textContent"><code>textContent</code></a> |
277 |
|
attribute <em class=rfc2119>MUST NOT</em> raise a |
278 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
279 |
|
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
280 |
|
|
281 |
|
<p>If the node is an |
282 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p> |
283 |
|
|
284 |
|
<pre class=ed> |
285 |
|
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
286 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
287 |
|
[['''MUST''']] return the normalized default value |
288 |
|
of the attribute. |
289 |
|
|
290 |
|
@@ |
291 |
|
|
292 |
|
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
293 |
|
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
294 |
|
object [['''MUST''']] behave as if it were an |
295 |
|
[CODE(DOMi)@en[[[Attr]]]] object. |
296 |
|
|
297 |
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
298 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
299 |
|
[['''MUST''']] behave as if the following algorithm |
300 |
|
is performed: |
301 |
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
302 |
|
object is read-only, then throw an |
303 |
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
304 |
|
= Remove any child node the node has. |
305 |
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
306 |
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
307 |
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
308 |
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
309 |
|
</pre> |
310 |
|
</dd> |
311 |
|
<dt class=ed>@@ ...</dt> |
312 |
|
</dl> |
313 |
|
|
314 |
|
</div> |
315 |
|
|
316 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
317 |
<h2>The <code>DocumentXDoctype</code> Interface</h2> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
318 |
|
|
319 |
|
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
320 |
|
<em class=rfc2119>MUST</em> be implemented as following:</p> |
321 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
322 |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
323 |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
324 |
raises (DOMException); |
raises (DOMException); |
325 |
ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
326 |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
327 |
raises (DOMException); |
raises (DOMException); |
328 |
AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a> |
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
329 |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
330 |
raises (DOMException); |
raises (DOMException); |
331 |
Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
332 |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
333 |
raises (DOMException); |
raises (DOMException); |
334 |
Notation <a href="#createNotation">createNotation</a> |
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
335 |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
336 |
raises (DOMException); |
raises (DOMException); |
337 |
}</code></pre> |
}</code></pre> |
382 |
<p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn> |
<p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn> |
383 |
parameter is the name of the element type defined by the element |
parameter is the name of the element type defined by the element |
384 |
type definition.</p> |
type definition.</p> |
385 |
|
|
386 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
387 |
|
return an |
388 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
389 |
|
node with the following attributes:</p> |
390 |
|
<dl> |
391 |
|
<dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt> |
392 |
|
<dd>An empty <code>NamedNodeMap</code> object.</dd> |
393 |
|
<dt><code>attributes</code>, <code>parentNode</code></dt> |
394 |
|
<dd><code>null</code>.</dd> |
395 |
|
<dt><code>childNodes</code></dt> |
396 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
397 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
398 |
|
<dd><code>false</code>.</dd> |
399 |
|
<dt><code>nodeName</code></dt> |
400 |
|
<dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd> |
401 |
|
<dt><code>ownerDocument</code></dt> |
402 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
403 |
|
<dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt> |
404 |
|
<dd><code>null</code>.</dd> |
405 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
406 |
|
</dl> |
407 |
</dd> |
</dd> |
408 |
<dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>, |
<dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>, |
409 |
method</dt> |
method</dt> |
413 |
<p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn> |
<p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn> |
414 |
parameter is the name of the attribute defined by the attribute |
parameter is the name of the attribute defined by the attribute |
415 |
definition.</p> |
definition.</p> |
416 |
|
|
417 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
418 |
|
return an |
419 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
420 |
|
node with the following attributes:</p> |
421 |
|
<dl> |
422 |
|
<dt><code>allowedTokens</code></dt> |
423 |
|
<dd>An empty <code>DOMStringList</code> object.</dd> |
424 |
|
<dt><code>attributes</code>, |
425 |
|
<a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>, |
426 |
|
and <code>parentNode</code></dt> |
427 |
|
<dd><code>null</code>.</dd> |
428 |
|
<dt><code>childNodes</code></dt> |
429 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
430 |
|
<dt><code>declaredType</code></dt> |
431 |
|
<dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd> |
432 |
|
<dt><code>defaultType</code></dt> |
433 |
|
<dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd> |
434 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
435 |
|
<dd><code>false</code>.</dd> |
436 |
|
<dt><code>nodeName</code></dt> |
437 |
|
<dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd> |
438 |
|
<dt><code>ownerDocument</code></dt> |
439 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
440 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
441 |
|
</dl> |
442 |
|
|
443 |
|
<div class=ed> |
444 |
|
<p>@@ Should we keep these statements?: |
445 |
|
However, if the <cfg::cfg|xml-id> configuration |
446 |
|
parameter is set to <code>true</code> and the <var>name</var> |
447 |
|
is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]] |
448 |
|
attribute is set to <code>ID_ATTR</code>. |
449 |
|
[CODE(DOMa)@en[[[defaultType]]]]?</p> |
450 |
|
</div> |
451 |
</dd> |
</dd> |
452 |
<dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>, |
<dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>, |
453 |
method</dt> |
method</dt> |
454 |
<dd> |
<dd> |
455 |
<p>This method creates a <code>Entity</code> node with the |
<p>This method creates a <a href="#Entity"><code>Entity</code></a> node |
456 |
specified name, which represents a general entity, belonging to the |
with the specified name, which represents a general entity, belonging to |
457 |
document.</p> |
the document.</p> |
458 |
<p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn> |
<p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn> |
459 |
parameter is the name of the general entity.</p> |
parameter is the name of the general entity.</p> |
460 |
|
|
461 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
462 |
|
an <a href="#Entity"><code>Entity</code></a> node with the following |
463 |
|
attributes:</p> |
464 |
|
<dl> |
465 |
|
<dt><code>attributes</code>, <code>notationName</code>, |
466 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
467 |
|
and <code>parentNode</code></dt> |
468 |
|
<dd><code>null</code>.</dd> |
469 |
|
<dt><code>childNodes</code></dt> |
470 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
471 |
|
<dt><code>manakaiDeclarationBaseURI</code>, |
472 |
|
<code>manakaiEntityBaseURI</code>, and |
473 |
|
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
474 |
|
<dd>No explicit value is set.</dd> |
475 |
|
<dt><code>manakaiHasReplacementTree</code> and |
476 |
|
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
477 |
|
<dd><code>false</code>.</dd> |
478 |
|
<dt><code>nodeName</code></dt> |
479 |
|
<dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd> |
480 |
|
<dd> |
481 |
|
<div class="note memo"> |
482 |
|
<p>It is not an error for |
483 |
|
<a href="#createGeneralEntity-name"><var>name</var></a> matching |
484 |
|
to the name of one of predefined general parsed entities in |
485 |
|
<abbr>XML</abbr> or <abbr>HTML</abbr>. For example, |
486 |
|
<a href="#createGeneralEntity-name"><var>name</var></a> might be |
487 |
|
<code>amp</code>, resulting in an |
488 |
|
<a href="#Entity"><code>Entity</code></a> node |
489 |
|
with its <code>nodeName</code> attribute set to <code>amp</code>.</p> |
490 |
|
</div> |
491 |
|
</dd> |
492 |
|
<dt><code>ownerDocument</code></dt> |
493 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
494 |
|
<dt><code>publicId</code>, and <code>systemId</code></dt> |
495 |
|
<dd><code>null</code>.</dd> |
496 |
|
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
497 |
|
<dt class=ed>@@ Ensure all attributes are defined</dd> |
498 |
|
</dl> |
499 |
</dd> |
</dd> |
500 |
<dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>, |
<dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>, |
501 |
method</dt> |
method</dt> |
504 |
specified name, belonging to the document.</p> |
specified name, belonging to the document.</p> |
505 |
<p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn> |
<p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn> |
506 |
parameter is the name of the notation.</p> |
parameter is the name of the notation.</p> |
507 |
|
|
508 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
509 |
|
a <code>Notation</code> node with the following attributes:</p> |
510 |
|
<dl> |
511 |
|
<dt><code>attributes</code>, |
512 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
513 |
|
and <code>parentNode</code></dt> |
514 |
|
<dd><code>null</code>.</dd> |
515 |
|
<dt><code>childNodes</code></dt> |
516 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
517 |
|
<dt><code>manakaiDeclarationBaseURI</code></dt> |
518 |
|
<dd>No explicit value is set.</dd> |
519 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
520 |
|
<dd><code>false</code>.</dd> |
521 |
|
<dt><code>nodeName</code></dt> |
522 |
|
<dd><a href="#createNotation-name"><var>name</var></a>.</dd> |
523 |
|
<dt><code>ownerDocument</code></dt> |
524 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
525 |
|
<dt><code>publicId</code> and <code>systemId</code></dt> |
526 |
|
<dd><code>null</code>.</dd> |
527 |
|
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
528 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
529 |
|
</dl> |
530 |
</dd> |
</dd> |
531 |
</dl> |
</dl> |
532 |
|
|
533 |
<pre class=ed> |
<p>These methods <em class=rfc2119>MUST</em> raise an |
534 |
|
<code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span> |
535 |
|
if <var>name</var> is <em>not</em> a legal <code>Name</code> according to |
536 |
|
the <abbr>XML</abbr> version in use, as specified in the |
537 |
|
<code>xmlVersion</code> attribute of the <code>Document</code> node.</p> |
538 |
|
|
539 |
|
<div class="note memo"> |
540 |
|
<p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now, |
541 |
|
since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not |
542 |
|
define it for <code>Document</code> methods.</p> |
543 |
|
|
544 |
[8] |
<p><var>name</var> does not have to be a namespace qualified name.</p> |
545 |
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]] |
</div> |
|
method [['''MUST''']] create an |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
|
|
object with the following attribute values: |
|
|
- [CODE(DOMa)@en[[[attributeDefinitions]]]]: |
|
|
An empty [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
|
|
- [CODE(DOMa)@en[[[attributes]]]], |
|
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
|
|
[CODE(DOMi)@en[[[NodeList]]]]. |
|
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
|
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
|
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
|
|
is invoked. |
|
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
|
|
[CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
@@ Ensure all attributes are defined |
|
|
|
|
|
[9] The [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
|
|
method [['''MUST''']] create an |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object with the following attribute values: |
|
|
- [CODE(DOMa)@en[[[allowedTokens]]]]: |
|
|
An empty [CODE(DOMi)@en[[[DOMStringList]]]]. |
|
|
- [CODE(DOMa)@en[[[attributes]]]], |
|
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
|
|
[CODE(DOMi)@en[[[NodeList]]]]. |
|
|
- [CODE(DOMa)@en[[[declaredType]]]]: |
|
|
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
|
|
- [CODE(DOMa)@en[[[defaultType]]]]: |
|
|
[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]]. |
|
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
|
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
|
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
|
|
is invoked. |
|
|
- [CODE(DOMa)@en[[[ownerElementTypeDefinition]]]]: |
|
|
[CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
@@ Ensure all attributes are defined |
|
|
|
|
|
@@ Should we keep these statements?: |
|
|
However, if the <cfg::cfg|xml-id> configuration |
|
|
parameter is set to <DOM::true> and the <P::name> |
|
|
is <XA::xml:id>, then the [CODE(DOMa)@en[[[declaredType]]]] |
|
|
attribute is set to |
|
|
<C::AttributeDefinition.ID_ATTR>. |
|
|
[CODE(DOMa)@en[[[defaultType]]]]? |
|
|
|
|
|
[11] The [CODE(DOMm)@en[[[createGeneralEntity]]]] |
|
|
method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]] |
|
|
node with the following attribute values: |
|
|
- [CODE(DOMa)@en[[[attributes]]]], |
|
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
|
|
[CODE(DOMi)@en[[[NodeList]]]]. |
|
|
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
|
|
No explicit value is set. |
|
|
- [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]: |
|
|
No explicit value is set. |
|
|
- [CODE(DOMa)@en[[[manakaiEntityURI]]]]: |
|
|
No explicit value is set. |
|
|
- [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
|
|
- [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
|
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
|
|
is invoked. |
|
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
|
|
[CODE(IDL)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
|
|
|
@@ Ensure all attributes are defined |
|
|
|
|
|
@@ publicId and systemId should be empty string? |
|
|
|
|
|
[13] The [CODE(DOMm)@en[[[createNotation]]]] |
|
|
method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]] |
|
|
node with the following attribute values: |
|
|
- [CODE(DOMa)@en[[[attributes]]]], |
|
|
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
|
|
[CODE(DOMi)@en[[[NodeList]]]]. |
|
|
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
|
|
No explicit value is set. |
|
|
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
|
|
[CODE(IDL)@en[[[false]]]]. |
|
|
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
|
|
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
|
|
[CODE(DOMi)@en[[[Document]]]] node on which the method |
|
|
is invoked. |
|
|
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
|
|
[CODE(IDL)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
|
|
|
|
|
@@ Ensure all attributes are defined |
|
|
|
|
|
[7] |
|
|
These method [['''MUST''']] raise an |
|
|
[CODE(DOMi)@en[[[INVALID_CHARACTER_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] |
|
|
if the [CODE(DOMp)@en[[[name]]]] is not a legal |
|
|
name according to the XML version in use as |
|
|
specified in the [CODE(DOMa)@en[[[xmlVersion]]]] |
|
|
attribute of the [CODE(DOMi)@en[[[Document]]]] node. |
|
|
|
|
|
;; Non-XML case is intentionally left unspecified for now |
|
|
since DOM3 does not define it. |
|
|
|
|
|
;; [CODE(DOMp)@en[[[name]]]] does not have to |
|
|
be a namespace qualified name. |
|
|
|
|
|
;; Note also that it is not an error for the |
|
|
[CODE(DOMp)@en[[[name]]]] parameter value |
|
|
to match to the name of one of predefined general |
|
|
parsed entities in XML or HTML. |
|
|
|
|
|
;; If the [CODE(DOMa)@en[[[strictErrorChecking]]]] attribute |
|
|
is set to [CODE(IDL)@en[[[false]]]], then the implementation |
|
|
is not required to raise this exception. |
|
546 |
|
|
547 |
Otherwise, these method [['''MUST''']] return |
</div> |
548 |
the newly created node. |
|
549 |
</pre> |
|
550 |
|
<div class=section id=section-documenttype> |
551 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
552 |
|
Interface</h3> |
553 |
|
|
554 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
555 |
|
<em class=rfc2119>MAY</em> contain zero or more |
556 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
557 |
|
nodes in the <code>NodeList</code> object contained in the |
558 |
|
<code>childNodes</code> attribute of the |
559 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
560 |
|
|
561 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
562 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
563 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
564 |
|
object <em class=rfc2119>MUST</em> contains the |
565 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
566 |
|
nodes representing the processing instructions in the document type |
567 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
568 |
|
the <abbr>XML</abbr> processor. If the |
569 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
570 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
571 |
|
also be marked as read$B!>(Bonly.</p> |
572 |
|
|
573 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
574 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
575 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
576 |
|
of the node <em class=rfc2119>MUST</em> contain the |
577 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
578 |
|
created from the processing instruction information items in the list in the |
579 |
|
[children] property of the document type declaration item in the same |
580 |
|
order.</p> |
581 |
|
|
582 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
583 |
|
a document type declaration information item, the list in the [children] |
584 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
585 |
|
information items created from the |
586 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
587 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
588 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
589 |
|
|
590 |
|
<p>The implementation of the |
591 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
592 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
593 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
594 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
595 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
596 |
|
|
597 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
598 |
|
</code></pre> |
599 |
|
|
600 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
601 |
|
<code id=systemId>systemId</code> attribute of |
602 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
603 |
|
<a href="#Entity"><code>Entity</code></a>, and |
604 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
605 |
|
read$B!>(Bonly.</p> |
606 |
|
|
607 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
608 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
609 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
610 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
611 |
|
associated to the attribute. No normalization, relative reference resolution, |
612 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
613 |
|
value is <code>null</code>, ...</span></p> |
614 |
|
|
615 |
|
<div class="note memo"> |
616 |
|
<p>Setting an invalid identifier might make the node unserializable. |
617 |
|
Setting a public identifier while leaveing system identifier unspecified |
618 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
619 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
620 |
|
</div> |
621 |
|
|
622 |
|
<div class=ed> |
623 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
624 |
|
</div> |
625 |
|
|
626 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
627 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
628 |
|
read$B!>(Bonly.</p> |
629 |
|
|
630 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
631 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
632 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
633 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
634 |
|
associated to the attribute. No normalization, or lexical validation is |
635 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
636 |
|
...</span></p> |
637 |
|
|
638 |
</div> |
</div> |
639 |
|
|
640 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
641 |
<h2>The <code>DocumentTypeDefinition</code> Interface</h2> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
642 |
|
|
643 |
|
<div class="note memo"> |
644 |
|
<p>This interface is a separated interface from the |
645 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
646 |
|
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
647 |
|
for the historical reason.</p> |
648 |
|
</div> |
649 |
|
|
650 |
|
<p>The |
651 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
652 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
653 |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
654 |
|
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
655 |
|
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
656 |
|
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
657 |
|
|
658 |
|
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
659 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
660 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
661 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
662 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
663 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
664 |
|
|
665 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
666 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
667 |
|
raises (DOMException); |
668 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
669 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
670 |
|
raises (DOMException); |
671 |
|
void <a href="#setNotationNode">setNotationNode</a> |
672 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
673 |
|
raises (DOMException); |
674 |
}</code></pre> |
}</code></pre> |
675 |
|
|
676 |
<pre class=ed> |
<pre class=ed> |
680 |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
681 |
interface. See [[DOM XML Document Type Definition]>>3] for |
interface. See [[DOM XML Document Type Definition]>>3] for |
682 |
details. |
details. |
683 |
|
</pre> |
684 |
|
|
685 |
|
<dl> |
686 |
** Children |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
687 |
|
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
688 |
[2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the element |
689 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
type definitions belonging to the <code>DocumentType</code> node.</p> |
690 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that |
|
691 |
contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
692 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
<code>NamedNodeMap</code> object that contains all the |
693 |
The attribute is read-only. |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
694 |
|
nodes belonging to the <code>DocumentType</code> node. The |
695 |
What are contained in this collection depends on how |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
696 |
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created. If the |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
697 |
node was created as the result of parsing of an XML document, |
object <em class=rfc2119>MUST</em> be live and the same object |
698 |
it [['''MUST''']] contain all element types whose element type and / or |
<em class=rfc2119>MUST</em> be returned for any invocation.</p> |
699 |
attribute definition list declaration are encountered by and provided for the DOM |
|
700 |
implementation from the XML processor. Note that the XML processor might not |
<p>If the <code>DocumentType</code> node is created during the process |
701 |
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 |
702 |
If more than one declarations for an element type or an attribute is available |
requirements are applied: The <code>NamedNodeMap</code> object in the |
703 |
at the time of the definition node construction, then declarations other than |
<a href="#elementTypes"><code>elementType</code></a> attribute |
704 |
the first ones [['''MUST''']] be discarded. |
<em class=rfc2119>MUST</em> be so transformed that the object contains |
705 |
|
the <code>ElementTypeDefinition</code> nodes for the element types |
706 |
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
whose name is presented as the <code>Name</code> of the element type or |
707 |
object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes |
attribute definition list declarations processed by the <abbr>XML</abbr> |
708 |
belong to the node. The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object |
processor. If there is more than one element type declarations for an |
709 |
[['''MUST''']] be read-only if and only if the node is read-only. |
element type, then the declarations other than the first one |
710 |
Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
711 |
and therefore any change of read-only flag on the node is immediately |
<code>NamedNodeMap</code> object.</p></dd> |
712 |
reflected by that of the object. |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
713 |
|
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
714 |
[3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the general |
715 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
entities belonging to the <code>DocumentType</code> node.</p> |
716 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the |
|
717 |
general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node. |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
718 |
The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
same value as the <code>entities</code> attribute (defined in the |
719 |
The attribute is read-only. |
<code>DocumentType</code> interface) of the same node.</p> |
720 |
|
|
721 |
|
<div class="note memo"> |
722 |
|
<p>This attribute is part of the interface for historical reason.</p> |
723 |
|
</div></dd> |
724 |
|
<!-- |
725 |
All entities declared in the document type definition |
All entities declared in the document type definition |
726 |
contained in or referenced from the document entity |
contained in or referenced from the document entity |
727 |
might not be exposed through this collection, depending |
might not be exposed through this collection, depending |
741 |
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 |
742 |
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 |
743 |
reflected by that of the object. |
reflected by that of the object. |
744 |
|
--> |
745 |
The attribute [['''MUST''']] return the same value as the |
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
746 |
[CODE(DOMa)@en[[[entites]]]] attribute of the |
<code>notations</code>, read$B!>(Bonly</code> |
747 |
[CODE(DOMi)@en[[[DocumentType]]]] interface on the same node. |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
748 |
|
notations belonging to the <code>DocumentType</code> node.</p> |
749 |
[4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]] |
|
750 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
751 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains |
same value as the <code>notations</code> attribute (defined in the |
752 |
all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<code>DocumentType</code> interface) of the same node.</p> |
753 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
|
754 |
The attribute is read-only. |
<div class="note memo"> |
755 |
|
<p>This attribute is part of the interface for historical reason.</p> |
756 |
|
<p>Implementations are not required to implement the |
757 |
|
<code>notations</code> attribute twice (for <code>DocumentType</code> |
758 |
|
and <code>DocumentTypeDefinition</code> interfaces); they share exactly |
759 |
|
same definition.</p> |
760 |
|
</div></dd> |
761 |
|
<!-- |
762 |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
763 |
created from an XML document, duplicate notation declarations, if any, in DTD |
created from an XML document, duplicate notation declarations, if any, in DTD |
764 |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
782 |
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 |
783 |
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 |
784 |
reflected by that of the object. |
reflected by that of the object. |
785 |
|
--> |
786 |
|
|
787 |
A DOM implementation is not required to implement the |
<dt class=ed>@@ other members... |
788 |
[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. |
|
789 |
|
|
790 |
|
<div class=ed> |
791 |
|
<p>A future version of this interface might define the |
792 |
|
<code>parameterEntities</code> and getter/setter for parameter entities. |
793 |
|
</div> |
794 |
|
|
|
** 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> |
|
795 |
</div> |
</div> |
796 |
|
|
797 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
798 |
<h2>The <code>ElementTypeDefinition</code> Interface</h2> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
|
|
|
|
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
|
|
|
|
|
}</code></pre> |
|
799 |
|
|
800 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
<p>The nodes of type |
801 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
802 |
|
represents an element type definition. Such a node implements the |
803 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
804 |
|
interface, which extends the <a href="#Node"><code>Node</code></a> |
805 |
|
interface.</p> |
806 |
|
|
807 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<p>An element type definition represents a definition of the element type. |
808 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
809 |
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
However, an |
810 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
811 |
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
does not represent the element type definition in <abbr>DTD</abbr> itself. |
812 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
Even if there are more than one element type declarations for an element type |
813 |
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
814 |
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
815 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] object. |
node for that element type. In addition, if there are attribute definition |
816 |
Note that it might be [CODE(IDL)@en[[[null]]]]. |
declarations for an element type, even when there is no element type |
817 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
818 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
819 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
node for that element type.</p> |
820 |
[['''MUST''']] return the name of the element type. |
|
821 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
822 |
[2] The getters of the [CODE(DOMa)@en[[[nodeValue]]]] |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
823 |
and [CODE(DOMa)@en[[[textContent]]]] attributes |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
824 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
|
object [['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
|
|
|
|
;; Thus, the setter of these attributes do nothing. |
|
|
|
|
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] |
|
|
attribute of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
|
|
object [['''MUST NOT''']] throw a |
|
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
825 |
|
|
826 |
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
<span class=ed>@@ more</span> |
827 |
|
}</code></pre> |
828 |
|
|
829 |
[5] The |
<pre class=ed> |
830 |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
831 |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
832 |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
833 |
</div> |
</div> |
834 |
|
|
835 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
836 |
<h2>The <code>AttributeDefinition</code> Interface</h2> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
837 |
|
|
838 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<p>The nodes of type |
839 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
840 |
|
represents an attribute definition. Such a node implements the |
841 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
842 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
843 |
|
|
844 |
|
<p>An attribute definition represents a definition of the attribute |
845 |
|
associated to an element type. It is corresponding to the attribute definition |
846 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
847 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
848 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
849 |
|
there are more than one attribute definitions for an attribute of an element |
850 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
851 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
852 |
|
that attribute.</p> |
853 |
|
|
854 |
|
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
855 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
856 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
857 |
|
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
858 |
|
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
859 |
|
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
860 |
|
const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2; |
861 |
|
const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3; |
862 |
|
const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4; |
863 |
|
const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5; |
864 |
|
const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6; |
865 |
|
const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7; |
866 |
|
const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8; |
867 |
|
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
868 |
|
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
869 |
|
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
870 |
|
|
871 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
872 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
873 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
874 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
875 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
876 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
877 |
|
|
878 |
}</code></pre> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
879 |
|
|
880 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
881 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
|
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
882 |
|
|
883 |
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
<span class=ed>...</span> |
884 |
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. |
|
|
|
|
|
[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. |
|
|
|
|
|
@@ |
|
885 |
|
|
886 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<dl> |
887 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
888 |
object [['''MUST''']] behave as if it were an |
of type |
889 |
[CODE(DOMi)@en[[[Attr]]]] object. |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
890 |
|
read$B!>(Bonly</dt> |
891 |
|
<dd><p>The |
892 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
893 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
894 |
|
node belongs.</p> |
895 |
|
|
896 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
897 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
898 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
899 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
900 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
901 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
902 |
|
node. If there is no such an |
903 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
904 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
905 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
906 |
|
<code>unsigned short</code></dt> |
907 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
908 |
|
It is expected that this attribute contains a value from the definition group |
909 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
910 |
|
|
911 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
912 |
|
value associated to this attribute.</p> |
913 |
|
|
914 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
915 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
916 |
|
exception if the |
917 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
918 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
919 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
920 |
|
associated to this attribute.</p> |
921 |
|
|
922 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
923 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
924 |
|
appropriate value from the |
925 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
926 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
927 |
|
|
928 |
|
<!-- DeclaredValueType --> |
929 |
|
<p>The definition group |
930 |
|
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
931 |
|
integers indicating the declared type of attributes. The definition |
932 |
|
group contains the following constants:</p> |
933 |
|
|
934 |
|
<table> |
935 |
|
<thead> |
936 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
937 |
|
</thead> |
938 |
|
<tbody> |
939 |
|
<tr> |
940 |
|
<th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code> |
941 |
|
<td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr> |
942 |
|
<tr> |
943 |
|
<th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code> |
944 |
|
<td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr> |
945 |
|
<tr> |
946 |
|
<th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code> |
947 |
|
<td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr> |
948 |
|
<tr> |
949 |
|
<th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code> |
950 |
|
<td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr> |
951 |
|
<tr> |
952 |
|
<th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code> |
953 |
|
<td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr> |
954 |
|
<tr> |
955 |
|
<th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code> |
956 |
|
<td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr> |
957 |
|
<tr> |
958 |
|
<th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code> |
959 |
|
<td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr> |
960 |
|
<tr> |
961 |
|
<th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code> |
962 |
|
<td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr> |
963 |
|
<tr> |
964 |
|
<th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code> |
965 |
|
<td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr> |
966 |
|
<tr> |
967 |
|
<th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code> |
968 |
|
<td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr> |
969 |
|
<tr> |
970 |
|
<th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code> |
971 |
|
<td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr> |
972 |
|
<tr> |
973 |
|
<th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code> |
974 |
|
<td><code>11</code><td>Unknown, because no declaration for the attribute |
975 |
|
has been read but the [all declaration processed] property |
976 |
|
<span class=ed>[INFOSET]</span> would be false.</tr> |
977 |
|
</tbody> |
978 |
|
</table> |
979 |
|
|
980 |
|
<p>If no attribute type information is available, or if the source |
981 |
|
of the information does not distinguish <q>no value</q> and <q>unknown</q> |
982 |
|
<span class=ed>[INFOSET]</span>, then the value |
983 |
|
<a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a> |
984 |
|
<em class=rfc2119>MUST</em> be used.</p> |
985 |
|
|
986 |
|
<div class="note memo"> |
987 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
988 |
|
created by the |
989 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
990 |
|
method has its <a href="#declaredType"><code>declaredType</code></a> attribute |
991 |
|
set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p> |
992 |
|
</div> |
993 |
|
|
994 |
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
<p>If the source of the information does not distinguish <q>no value</q> |
995 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
996 |
[['''MUST''']] behave as if the following algorithm |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
997 |
is performed: |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
998 |
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
be used.</p> |
999 |
object is read-only, then throw an |
|
1000 |
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
1001 |
= Remove any child node the node has. |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
1002 |
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
1003 |
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]]]]. |
|
1004 |
|
|
1005 |
** Definition groups |
</dd> |
1006 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1007 |
|
type <code>unsigned short</code></dt> |
1008 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
1009 |
|
attribute contains a value from the definition group |
1010 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1011 |
|
|
1012 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1013 |
|
the value associated to this attribute.</p> |
1014 |
|
|
1015 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1016 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1017 |
|
exception if the |
1018 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1019 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1020 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1021 |
|
associated to this attribute.</p> |
1022 |
|
|
1023 |
|
<p>If the |
1024 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1025 |
|
created during the process to create a <abbr>DOM</abbr> from an |
1026 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1027 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
1028 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1029 |
|
|
1030 |
|
<!-- DefaultValueType --> |
1031 |
|
<p>The definition group |
1032 |
|
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
1033 |
|
contains integers indicating the type of the default for the attribute. |
1034 |
|
The definition group contains the following constans:</p> |
1035 |
|
|
1036 |
|
<table> |
1037 |
|
<thead> |
1038 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1039 |
|
</thead> |
1040 |
|
<tbody> |
1041 |
|
<tr> |
1042 |
|
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
1043 |
|
<td><code>0</code><td>Unknown.</tr> |
1044 |
|
<tr> |
1045 |
|
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
1046 |
|
<td><code>1</code><td>Provided explicitly and fixed |
1047 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
1048 |
|
<tr> |
1049 |
|
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
1050 |
|
<td><code>2</code><td>No default value and the attribute have to be |
1051 |
|
explicitly specified.</tr> |
1052 |
|
<tr> |
1053 |
|
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
1054 |
|
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
1055 |
|
<tr> |
1056 |
|
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
1057 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
1058 |
|
</tbody> |
1059 |
|
</table> |
1060 |
|
|
1061 |
|
<p>If the source of the default type does not distinguish |
1062 |
|
implied and unknown default types, then the value |
1063 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
1064 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1065 |
|
|
1066 |
|
<div class="note memo"> |
1067 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1068 |
|
node created by the |
1069 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1070 |
|
method has its <a href="#defaultType"><code>defaultType</code></a> |
1071 |
|
attribute set to |
1072 |
|
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
1073 |
|
</div></dd> |
1074 |
|
</dl> |
1075 |
|
|
|
[6] The |
|
|
[DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]] |
|
|
contains integers indicating the type of |
|
|
attribute value: |
|
|
,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set. |
|
|
,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]]. |
|
|
,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]]. |
|
|
,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]]. |
|
|
,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]]. |
|
|
,[CODE(DOMc)@en[[[ENTITY_ATTR]]]],[CODE(IDL)[[[5]]]],The attribute value type is [CODE(XML)@en[[[ENTITY]]]]. |
|
|
,[CODE(DOMc)@en[[[ENTITIES_ATTR]]]],[CODE(IDL)[[[6]]]],The attribute value type is [CODE(XML)@en[[[ENTITIES]]]]. |
|
|
,[CODE(DOMc)@en[[[NMTOKEN_ATTR]]]],[CODE(IDL)[[[7]]]],The attribute value type is [CODE(XML)@en[[[NMTOKEN]]]]. |
|
|
,[CODE(DOMc)@en[[[NMTOKENS_ATTR]]]],[CODE(IDL)[[[8]]]],The attribute value type is [CODE(XML)@en[[[NMTOKENS]]]]. |
|
|
,[CODE(DOMc)@en[[[NOTATION_ATTR]]]],[CODE(IDL)[[[9]]]],The attribute value type is [CODE(XML)@en[[[NOTATION]]]]. |
|
|
,[CODE(DOMc)@en[[[ENUMERATION_ATTR]]]],[CODE(IDL)[[[10]]]],The attribute value is enumeration type. |
|
|
,[CODE(DOMc)@en[[[UNKNOWN_ATTR]]]],[CODE(IDL)[[[11]]]],"The attribute value type is unknown, because no declaration for the attribute has been read but not [CODE(InfoProp)@en[[[all declarations processed]]]] property would be false." |
|
|
|
|
|
The type of these constants are |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
|
|
|
|
|
If no attribute type information is provided, |
|
|
or if the source of that information does not |
|
|
distinguish [[no value]] and [[unknown]] as in |
|
|
XML Information Set, then the |
|
|
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]] value |
|
|
[['''MUST''']] be used. |
|
|
|
|
|
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
|
|
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
|
|
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
|
|
|
|
|
If the source of the attribute type information |
|
|
does not distinguish [[no value]] and / or [[unknown]] |
|
|
and [CODE(XML)@en[[[CDATA]]]], then the |
|
|
[CODE(DOMc)@en[[[CDATA_ATTR]]]] value [['''MUST''']] |
|
|
be used. |
|
|
|
|
|
[11] |
|
|
In Perl binding, the objects implementing the |
|
|
[CODE(DOMi)@en[[[Attr]]]] interface [['''MUST''']] |
|
|
also implement the [CODE(DOM)@en[[[DeclaredValueType]]]] |
|
|
constant group. |
|
|
|
|
|
[7] The |
|
|
[DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]] |
|
|
contains integers indicating the type of |
|
|
default attribute value: |
|
|
,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown. |
|
|
,[CODE(DOMc)@en[[[FIXED_DEFAULT]]]],[CODE(IDL)[[[1]]]],The default value is provided and the attribute is [CODE(XML)@en[#[[FIXED]]]] to that value. |
|
|
,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute. |
|
|
,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]]. |
|
|
,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it. |
|
|
|
|
|
The type of these constants are |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
|
|
|
|
|
If the source of the attribute default value type |
|
|
does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]] |
|
|
default and unknown default, then the |
|
|
[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value |
|
|
[['''MUST''']] be used. |
|
|
|
|
|
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
|
|
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
|
|
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
|
|
|
|
|
** Tree-relationship Attributes |
|
|
|
|
|
[10] |
|
|
The |
|
|
[DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]] |
|
|
of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface |
|
|
is read-only and of type |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]. |
|
|
It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
|
|
which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
belong to. |
|
|
|
|
|
If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]] |
|
|
list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node, |
|
|
then the attribute [['''MUST''']] return the |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] node. |
|
|
Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]]. |
|
|
|
|
|
;; This attribute is analogue to the |
|
|
[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute |
|
|
for [CODE(DOMi)@en[[[ElementTypeDefinition]]]], |
|
|
[CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] |
|
|
nodes, or the [CODE(DOMa)@en[[[ownerElement]]]] |
|
|
attribute for [CODE(DOMi)@en[[[Attr]]]] nodes. |
|
|
|
|
|
** Attributes |
|
|
|
|
|
[5] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DeclaredValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DeclaredValueType]]]] |
|
|
definition group. |
|
|
|
|
|
[8] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute default value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DefaultValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DefaultValueType]]]] |
|
|
definition group.</pre> |
|
1076 |
</div> |
</div> |
1077 |
|
|
1078 |
</div> |
</div> |