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-05>5 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> |
141 |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
142 |
|
|
143 |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
144 |
consists of three interfaces:</p> |
introduces four interfaces: |
145 |
<ul> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>, |
146 |
<li><a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a></li> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>, |
147 |
<li><a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a></li> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
148 |
<li><a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a></li> |
and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>. |
149 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
In addition, it modifies existing interfaces |
|
</ul> |
|
|
|
|
|
<p>In addition, it adds methods, attributes, and/or constants to interfaces |
|
150 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
151 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Document"><code>Document</code></a>, |
152 |
<a href="#EntityReference"><code>EntityReference</code></a>, and |
<a href="#DocumentType"><code>DocumentType</code></a>, |
153 |
<a href="#Notation"><code>Notation</code></a>. |
<a href="#Entity"><code>Entity</code></a>, and |
154 |
It modifies semantics of some of methods and attributes in |
<a href="#Notation"><code>Notation</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> |
|
155 |
|
|
156 |
<div class=section id=features> |
<div class=section id=features> |
157 |
<h3>Feature Name</h3> |
<h3>Feature Name</h3> |
160 |
the <abbr>DOM</abbr> Document Type Definition module, the |
the <abbr>DOM</abbr> Document Type Definition module, the |
161 |
<code>hasFeature</code> method of a <code>DOMImplementation</code> object |
<code>hasFeature</code> method of a <code>DOMImplementation</code> object |
162 |
<em class=rfc2119>MUST</em> return <code>true</code> when the parameters are |
<em class=rfc2119>MUST</em> return <code>true</code> when the parameters are |
163 |
set to <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and |
set to |
164 |
<code>3.0</code> respectively.</p> |
<dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn> |
165 |
|
and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively.</p> |
166 |
|
|
167 |
<p>In such an implementation, the <code>getFeature</code> method of a |
<p>In such an implementation, the <code>getFeature</code> method of a |
168 |
<code>Document</code> object <em class=rfc2119>MUST</em> return the (at least |
<code>Document</code> object <em class=rfc2119>MUST</em> return the (at least |
169 |
conceptually) same object implementing the |
conceptually) same object implementing the |
170 |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when |
171 |
the parameters are set to |
the parameters are set to |
172 |
<code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and |
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
173 |
<code>3.0</code> respectively. Likewise, any method that takes one or more |
and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively. |
174 |
feature names with or without version number, including the methods |
Likewise, any method that takes one or more feature names with or without |
175 |
<code>hasFeature</code> and <code>getFeature</code>, |
version number, including the methods <code>hasFeature</code> and |
176 |
<em class=rfc2119>MUST</em> behave in a manner consistent with the |
<code>getFeature</code>, <em class=rfc2119>MUST</em> behave in a manner |
177 |
aforementioned cases.</p> |
consistent with the aforementioned cases.</p> |
178 |
|
</div> |
179 |
|
|
180 |
|
<div class=section id=section-node> |
181 |
|
<h3>Modifications to the <code id=Node>Node</code> Interface</h3> |
182 |
|
|
183 |
|
<p>The implementation of the |
184 |
|
<a href="#Node"><code>Node</code></a> interface |
185 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
186 |
|
<pre class=idl><code>// Additions to the Node interface |
187 |
|
|
188 |
|
// Additions to the NodeType definition group |
189 |
|
const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001; |
190 |
|
const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002; |
191 |
|
</pre> |
192 |
|
|
193 |
|
<p>This specification adds two new types (subinterfaces) of |
194 |
|
<a href="#Node"><code>Node</code></a>: element type definition (node type |
195 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>, |
196 |
|
interface |
197 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and |
198 |
|
attribute definition (node type |
199 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>, |
200 |
|
interface |
201 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For |
202 |
|
these kinds of nodes, methods and attributes in the |
203 |
|
<a href="#Node"><code>Node</code></a> interface must behave as following:</p> |
204 |
|
|
205 |
|
<dl> |
206 |
|
<dt><code id=attributes>attributes</code></dt> |
207 |
|
<dd> |
208 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
209 |
|
<code>null</code>.</p> |
210 |
|
</dd> |
211 |
|
<dt><code id=baseURI>baseURI</code></dt> |
212 |
|
<dd> |
213 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
214 |
|
value of the <a href="#baseURI"><code>baseURI</code></a> attribute |
215 |
|
of the node in the <code>ownerDocument</code> attribute of the node. |
216 |
|
Note that the value might be <code>null</code>.</p> |
217 |
|
</dd> |
218 |
|
<dt><code id=cloneNode>cloneNode</code></dt> |
219 |
|
<dd class=ed>@@</dd> |
220 |
|
<dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd> |
221 |
|
<dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt> |
222 |
|
<dd class=ed>@@</dd> |
223 |
|
<dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt> |
224 |
|
<dd><p>When invoked, the method <em class=rfc2119>MUST</em> return |
225 |
|
<code>false</code>.</p></dd> |
226 |
|
<dt><code id=isEqualNode>isEqualNode</code></dt> |
227 |
|
<dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method, |
228 |
|
following items are added to the list of conditions for equality:</p> |
229 |
|
|
230 |
|
<ul> |
231 |
|
<li> |
232 |
|
<p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a> |
233 |
|
and at least one of them has the support for the feature |
234 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p> |
235 |
|
<ul> |
236 |
|
<li>they are equal according to <abbr>DOM</abbr> level 3 definition |
237 |
|
<span class=ed>@@ ref</span>, and |
238 |
|
<li>either: |
239 |
|
<ul><!-- |
240 |
|
<li>both of them does not support the feature |
241 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>--> |
242 |
|
<li>exactly one of them support the feature |
243 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
244 |
|
and the <code>length</code> attribute of the <code>NamedNodeMap</code> |
245 |
|
object in the <a href="#elementTypes"><code>elementTypes</code></a> |
246 |
|
attribute of it is equal to <code>0</code>, or</li> |
247 |
|
<li>both of them support the feature |
248 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
249 |
|
and the values of the |
250 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attributes are |
251 |
|
equal (equality of the |
252 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute is same |
253 |
|
as that for the <code>attributes</code> attribute).</li> |
254 |
|
</ul> |
255 |
|
</li> |
256 |
|
</ul> |
257 |
|
</li> |
258 |
|
|
259 |
|
<li><p>If the nodes are |
260 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
261 |
|
the values of the |
262 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
263 |
|
attributes are equal (equality of the |
264 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
265 |
|
attribute is same as that for the <code>attributes</code> attribute).</p></li> |
266 |
|
|
267 |
|
<li><p>If the nodes are |
268 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
269 |
|
the values of the <a href="#declaredType"><code>declaredType</code></a> and |
270 |
|
the <a href="#defaultType"><code>defaultType</code></a> attributes are |
271 |
|
equal respectively.</p></li> |
272 |
|
|
273 |
|
<li><p>If the nodes are |
274 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
275 |
|
the values of the <code>DOMStringList</code> objects in the |
276 |
|
<a href="#allowedTokens"><code>allowedTokens</code></a> attributes |
277 |
|
are equal, i.e. their <code>length</code> attribute values are equal and |
278 |
|
each string exists in a list is contained in another list (their indeces |
279 |
|
may be different), with an additional constraint that the number of the |
280 |
|
items that are equal to a string in a list is equal to the number |
281 |
|
of the items equal to the string in another list.</p></li> |
282 |
|
</ul></dd> |
283 |
|
<dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and |
284 |
|
<code id=lookupPrefix>lookupPrefix</code></dt> |
285 |
|
<dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return |
286 |
|
<code>null</code>.</p></dd> |
287 |
|
<dt><code id=nodeName>nodeName</code></dt> |
288 |
|
<dd> |
289 |
|
<p>If the node is an |
290 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
291 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
292 |
|
name of the element type definition represented by the node.</p> |
293 |
|
|
294 |
|
<p>If the node is an |
295 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
296 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
297 |
|
name of the attribute definition represented by the node.</p> |
298 |
|
</dd> |
299 |
|
<dt><code id=nodeType>nodeType</code></dt> |
300 |
|
<dd> |
301 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
302 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
303 |
|
(if the node is an |
304 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or |
305 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
306 |
|
(if the node is an |
307 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p> |
308 |
|
|
309 |
|
<!-- NodeType --> |
310 |
|
<p>Two constants are added to the <code id=NodeType>NodeType</code> |
311 |
|
definition group of the <a href="#Node"><code>Node</code></a> interface as |
312 |
|
following:</p> |
313 |
|
<table> |
314 |
|
<thead> |
315 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
316 |
|
</thead> |
317 |
|
<tbody> |
318 |
|
<tr> |
319 |
|
<th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn> |
320 |
|
<td><code>81001</code><td>The node is an |
321 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr> |
322 |
|
<tr> |
323 |
|
<th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn> |
324 |
|
<td><code>81002</code><td>The node is an |
325 |
|
<a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr> |
326 |
|
</tbody> |
327 |
|
</table> |
328 |
|
</dd> |
329 |
|
<dt><code id=nodeValue>nodeValue</code> and |
330 |
|
<code id=textContent>textContent</code></dt> |
331 |
|
<dd> |
332 |
|
<p>If the node is an |
333 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
334 |
|
On getting, the attributes <em class=rfc2119>MUST</em> return the |
335 |
|
name of the element type.</p> |
336 |
|
|
337 |
|
<div class="note memo"> |
338 |
|
<p>Thus, on setting the attributes does nothing |
339 |
|
<span class=ed>[DOM3]</span>.</p> |
340 |
|
</div> |
341 |
|
|
342 |
|
<p>On setting, the <a href="#textContent"><code>textContent</code></a> |
343 |
|
attribute <em class=rfc2119>MUST NOT</em> raise a |
344 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
345 |
|
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
346 |
|
|
347 |
|
<p>If the node is an |
348 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p> |
349 |
|
|
350 |
|
<pre class=ed> |
351 |
|
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
352 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
353 |
|
[['''MUST''']] return the normalized default value |
354 |
|
of the attribute. |
355 |
|
|
356 |
|
@@ |
357 |
|
|
358 |
|
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
359 |
|
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
360 |
|
object [['''MUST''']] behave as if it were an |
361 |
|
[CODE(DOMi)@en[[[Attr]]]] object. |
362 |
|
|
363 |
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
364 |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
365 |
|
[['''MUST''']] behave as if the following algorithm |
366 |
|
is performed: |
367 |
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
368 |
|
object is read-only, then throw an |
369 |
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
370 |
|
= Remove any child node the node has. |
371 |
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
372 |
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
373 |
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
374 |
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
375 |
|
</pre> |
376 |
|
</dd> |
377 |
|
<dt><code id=normalize>normalize</code></dt> |
378 |
|
<dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is |
379 |
|
normalized, any nodes in the <code>NamedNodeMap</code> object in the |
380 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute |
381 |
|
<em class=rfc2119>MUST</em> be normalized as well.</p> |
382 |
|
|
383 |
|
<p>When an |
384 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
385 |
|
is normalized, any nodes in the <code>NamedNodeMap</code> object in the |
386 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
387 |
|
attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd> |
388 |
|
<dt class=ed>@@ ...</dt> |
389 |
|
</dl> |
390 |
|
|
391 |
|
</div> |
392 |
|
|
393 |
|
<div class=section id=section-document> |
394 |
|
<h3>Modifications to the <code id=Document>Document</code> Interface</h3> |
395 |
|
|
396 |
|
<p>If an attempt is made to adopt an |
397 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
398 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
399 |
|
the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em> |
400 |
|
raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@ |
401 |
|
ref</span>.</p> |
402 |
</div> |
</div> |
403 |
|
|
404 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
405 |
<h2>The <code>DocumentXDoctype</code> Interface</h2> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
406 |
|
|
407 |
|
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
408 |
|
<em class=rfc2119>MUST</em> be implemented as following:</p> |
409 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
410 |
|
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
411 |
|
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
412 |
|
raises (DOMException); |
413 |
|
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
414 |
|
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
415 |
|
raises (DOMException); |
416 |
|
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
417 |
|
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
418 |
|
raises (DOMException); |
419 |
|
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
420 |
|
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
421 |
|
raises (DOMException); |
422 |
|
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
423 |
|
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
424 |
|
raises (DOMException); |
425 |
}</code></pre> |
}</code></pre> |
426 |
|
|
427 |
<pre class=ed> |
<div class=ed>@@ cast definition</div> |
|
* The [CODE(DOMi)@en[DocumentXDoctype]] Interface Specification |
|
428 |
|
|
429 |
[1] [[manakai//DOM Extensions]] > New Interfaces > |
<dl> |
430 |
[[DOM XML Document Type Definition]] module > |
<dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>, |
431 |
The [CODE(DOMi)@en[[[DocumentXDoctype]]]] Interface |
method</dt> |
432 |
|
<dd> |
433 |
[2] |
<p>This method creates a <code>DocumentType</code> node with the specified |
434 |
@@ cast |
name, belonging to the document.</p> |
435 |
|
<p>The <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn> |
436 |
** Constructors |
parameter is the name of the document type.</p> |
437 |
|
|
438 |
[3] The |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
439 |
[DFN@en[[CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] method]] |
return a <code>DocumentType</code> node with the following attributes:</p> |
440 |
returns a [CODE(DOMi)@en[[[DocumentType]]]] node |
<dl> |
441 |
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
<dt><code>attributes</code>, <code>parentNode</code></dt> |
442 |
It creates a [CODE(DOMi)@en[[[DocumentType]]]] node |
<dd><code>null</code>.</dd> |
443 |
of the given name, belonging to the document. |
<dt><code>elementTypes</code>, <code>generalEntities</code>, and |
444 |
|
<code>notations</code></dt> |
445 |
[3] The |
<dd>Empty <code>NamedNodeMap</code> objects.</dd> |
446 |
[DFN@en[[CODE(DOMm)@en[[[createElementTypeDefinition]]]] method]] |
<dt><code>entities</code></dt> |
447 |
returns an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
<dd>The same value as the <code>generalEntities</code> attribute.</dd> |
448 |
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
<dt><code>childNodes</code></dt> |
449 |
It creates an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
<dd>An empty <code>NodeList</code> object.</dd> |
450 |
of the given name, belonging to the document. |
<dt><code>internalSubset</code>, <code>publicId</code>, and |
451 |
|
<code>systemId</code></dt> |
452 |
[4] The |
<dd>Empty strings.</dd> |
453 |
[DFN@en[[CODE(DOMm)@en[[[createAttributeDefinition]]]] method]] |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
454 |
returns an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
<dd><code>false</code>.</dd> |
455 |
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
<dt><code>nodeName</code></dt> |
456 |
It creates an [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
<dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd> |
457 |
of the given name, belonging to the document. |
<dt><code>ownerDocument</code></dt> |
458 |
|
<dd>The <code>Document</code> over which the method is invoked.</dd> |
459 |
[10] The |
</dl> |
460 |
[DFN@en[[CODE(DOMm)@en[[[createGeneralEntity]]]] method]] |
<p>In addition, the method <em class=rfc2119>MUST</em> be marked as |
461 |
returns an [CODE(DOMi)@en[[[Entity]]]] node |
containing five general entity declarations: <code>amp</code>, |
462 |
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
<code>lt</code>, <code>gt</code>, <code>quot</code>, and |
463 |
It creates an [CODE(DOMi)@en[[[Entity]]]] node, |
<code>apos</code>.</p> |
464 |
which represents a general entity, |
</dd> |
465 |
of the given name, belonging to the document. |
<dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>, |
466 |
|
method</dt> |
467 |
[12] The |
<dd> |
468 |
[DFN@en[[CODE(DOMm)@en[[[createNotation]]]] method]] |
<p>This method creates a <code>ElementTypeDefinition</code> node with the |
469 |
returns a [CODE(DOMi)@en[[[Notation]]]] node |
specified name, belonging to the document.</p> |
470 |
or raises a [CODE(DOMi)@en[[[DOMException]]]]. |
<p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn> |
471 |
It creates a [CODE(DOMi)@en[[[Notation]]]] node |
parameter is the name of the element type defined by the element |
472 |
of the given name, belonging to the document. |
type definition.</p> |
473 |
|
|
474 |
[5] |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
475 |
These method take a parameter [CODE(DOMp)@en[[[name]]]], |
return an |
476 |
of type [CODE(DOMi)@en[[[DOMString]]]]. It is |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
477 |
the document type name, element type name, |
node with the following attributes:</p> |
478 |
or attribute name of the node to be created. |
<dl> |
479 |
|
<dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt> |
480 |
[6] |
<dd>An empty <code>NamedNodeMap</code> object.</dd> |
481 |
The [CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] |
<dt><code>attributes</code>, <code>parentNode</code></dt> |
482 |
method [['''MUST''']] create a [CODE(DOMi)@en[[[DocumentType]]]] |
<dd><code>null</code>.</dd> |
483 |
object with the following attribute values: |
<dt><code>childNodes</code></dt> |
484 |
- [CODE(DOMa)@en[[[attributes]]]], |
<dd>An empty <code>NodeList</code> object.</dd> |
485 |
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
486 |
- [CODE(DOMa)@en[[[elementTypes]]]], |
<dd><code>false</code>.</dd> |
487 |
[CODE(DOMa)@en[[[generalEntities]]]], |
<dt><code>nodeName</code></dt> |
488 |
[CODE(DOMa)@en[[[notations]]]]: Empty |
<dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd> |
489 |
[CODE(DOMi)@en[[[NamedNodeMap]]]]s. |
<dt><code>ownerDocument</code></dt> |
490 |
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
491 |
[CODE(DOMi)@en[[[NodeList]]]]. |
<dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt> |
492 |
- [CODE(DOMa)@en[[[entities]]]]: The same |
<dd><code>null</code>.</dd> |
493 |
[CODE(DOMi)@en[[[NamedNodeMap]]]] as |
<dt class=ed>@@ Ensure all attributes are defined</dt> |
494 |
[CODE(DOMa)@en[[[generalEntities]]]]. |
</dl> |
495 |
- [CODE(DOMa)@en[[[internalSubset]]]], |
</dd> |
496 |
[CODE(DOMa)@en[[[publicId]]]], [CODE(DOMa)@en[[[systemId]]]]: |
<dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>, |
497 |
Empty strings. |
method</dt> |
498 |
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
<dd> |
499 |
[CODE(IDL)@en[[[false]]]]. |
<p>This method creates a <code>AttributeDefinition</code> node with the |
500 |
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
specified name, belonging to the document.</p> |
501 |
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
<p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn> |
502 |
[CODE(DOMi)@en[[[Document]]]] node on which the method |
parameter is the name of the attribute defined by the attribute |
503 |
is invoked. |
definition.</p> |
504 |
|
|
505 |
In addition, it [['''MUST''']] be marked as containing |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
506 |
five general entity declarations for XML predefined |
return an |
507 |
entities, i.e. [CODE(XML)@en[[[amp]]]], [CODE(XML)@en[[[lt]]]], |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
508 |
[CODE(XML)@en[[[gt]]]], [CODE(XML)@en[[[quot]]]], and |
node with the following attributes:</p> |
509 |
[CODE(XML)@en[[[apos]]]]. |
<dl> |
510 |
|
<dt><code>allowedTokens</code></dt> |
511 |
[8] |
<dd>An empty <code>DOMStringList</code> object.</dd> |
512 |
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]] |
<dt><code>attributes</code>, |
513 |
method [['''MUST''']] create an |
<a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>, |
514 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
and <code>parentNode</code></dt> |
515 |
object with the following attribute values: |
<dd><code>null</code>.</dd> |
516 |
- [CODE(DOMa)@en[[[attributeDefinitions]]]]: |
<dt><code>childNodes</code></dt> |
517 |
An empty [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
<dd>An empty <code>NodeList</code> object.</dd> |
518 |
- [CODE(DOMa)@en[[[attributes]]]], |
<dt><code>declaredType</code></dt> |
519 |
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
<dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd> |
520 |
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
<dt><code>defaultType</code></dt> |
521 |
[CODE(DOMi)@en[[[NodeList]]]]. |
<dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd> |
522 |
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
523 |
[CODE(IDL)@en[[[false]]]]. |
<dd><code>false</code>.</dd> |
524 |
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
<dt><code>nodeName</code></dt> |
525 |
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
<dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd> |
526 |
[CODE(DOMi)@en[[[Document]]]] node on which the method |
<dt><code>ownerDocument</code></dt> |
527 |
is invoked. |
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
528 |
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
<dt class=ed>@@ Ensure all attributes are defined</dt> |
529 |
[CODE(IDL)@en[[[null]]]]. |
</dl> |
530 |
|
|
531 |
@@ Ensure all attributes are defined |
<div class=ed> |
532 |
|
<p>@@ Should we keep these statements?: |
533 |
[9] The [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
However, if the <cfg::cfg|xml-id> configuration |
534 |
method [['''MUST''']] create an |
parameter is set to <code>true</code> and the <var>name</var> |
535 |
[CODE(DOMi)@en[[[AttributeDefinition]]]] |
is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]] |
536 |
object with the following attribute values: |
attribute is set to <code>ID_ATTR</code>. |
537 |
- [CODE(DOMa)@en[[[allowedTokens]]]]: |
[CODE(DOMa)@en[[[defaultType]]]]?</p> |
538 |
An empty [CODE(DOMi)@en[[[DOMStringList]]]]. |
</div> |
539 |
- [CODE(DOMa)@en[[[attributes]]]], |
</dd> |
540 |
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
<dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>, |
541 |
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
method</dt> |
542 |
[CODE(DOMi)@en[[[NodeList]]]]. |
<dd> |
543 |
- [CODE(DOMa)@en[[[declaredType]]]]: |
<p>This method creates a <a href="#Entity"><code>Entity</code></a> node |
544 |
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
with the specified name, which represents a general entity, belonging to |
545 |
- [CODE(DOMa)@en[[[defaultType]]]]: |
the document.</p> |
546 |
[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]]. |
<p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn> |
547 |
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
parameter is the name of the general entity.</p> |
548 |
[CODE(IDL)@en[[[false]]]]. |
|
549 |
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
550 |
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
an <a href="#Entity"><code>Entity</code></a> node with the following |
551 |
[CODE(DOMi)@en[[[Document]]]] node on which the method |
attributes:</p> |
552 |
is invoked. |
<dl> |
553 |
- [CODE(DOMa)@en[[[ownerElementTypeDefinition]]]]: |
<dt><code>attributes</code>, <code>notationName</code>, |
554 |
[CODE(IDL)@en[[[null]]]]. |
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
555 |
|
and <code>parentNode</code></dt> |
556 |
@@ Ensure all attributes are defined |
<dd><code>null</code>.</dd> |
557 |
|
<dt><code>childNodes</code></dt> |
558 |
@@ Should we keep these statements?: |
<dd>An empty <code>NodeList</code> object.</dd> |
559 |
However, if the <cfg::cfg|xml-id> configuration |
<dt><code>manakaiDeclarationBaseURI</code>, |
560 |
parameter is set to <DOM::true> and the <P::name> |
<code>manakaiEntityBaseURI</code>, and |
561 |
is <XA::xml:id>, then the [CODE(DOMa)@en[[[declaredType]]]] |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
562 |
attribute is set to |
<dd>No explicit value is set.</dd> |
563 |
<C::AttributeDefinition.ID_ATTR>. |
<dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and |
564 |
[CODE(DOMa)@en[[[defaultType]]]]? |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
565 |
|
<dd><code>false</code>.</dd> |
566 |
[11] The [CODE(DOMm)@en[[[createGeneralEntity]]]] |
<dt><code>nodeName</code></dt> |
567 |
method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]] |
<dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd> |
568 |
node with the following attribute values: |
<dd> |
569 |
- [CODE(DOMa)@en[[[attributes]]]], |
<div class="note memo"> |
570 |
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
<p>It is not an error for |
571 |
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
<a href="#createGeneralEntity-name"><var>name</var></a> matching |
572 |
[CODE(DOMi)@en[[[NodeList]]]]. |
to the name of one of predefined general parsed entities in |
573 |
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
<abbr>XML</abbr> or <abbr>HTML</abbr>. For example, |
574 |
No explicit value is set. |
<a href="#createGeneralEntity-name"><var>name</var></a> might be |
575 |
- [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]: |
<code>amp</code>, resulting in an |
576 |
No explicit value is set. |
<a href="#Entity"><code>Entity</code></a> node |
577 |
- [CODE(DOMa)@en[[[manakaiEntityURI]]]]: |
with its <code>nodeName</code> attribute set to <code>amp</code>.</p> |
578 |
No explicit value is set. |
</div> |
579 |
- [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]: |
</dd> |
580 |
[CODE(IDL)@en[[[false]]]]. |
<dt><code>ownerDocument</code></dt> |
581 |
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
582 |
[CODE(IDL)@en[[[false]]]]. |
<dt><code>publicId</code>, and <code>systemId</code></dt> |
583 |
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
<dd><code>null</code>.</dd> |
584 |
- [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]]. |
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
585 |
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
<dt class=ed>@@ Ensure all attributes are defined</dd> |
586 |
[CODE(DOMi)@en[[[Document]]]] node on which the method |
</dl> |
587 |
is invoked. |
</dd> |
588 |
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
<dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>, |
589 |
[CODE(IDL)@en[[[null]]]]. |
method</dt> |
590 |
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
<dd> |
591 |
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
<p>This method creates a <code>Notation</code> node with the |
592 |
|
specified name, belonging to the document.</p> |
593 |
@@ Ensure all attributes are defined |
<p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn> |
594 |
|
parameter is the name of the notation.</p> |
595 |
@@ publicId and systemId should be empty string? |
|
596 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
597 |
[13] The [CODE(DOMm)@en[[[createNotation]]]] |
a <code>Notation</code> node with the following attributes:</p> |
598 |
method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]] |
<dl> |
599 |
node with the following attribute values: |
<dt><code>attributes</code>, |
600 |
- [CODE(DOMa)@en[[[attributes]]]], |
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
601 |
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]]. |
and <code>parentNode</code></dt> |
602 |
- [CODE(DOMa)@en[[[childNodes]]]]: An empty |
<dd><code>null</code>.</dd> |
603 |
[CODE(DOMi)@en[[[NodeList]]]]. |
<dt><code>childNodes</code></dt> |
604 |
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]: |
<dd>An empty <code>NodeList</code> object.</dd> |
605 |
No explicit value is set. |
<dt><code>manakaiDeclarationBaseURI</code></dt> |
606 |
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]: |
<dd>No explicit value is set.</dd> |
607 |
[CODE(IDL)@en[[[false]]]]. |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
608 |
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]]. |
<dd><code>false</code>.</dd> |
609 |
- [CODE(DOMa)@en[[[ownerDocument]]]]: The |
<dt><code>nodeName</code></dt> |
610 |
[CODE(DOMi)@en[[[Document]]]] node on which the method |
<dd><a href="#createNotation-name"><var>name</var></a>.</dd> |
611 |
is invoked. |
<dt><code>ownerDocument</code></dt> |
612 |
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]: |
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
613 |
[CODE(IDL)@en[[[null]]]]. |
<dt><code>publicId</code> and <code>systemId</code></dt> |
614 |
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]]. |
<dd><code>null</code>.</dd> |
615 |
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]]. |
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
616 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
617 |
@@ Ensure all attributes are defined |
</dl> |
618 |
|
</dd> |
619 |
[7] |
</dl> |
|
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. |
|
620 |
|
|
621 |
Otherwise, these method [['''MUST''']] return |
<p>These methods <em class=rfc2119>MUST</em> raise an |
622 |
the newly created node. |
<code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span> |
623 |
</pre> |
if <var>name</var> is <em>not</em> a legal <code>Name</code> according to |
624 |
|
the <abbr>XML</abbr> version in use, as specified in the |
625 |
|
<code>xmlVersion</code> attribute of the <code>Document</code> node.</p> |
626 |
|
|
627 |
|
<div class="note memo"> |
628 |
|
<p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now, |
629 |
|
since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not |
630 |
|
define it for <code>Document</code> methods.</p> |
631 |
|
|
632 |
|
<p><var>name</var> does not have to be a namespace qualified name.</p> |
633 |
|
</div> |
634 |
|
|
635 |
|
</div> |
636 |
|
|
637 |
|
|
638 |
|
<div class=section id=section-documenttype> |
639 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
640 |
|
Interface</h3> |
641 |
|
|
642 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
643 |
|
<em class=rfc2119>MAY</em> contain zero or more |
644 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
645 |
|
nodes in the <code>NodeList</code> object contained in the |
646 |
|
<code>childNodes</code> attribute of the |
647 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
648 |
|
|
649 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
650 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
651 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
652 |
|
object <em class=rfc2119>MUST</em> contains the |
653 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
654 |
|
nodes representing the processing instructions in the document type |
655 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
656 |
|
the <abbr>XML</abbr> processor. If the |
657 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
658 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
659 |
|
also be marked as read$B!>(Bonly.</p> |
660 |
|
|
661 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
662 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
663 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
664 |
|
of the node <em class=rfc2119>MUST</em> contain the |
665 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
666 |
|
created from the processing instruction information items in the list in the |
667 |
|
[children] property of the document type declaration item in the same |
668 |
|
order.</p> |
669 |
|
|
670 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
671 |
|
a document type declaration information item, the list in the [children] |
672 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
673 |
|
information items created from the |
674 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
675 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
676 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
677 |
|
|
678 |
|
<p>The implementation of the |
679 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
680 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
681 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
682 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
683 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
684 |
|
|
685 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
686 |
|
</code></pre> |
687 |
|
|
688 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
689 |
|
<code id=systemId>systemId</code> attribute of |
690 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
691 |
|
<a href="#Entity"><code>Entity</code></a>, and |
692 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
693 |
|
read$B!>(Bonly.</p> |
694 |
|
|
695 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
696 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
697 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
698 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
699 |
|
associated to the attribute. No normalization, relative reference resolution, |
700 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
701 |
|
value is <code>null</code>, ...</span></p> |
702 |
|
|
703 |
|
<div class="note memo"> |
704 |
|
<p>Setting an invalid identifier might make the node unserializable. |
705 |
|
Setting a public identifier while leaveing system identifier unspecified |
706 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
707 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
708 |
|
</div> |
709 |
|
|
710 |
|
<div class=ed> |
711 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
712 |
|
</div> |
713 |
|
|
714 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
715 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
716 |
|
read$B!>(Bonly.</p> |
717 |
|
|
718 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
719 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
720 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
721 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
722 |
|
associated to the attribute. No normalization, or lexical validation is |
723 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
724 |
|
...</span></p> |
725 |
|
|
726 |
</div> |
</div> |
727 |
|
|
728 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
729 |
<h2>The <code>DocumentTypeDefinition</code> Interface</h2> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
730 |
|
|
731 |
|
<div class="note memo"> |
732 |
|
<p>This interface is a separated interface from the |
733 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
734 |
|
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
735 |
|
for the historical reason.</p> |
736 |
|
</div> |
737 |
|
|
738 |
|
<p>The |
739 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
740 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
741 |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
742 |
|
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
743 |
|
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
744 |
|
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
745 |
|
|
746 |
|
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
747 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
748 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
749 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
750 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
751 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
752 |
|
|
753 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
754 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
755 |
|
raises (DOMException); |
756 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
757 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
758 |
|
raises (DOMException); |
759 |
|
void <a href="#setNotationNode">setNotationNode</a> |
760 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
761 |
|
raises (DOMException); |
762 |
}</code></pre> |
}</code></pre> |
763 |
|
|
764 |
<pre class=ed> |
<pre class=ed> |
768 |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
769 |
interface. See [[DOM XML Document Type Definition]>>3] for |
interface. See [[DOM XML Document Type Definition]>>3] for |
770 |
details. |
details. |
771 |
|
</pre> |
772 |
|
|
773 |
|
<dl> |
774 |
** Children |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
775 |
|
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
776 |
[2] The [DFN@en[[CODE(DOMa)@en[[[elementTypes]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the element |
777 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
type definitions belonging to the <code>DocumentType</code> node.</p> |
778 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that |
|
779 |
contains all element types belongs to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
780 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
<code>NamedNodeMap</code> object that contains all the |
781 |
The attribute is read-only. |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
782 |
|
nodes belonging to the <code>DocumentType</code> node. The |
783 |
What are contained in this collection depends on how |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
784 |
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node was created. If the |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
785 |
node was created as the result of parsing of an XML document, |
object <em class=rfc2119>MUST</em> be live and the same object |
786 |
it [['''MUST''']] contain all element types whose element type and / or |
<em class=rfc2119>MUST</em> be returned for any invocation.</p> |
787 |
attribute definition list declaration are encountered by and provided for the DOM |
|
788 |
implementation from the XML processor. Note that the XML processor might not |
<p>If the <code>DocumentType</code> node is created during the process |
789 |
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 |
790 |
If more than one declarations for an element type or an attribute is available |
requirements are applied: The <code>NamedNodeMap</code> object in the |
791 |
at the time of the definition node construction, then declarations other than |
<a href="#elementTypes"><code>elementType</code></a> attribute |
792 |
the first ones [['''MUST''']] be discarded. |
<em class=rfc2119>MUST</em> be so transformed that the object contains |
793 |
|
the <code>ElementTypeDefinition</code> nodes for the element types |
794 |
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
whose name is presented as the <code>Name</code> of the element type or |
795 |
object that contains all the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] nodes |
attribute definition list declarations processed by the <abbr>XML</abbr> |
796 |
belong to the node. The returned [CODE(DOMi)@en[[[NamedNodeMap]]]] object |
processor. If there is more than one element type declarations for an |
797 |
[['''MUST''']] be read-only if and only if the node is read-only. |
element type, then the declarations other than the first one |
798 |
Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
799 |
and therefore any change of read-only flag on the node is immediately |
<code>NamedNodeMap</code> object.</p></dd> |
800 |
reflected by that of the object. |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
801 |
|
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
802 |
[3] The [DFN@en[[CODE(DOMa)@en[[[generalEntities]]]] attribute]] |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the general |
803 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
entities belonging to the <code>DocumentType</code> node.</p> |
804 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains all the |
|
805 |
general entities belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node. |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
806 |
The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
same value as the <code>entities</code> attribute (defined in the |
807 |
The attribute is read-only. |
<code>DocumentType</code> interface) of the same node.</p> |
808 |
|
|
809 |
|
<div class="note memo"> |
810 |
|
<p>This attribute is part of the interface for historical reason.</p> |
811 |
|
</div></dd> |
812 |
|
<!-- |
813 |
All entities declared in the document type definition |
All entities declared in the document type definition |
814 |
contained in or referenced from the document entity |
contained in or referenced from the document entity |
815 |
might not be exposed through this collection, depending |
might not be exposed through this collection, depending |
829 |
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 |
830 |
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 |
831 |
reflected by that of the object. |
reflected by that of the object. |
832 |
|
--> |
833 |
The attribute [['''MUST''']] return the same value as the |
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
834 |
[CODE(DOMa)@en[[[entites]]]] attribute of the |
<code>notations</code>, read$B!>(Bonly</code> |
835 |
[CODE(DOMi)@en[[[DocumentType]]]] interface on the same node. |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
836 |
|
notations belonging to the <code>DocumentType</code> node.</p> |
837 |
[4] The [DFN@en[[CODE(DOMa)@en[[[notations]]]] attribute]] |
|
838 |
of the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
839 |
is a live [CODE(DOMi)@en[[[NamedNodeMap]]]] object that contains |
same value as the <code>notations</code> attribute (defined in the |
840 |
all the notations belong to the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
<code>DocumentType</code> interface) of the same node.</p> |
841 |
node. The type of the attribute is [CODE(DOMi)@en[[[NamedNodeMap]]]]. |
|
842 |
The attribute is read-only. |
<div class="note memo"> |
843 |
|
<p>This attribute is part of the interface for historical reason.</p> |
844 |
|
<p>Implementations are not required to implement the |
845 |
|
<code>notations</code> attribute twice (for <code>DocumentType</code> |
846 |
|
and <code>DocumentTypeDefinition</code> interfaces); they share exactly |
847 |
|
same definition.</p> |
848 |
|
</div></dd> |
849 |
|
<!-- |
850 |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
851 |
created from an XML document, duplicate notation declarations, if any, in DTD |
created from an XML document, duplicate notation declarations, if any, in DTD |
852 |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
870 |
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 |
871 |
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 |
872 |
reflected by that of the object. |
reflected by that of the object. |
873 |
|
--> |
874 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
875 |
|
method</dt> |
876 |
|
<dd><p>Returns the |
877 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
878 |
|
with the specified name.</p> |
879 |
|
|
880 |
|
<p>The |
881 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
882 |
|
parameter is the name of the element type.</p> |
883 |
|
|
884 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
885 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
886 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
887 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
888 |
|
<code>NamedNodeMap</code> object in the |
889 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
890 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
891 |
|
<code>null</code>.</p></dd> |
892 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
893 |
|
method</dt> |
894 |
|
<dd><p>Returns the |
895 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
896 |
|
with the specified name.</p> |
897 |
|
|
898 |
|
<p>The |
899 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
900 |
|
parameter is the name of the element type.</p> |
901 |
|
|
902 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
903 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
904 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
905 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
906 |
|
<code>NamedNodeMap</code> object in the |
907 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
908 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
909 |
|
<code>null</code>.</p></dd> |
910 |
|
<dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>, |
911 |
|
method</dt> |
912 |
|
<dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node |
913 |
|
with the specified name.</p> |
914 |
|
|
915 |
|
<p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn> |
916 |
|
parameter is the name of the general entity.</p> |
917 |
|
|
918 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
919 |
|
<a href="#Entity"><code>Entity</code></a> node, |
920 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
921 |
|
<a href="#getEntityNode-name"><var>name</var></a>, in the |
922 |
|
<code>NamedNodeMap</code> object in the |
923 |
|
<a href="#entities"><code>entities</code></a> attribute of the |
924 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
925 |
|
<code>null</code>.</p></dd> |
926 |
|
<dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>, |
927 |
|
method</dt> |
928 |
|
<dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node |
929 |
|
with the specified name.</p> |
930 |
|
|
931 |
|
<p>The |
932 |
|
<dfn id=getNotationNode-name class=dom-param><var>name</var></dfn> |
933 |
|
parameter is the name of the notation.</p> |
934 |
|
|
935 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
936 |
|
<a href="#Notation"><code>Notation</code></a> node, |
937 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
938 |
|
<a href="#getNotationNode-name"><var>name</var></a>, in the |
939 |
|
<code>NamedNodeMap</code> object in the |
940 |
|
<a href="#notations"><code>notations</code></a> attribute of the |
941 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
942 |
|
<code>null</code>.</p></dd> |
943 |
|
<dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>, |
944 |
|
method</dt> |
945 |
|
<dd class=ed>@@</dd> |
946 |
|
<dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>, |
947 |
|
method</dt> |
948 |
|
<dd class=ed>@@</dd> |
949 |
|
<dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>, |
950 |
|
method</dt> |
951 |
|
<dd class=ed>@@</dd> |
952 |
|
</dl> |
953 |
|
|
954 |
A DOM implementation is not required to implement the |
<div class=ed> |
955 |
[CODE(DOMa)@en[[[notations]]]] attribute twice |
<p>A future version of this interface might define the |
956 |
for the [CODE(DOMi)@en[[[DocumentType]]]] and |
<code>parameterEntities</code> and getter/setter for parameter entities. |
957 |
the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interfaces; |
</div> |
|
the latter is defined to contain the same value as the former. |
|
|
|
|
958 |
|
|
|
** 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> |
|
959 |
</div> |
</div> |
960 |
|
|
961 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
962 |
<h2>The <code>ElementTypeDefinition</code> Interface</h2> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
963 |
|
|
964 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<p>The nodes of type |
965 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
966 |
}</code></pre> |
represents an element type definition. Such a node implements the |
967 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
968 |
|
interface, which extends the <a href="#Node"><code>Node</code></a> |
969 |
|
interface.</p> |
970 |
|
|
971 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
<p>An element type definition represents a definition of the element type. |
972 |
|
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
973 |
|
However, an |
974 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
975 |
|
does not represent the element type definition in <abbr>DTD</abbr> itself. |
976 |
|
Even if there are more than one element type declarations for an element type |
977 |
|
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
978 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
979 |
|
node for that element type. In addition, if there are attribute definition |
980 |
|
declarations for an element type, even when there is no element type |
981 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
982 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
983 |
|
node for that element type.</p> |
984 |
|
|
985 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
986 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
987 |
|
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
988 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
989 |
|
|
990 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<span class=ed>@@ more</span> |
991 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
}</code></pre> |
|
[['''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]]]]. |
|
992 |
|
|
993 |
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
<dl> |
994 |
|
<dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn> |
995 |
|
of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt> |
996 |
|
<dd><p>The |
997 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a> |
998 |
|
attribute of |
999 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1000 |
|
<a href="#Entity"><code>Entity</code></a>, and |
1001 |
|
<a href="#Notation"><code>Notation</code></a> interface contains the |
1002 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node to which the node |
1003 |
|
is attached.</p> |
1004 |
|
|
1005 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return a |
1006 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node. It |
1007 |
|
<em class=rfc2119>MUST</em> be such a node that whose |
1008 |
|
<a href="#elementTypes"><code>elementTypes</code></a> (for an |
1009 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1010 |
|
node), <a href="#entities"><code>entities</code></a> (for an |
1011 |
|
<a href="#Entity"><code>Entity</code></a> node), or |
1012 |
|
<a href="#notations"><code>notations</code></a> (for a |
1013 |
|
<a href="#Notation"><code>Notation</code></a> node) attribute contains the |
1014 |
|
<code>NamedNodeMap</code> object that contains the node. If there is no such |
1015 |
|
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
1016 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
1017 |
|
</dl> |
1018 |
|
|
1019 |
[5] The |
<div class=ed> |
1020 |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
<p>A future version of the specification might define a set of attributes |
1021 |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
and methods for representing and accessing to the content model of the |
1022 |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
element type.</p> |
1023 |
|
</div> |
1024 |
</div> |
</div> |
1025 |
|
|
1026 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
1027 |
<h2>The <code>AttributeDefinition</code> Interface</h2> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
1028 |
|
|
1029 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<p>The nodes of type |
1030 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
1031 |
|
represents an attribute definition. Such a node implements the |
1032 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
1033 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
1034 |
|
|
1035 |
|
<p>An attribute definition represents a definition of the attribute |
1036 |
|
associated to an element type. It is corresponding to the attribute definition |
1037 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
1038 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
1039 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
1040 |
|
there are more than one attribute definitions for an attribute of an element |
1041 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
1042 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
1043 |
|
that attribute.</p> |
1044 |
|
|
1045 |
|
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1046 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1047 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1048 |
|
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
1049 |
|
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
1050 |
|
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
1051 |
|
const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2; |
1052 |
|
const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3; |
1053 |
|
const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4; |
1054 |
|
const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5; |
1055 |
|
const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6; |
1056 |
|
const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7; |
1057 |
|
const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8; |
1058 |
|
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
1059 |
|
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
1060 |
|
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
1061 |
|
|
1062 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
1063 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
1064 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
1065 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
1066 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
1067 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
1068 |
|
|
1069 |
}</code></pre> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
|
|
|
|
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
|
1070 |
|
|
1071 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
1072 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
|
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
1073 |
|
|
1074 |
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
<span class=ed>...</span> |
1075 |
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]]]]. |
|
1076 |
|
|
1077 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<dl> |
1078 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
1079 |
[['''MUST''']] return the name of the attribute. |
of type |
1080 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1081 |
|
read$B!>(Bonly</dt> |
1082 |
|
<dd><p>The |
1083 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
1084 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1085 |
|
node belongs.</p> |
1086 |
|
|
1087 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
1088 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1089 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
1090 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
1091 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
1092 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1093 |
|
node. If there is no such an |
1094 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
1095 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
1096 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
1097 |
|
<code>unsigned short</code></dt> |
1098 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
1099 |
|
It is expected that this attribute contains a value from the definition group |
1100 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
1101 |
|
|
1102 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1103 |
|
value associated to this attribute.</p> |
1104 |
|
|
1105 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1106 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1107 |
|
exception if the |
1108 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1109 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1110 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1111 |
|
associated to this attribute.</p> |
1112 |
|
|
1113 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
1114 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
1115 |
|
appropriate value from the |
1116 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
1117 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1118 |
|
|
1119 |
|
<!-- DeclaredValueType --> |
1120 |
|
<p>The definition group |
1121 |
|
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
1122 |
|
integers indicating the declared type of attributes. The definition |
1123 |
|
group contains the following constants:</p> |
1124 |
|
|
1125 |
|
<table> |
1126 |
|
<thead> |
1127 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1128 |
|
</thead> |
1129 |
|
<tbody> |
1130 |
|
<tr> |
1131 |
|
<th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code> |
1132 |
|
<td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr> |
1133 |
|
<tr> |
1134 |
|
<th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code> |
1135 |
|
<td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr> |
1136 |
|
<tr> |
1137 |
|
<th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code> |
1138 |
|
<td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr> |
1139 |
|
<tr> |
1140 |
|
<th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code> |
1141 |
|
<td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr> |
1142 |
|
<tr> |
1143 |
|
<th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code> |
1144 |
|
<td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr> |
1145 |
|
<tr> |
1146 |
|
<th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code> |
1147 |
|
<td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr> |
1148 |
|
<tr> |
1149 |
|
<th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code> |
1150 |
|
<td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr> |
1151 |
|
<tr> |
1152 |
|
<th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code> |
1153 |
|
<td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr> |
1154 |
|
<tr> |
1155 |
|
<th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code> |
1156 |
|
<td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr> |
1157 |
|
<tr> |
1158 |
|
<th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code> |
1159 |
|
<td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr> |
1160 |
|
<tr> |
1161 |
|
<th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code> |
1162 |
|
<td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr> |
1163 |
|
<tr> |
1164 |
|
<th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code> |
1165 |
|
<td><code>11</code><td>Unknown, because no declaration for the attribute |
1166 |
|
has been read but the [all declaration processed] property |
1167 |
|
<span class=ed>[INFOSET]</span> would be false.</tr> |
1168 |
|
</tbody> |
1169 |
|
</table> |
1170 |
|
|
1171 |
|
<p>If no attribute type information is available, or if the source |
1172 |
|
of the information does not distinguish <q>no value</q> and <q>unknown</q> |
1173 |
|
<span class=ed>[INFOSET]</span>, then the value |
1174 |
|
<a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a> |
1175 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1176 |
|
|
1177 |
|
<div class="note memo"> |
1178 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1179 |
|
created by the |
1180 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1181 |
|
method has its <a href="#declaredType"><code>declaredType</code></a> attribute |
1182 |
|
set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p> |
1183 |
|
</div> |
1184 |
|
|
1185 |
[2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
<p>If the source of the information does not distinguish <q>no value</q> |
1186 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
1187 |
[['''MUST''']] return the normalized default value |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
1188 |
of the attribute. |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
1189 |
|
be used.</p> |
1190 |
|
|
1191 |
|
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
1192 |
|
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
1193 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
1194 |
|
definition group.</p> |
1195 |
|
|
1196 |
|
</dd> |
1197 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1198 |
|
type <code>unsigned short</code></dt> |
1199 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
1200 |
|
attribute contains a value from the definition group |
1201 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1202 |
|
|
1203 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1204 |
|
the value associated to this attribute.</p> |
1205 |
|
|
1206 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1207 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1208 |
|
exception if the |
1209 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1210 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1211 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1212 |
|
associated to this attribute.</p> |
1213 |
|
|
1214 |
|
<p>If the |
1215 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1216 |
|
created during the process to create a <abbr>DOM</abbr> from an |
1217 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1218 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
1219 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1220 |
|
|
1221 |
|
<!-- DefaultValueType --> |
1222 |
|
<p>The definition group |
1223 |
|
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
1224 |
|
contains integers indicating the type of the default for the attribute. |
1225 |
|
The definition group contains the following constans:</p> |
1226 |
|
|
1227 |
|
<table> |
1228 |
|
<thead> |
1229 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1230 |
|
</thead> |
1231 |
|
<tbody> |
1232 |
|
<tr> |
1233 |
|
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
1234 |
|
<td><code>0</code><td>Unknown.</tr> |
1235 |
|
<tr> |
1236 |
|
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
1237 |
|
<td><code>1</code><td>Provided explicitly and fixed |
1238 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
1239 |
|
<tr> |
1240 |
|
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
1241 |
|
<td><code>2</code><td>No default value and the attribute have to be |
1242 |
|
explicitly specified.</tr> |
1243 |
|
<tr> |
1244 |
|
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
1245 |
|
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
1246 |
|
<tr> |
1247 |
|
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
1248 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
1249 |
|
</tbody> |
1250 |
|
</table> |
1251 |
|
|
1252 |
|
<p>If the source of the default type does not distinguish |
1253 |
|
implied and unknown default types, then the value |
1254 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
1255 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1256 |
|
|
1257 |
|
<div class="note memo"> |
1258 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1259 |
|
node created by the |
1260 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1261 |
|
method has its <a href="#defaultType"><code>defaultType</code></a> |
1262 |
|
attribute set to |
1263 |
|
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
1264 |
|
</div></dd> |
1265 |
|
</dl> |
1266 |
|
|
1267 |
@@ |
</div> |
1268 |
|
|
1269 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<div class=section id=section-entity> |
1270 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
<h3>Modifications to the <code id=Entity>Entity</code> Interface</h3> |
|
object [['''MUST''']] behave as if it were an |
|
|
[CODE(DOMi)@en[[[Attr]]]] object. |
|
1271 |
|
|
1272 |
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
<p>The implementation of the <a href="#Entity"><code>Entity</code></a> |
1273 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1274 |
[['''MUST''']] behave as if the following algorithm |
<pre class=idl><code>// Modifications to the Entity interface |
1275 |
is performed: |
attribute DOMString <a href="#publicId">publicId</a>; |
1276 |
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
attribute DOMString <a href="#systemId">systemId</a>; |
1277 |
object is read-only, then throw an |
attribute DOMString <a href="#notationName">notationName</a>; |
1278 |
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
1279 |
= Remove any child node the node has. |
// Additions to the Entity interface |
1280 |
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
1281 |
then create a [CODE(DOMi)@en[[[Text]]]] node |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1282 |
whose [CODE(DOMa)@en[[[data]]]] is the new value |
|
1283 |
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>; |
1284 |
|
</code></pre> |
1285 |
|
|
1286 |
|
<p>The <code id=notationName>notationName</code> attribute of the |
1287 |
|
<a href="#Entity"><code>Entity</code></a> interface is no longer |
1288 |
|
read$B!>(Bonly.</p> |
1289 |
|
|
1290 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1291 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1292 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1293 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
1294 |
|
associated to the attribute. No lexical validation is performed. The new |
1295 |
|
value <em class=rfc2119>MAY</em> be <code>null</code>.</p> |
1296 |
|
|
1297 |
|
<dl> |
1298 |
|
<dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn> |
1299 |
|
of type boolean</dt> |
1300 |
|
<dd><p>Whether the structure of the replacement text of the entity |
1301 |
|
is available via the <code>NodeList</code> object in the |
1302 |
|
<code>childNodes</code> attribute of the entity.</p> |
1303 |
|
|
1304 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1305 |
|
the value associated to this attribute.</p> |
1306 |
|
|
1307 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1308 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1309 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1310 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1311 |
|
value associated to this attribute.</p> |
1312 |
|
|
1313 |
|
<div class="note memo"> |
1314 |
|
<p>The attribute can be set to <code>false</code> even if the |
1315 |
|
<a href="#Entity"><code>Entity</code></a> node has any child node. |
1316 |
|
If the attribute is set to <code>false</code>, then any child node of |
1317 |
|
the <a href="#Entity"><code>Entity</code></a> node ought to be ignored, |
1318 |
|
say, for the purpose of serialization.</p> |
1319 |
|
</div> |
1320 |
|
|
1321 |
|
<p>When an <code>EntityReference</code> node is created by cloning |
1322 |
|
the replacement subtree of the <a href="#Entity"><code>Entity</code></a> |
1323 |
|
node, if the attribute is set to <code>false</code>, then any descendant |
1324 |
|
of the node <em class=rfc2119>MUST</em> be ignored.</p> |
1325 |
|
|
1326 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1327 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1328 |
|
the following requirements are applied: If the entity is an unparsed |
1329 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1330 |
|
<code>false</code>. Otherwise, if the entity is an external entity whose |
1331 |
|
replacement text is not available, or whose replacement text is not converted |
1332 |
|
to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set |
1333 |
|
to <code>false</code>. Otherwise, the attribute |
1334 |
|
<em class=rfc2119>MUST</em> be set to <code>true</code>.</p> |
1335 |
|
|
1336 |
|
<div class="note memo"> |
1337 |
|
<p>An <a href="#Entity"><code>Entity</code></a> node created by the |
1338 |
|
<a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method |
1339 |
|
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
1340 |
|
attribute set to <code>false</code>.</p> |
1341 |
|
</div></dd> |
1342 |
|
<dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn> |
1343 |
|
of type boolean</dt> |
1344 |
|
<dd><p>Whether the entity is declared by an external entity declaration or |
1345 |
|
not. If the value is <code>true</code>, the entity is declared in an entity |
1346 |
|
declaration in the external subset entity or in an external parameter entity. |
1347 |
|
If the value is <code>false</code>, the entity is declared in an entity |
1348 |
|
declaration in the internal subset, or the node is created in memory.</p> |
1349 |
|
|
1350 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1351 |
|
the value associated to this attribute.</p> |
1352 |
|
|
1353 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1354 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1355 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1356 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1357 |
|
value associated to this attribute.</p> |
1358 |
|
|
1359 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1360 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1361 |
|
the following requirements are applied: If the entity is an unparsed |
1362 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1363 |
|
<code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the |
1364 |
|
attribute <em class=rfc2119>MUST</em> be set to the value of whether the |
1365 |
|
entity is declared by an external markup declaration or not.</p></dd> |
1366 |
|
</dl> |
1367 |
|
</div> |
1368 |
|
|
1369 |
** Definition groups |
<div class=section id=section-notation> |
1370 |
|
<h3>Modifications to the <code id=Notation>Notation</code> Interface</h3> |
1371 |
|
|
1372 |
[6] The |
<p>The implementation of the <a href="#Notation"><code>Notation</code></a> |
1373 |
[DFN@en[definition group [CODE(DOM)@en[[[DeclaredValueType]]]]]] |
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1374 |
contains integers indicating the type of |
<pre class=idl><code>// Modifications to the Notation interface |
1375 |
attribute value: |
attribute DOMString <a href="#publicId">publicId</a>; |
1376 |
,[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]],[CODE(IDL)[[[0]]]],The attribute value type corresponding to [[no value]] in XML Information Set. |
attribute DOMString <a href="#systemId">systemId</a>; |
1377 |
,[CODE(DOMc)@en[[[CDATA_ATTR]]]],[CODE(IDL)[[[1]]]],The attribute value type is [CODE(XML)@en[[[CDATA]]]]. |
|
1378 |
,[CODE(DOMc)@en[[[ID_ATTR]]]],[CODE(IDL)[[[2]]]],The attribute value type is [CODE(XML)@en[[[ID]]]]. |
// Addition to the Notation interface |
1379 |
,[CODE(DOMc)@en[[[IDREF_ATTR]]]],[CODE(IDL)[[[3]]]],The attribute value type is [CODE(XML)@en[[[IDREF]]]]. |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1380 |
,[CODE(DOMc)@en[[[IDREFS_ATTR]]]],[CODE(IDL)[[[4]]]],The attribute value type is [CODE(XML)@en[[[IDREFS]]]]. |
</code></pre> |
|
,[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> |
|
1381 |
</div> |
</div> |
1382 |
|
|
1383 |
</div> |
</div> |
1384 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1385 |
<div id="references" class="section reference"> |
<div id="references" class="section reference"> |
1386 |
<h2>References</h2> |
<h2>References</h2> |
1387 |
|
|