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-08>8 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 |
335 |
|
<code>null</code>.</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>: |
349 |
|
The attribute <em class=rfc2119>MUST</em> behave as if the node |
350 |
|
were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd> |
351 |
|
<dt><code id=normalize>normalize</code></dt> |
352 |
|
<dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is |
353 |
|
normalized, any nodes in the <code>NamedNodeMap</code> object in the |
354 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute |
355 |
|
<em class=rfc2119>MUST</em> be normalized as well.</p> |
356 |
|
|
357 |
|
<p>When an |
358 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
359 |
|
is normalized, any nodes in the <code>NamedNodeMap</code> object in the |
360 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
361 |
|
attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd> |
362 |
|
<dt class=ed>@@ ...</dt> |
363 |
|
</dl> |
364 |
|
|
365 |
|
</div> |
366 |
|
|
367 |
|
<div class=section id=section-document> |
368 |
|
<h3>Modifications to the <code id=Document>Document</code> Interface</h3> |
369 |
|
|
370 |
|
<p>If an attempt is made to adopt an |
371 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
372 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
373 |
|
the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em> |
374 |
|
raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@ |
375 |
|
ref</span>.</p> |
376 |
</div> |
</div> |
377 |
|
|
378 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
379 |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
380 |
|
|
381 |
|
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
382 |
|
<em class=rfc2119>MUST</em> be implemented as following:</p> |
383 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
384 |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
385 |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
386 |
raises (DOMException); |
raises (DOMException); |
387 |
ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
388 |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
389 |
raises (DOMException); |
raises (DOMException); |
390 |
AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a> |
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
391 |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
392 |
raises (DOMException); |
raises (DOMException); |
393 |
Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
394 |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
395 |
raises (DOMException); |
raises (DOMException); |
396 |
Notation <a href="#createNotation">createNotation</a> |
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
397 |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
398 |
raises (DOMException); |
raises (DOMException); |
399 |
}</code></pre> |
}</code></pre> |
534 |
<code>manakaiEntityBaseURI</code>, and |
<code>manakaiEntityBaseURI</code>, and |
535 |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
536 |
<dd>No explicit value is set.</dd> |
<dd>No explicit value is set.</dd> |
537 |
<dt><code>manakaiHasReplacementTree</code> and |
<dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and |
538 |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
539 |
<dd><code>false</code>.</dd> |
<dd><code>false</code>.</dd> |
540 |
<dt><code>nodeName</code></dt> |
<dt><code>nodeName</code></dt> |
604 |
define it for <code>Document</code> methods.</p> |
define it for <code>Document</code> methods.</p> |
605 |
|
|
606 |
<p><var>name</var> does not have to be a namespace qualified name.</p> |
<p><var>name</var> does not have to be a namespace qualified name.</p> |
607 |
|
</div> |
608 |
|
|
|
<p>If the <code>strictErrorChecking</code> attribute of the |
|
|
<code>Document</code> node is <code>false</code>, the methods are |
|
|
not required to raise the exception <span class=ed>[DOM3]</span>.</p> |
|
609 |
</div> |
</div> |
610 |
|
|
611 |
|
|
612 |
|
<div class=section id=section-documenttype> |
613 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
614 |
|
Interface</h3> |
615 |
|
|
616 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
617 |
|
<em class=rfc2119>MAY</em> contain zero or more |
618 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
619 |
|
nodes in the <code>NodeList</code> object contained in the |
620 |
|
<code>childNodes</code> attribute of the |
621 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
622 |
|
|
623 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
624 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
625 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
626 |
|
object <em class=rfc2119>MUST</em> contains the |
627 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
628 |
|
nodes representing the processing instructions in the document type |
629 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
630 |
|
the <abbr>XML</abbr> processor. If the |
631 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
632 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
633 |
|
also be marked as read$B!>(Bonly.</p> |
634 |
|
|
635 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
636 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
637 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
638 |
|
of the node <em class=rfc2119>MUST</em> contain the |
639 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
640 |
|
created from the processing instruction information items in the list in the |
641 |
|
[children] property of the document type declaration item in the same |
642 |
|
order.</p> |
643 |
|
|
644 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
645 |
|
a document type declaration information item, the list in the [children] |
646 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
647 |
|
information items created from the |
648 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
649 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
650 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
651 |
|
|
652 |
|
<p>The implementation of the |
653 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
654 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
655 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
656 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
657 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
658 |
|
|
659 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
660 |
|
</code></pre> |
661 |
|
|
662 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
663 |
|
<code id=systemId>systemId</code> attribute of |
664 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
665 |
|
<a href="#Entity"><code>Entity</code></a>, and |
666 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
667 |
|
read$B!>(Bonly.</p> |
668 |
|
|
669 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
670 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
671 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
672 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
673 |
|
associated to the attribute. No normalization, relative reference resolution, |
674 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
675 |
|
value is <code>null</code>, ...</span></p> |
676 |
|
|
677 |
|
<div class="note memo"> |
678 |
|
<p>Setting an invalid identifier might make the node unserializable. |
679 |
|
Setting a public identifier while leaveing system identifier unspecified |
680 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
681 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
682 |
|
</div> |
683 |
|
|
684 |
|
<div class=ed> |
685 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
686 |
|
</div> |
687 |
|
|
688 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
689 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
690 |
|
read$B!>(Bonly.</p> |
691 |
|
|
692 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
693 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
694 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
695 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
696 |
|
associated to the attribute. No normalization, or lexical validation is |
697 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
698 |
|
...</span></p> |
699 |
|
|
700 |
</div> |
</div> |
701 |
|
|
702 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
703 |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
704 |
|
|
705 |
|
<div class="note memo"> |
706 |
|
<p>This interface is a separated interface from the |
707 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
708 |
|
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
709 |
|
for the historical reason.</p> |
710 |
|
</div> |
711 |
|
|
712 |
|
<p>The |
713 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
714 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
715 |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
716 |
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
717 |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
718 |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
719 |
|
|
720 |
<span class=ed>more members come here...</span> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
721 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
722 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
723 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
724 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
725 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
726 |
|
|
727 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
728 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
729 |
|
raises (DOMException); |
730 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
731 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
732 |
|
raises (DOMException); |
733 |
|
void <a href="#setNotationNode">setNotationNode</a> |
734 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
735 |
|
raises (DOMException); |
736 |
}</code></pre> |
}</code></pre> |
737 |
|
|
738 |
<pre class=ed> |
<pre class=ed> |
767 |
the <code>ElementTypeDefinition</code> nodes for the element types |
the <code>ElementTypeDefinition</code> nodes for the element types |
768 |
whose name is presented as the <code>Name</code> of the element type or |
whose name is presented as the <code>Name</code> of the element type or |
769 |
attribute definition list declarations processed by the <abbr>XML</abbr> |
attribute definition list declarations processed by the <abbr>XML</abbr> |
770 |
processor. If there is more than one element type declarations for an |
processor. If there are more than one element type declarations for an |
771 |
element type, then the declarations other than the first one |
element type, then the declarations other than the first one |
772 |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
773 |
<code>NamedNodeMap</code> object.</p></dd> |
<code>NamedNodeMap</code> object.</p></dd> |
845 |
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 |
846 |
reflected by that of the object. |
reflected by that of the object. |
847 |
--> |
--> |
848 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
849 |
|
method</dt> |
850 |
|
<dd><p>Returns the |
851 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
852 |
|
with the specified name.</p> |
853 |
|
|
854 |
|
<p>The |
855 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
856 |
|
parameter is the name of the element type.</p> |
857 |
|
|
858 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
859 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
860 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
861 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
862 |
|
<code>NamedNodeMap</code> object in the |
863 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
864 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
865 |
|
<code>null</code>.</p></dd> |
866 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
867 |
|
method</dt> |
868 |
|
<dd><p>Returns the |
869 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
870 |
|
with the specified name.</p> |
871 |
|
|
872 |
|
<p>The |
873 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
874 |
|
parameter is the name of the element type.</p> |
875 |
|
|
876 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
877 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
878 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
879 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
880 |
|
<code>NamedNodeMap</code> object in the |
881 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
882 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
883 |
|
<code>null</code>.</p></dd> |
884 |
|
<dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>, |
885 |
|
method</dt> |
886 |
|
<dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node |
887 |
|
with the specified name.</p> |
888 |
|
|
889 |
|
<p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn> |
890 |
|
parameter is the name of the general entity.</p> |
891 |
|
|
892 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
893 |
|
<a href="#Entity"><code>Entity</code></a> node, |
894 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
895 |
|
<a href="#getEntityNode-name"><var>name</var></a>, in the |
896 |
|
<code>NamedNodeMap</code> object in the |
897 |
|
<a href="#entities"><code>entities</code></a> attribute of the |
898 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
899 |
|
<code>null</code>.</p></dd> |
900 |
|
<dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>, |
901 |
|
method</dt> |
902 |
|
<dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node |
903 |
|
with the specified name.</p> |
904 |
|
|
905 |
<dt class=ed>@@ other members... |
<p>The |
906 |
|
<dfn id=getNotationNode-name class=dom-param><var>name</var></dfn> |
907 |
|
parameter is the name of the notation.</p> |
908 |
|
|
909 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
910 |
|
<a href="#Notation"><code>Notation</code></a> node, |
911 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
912 |
|
<a href="#getNotationNode-name"><var>name</var></a>, in the |
913 |
|
<code>NamedNodeMap</code> object in the |
914 |
|
<a href="#notations"><code>notations</code></a> attribute of the |
915 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
916 |
|
<code>null</code>.</p></dd> |
917 |
|
<dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>, |
918 |
|
method</dt> |
919 |
|
<dd class=ed>@@</dd> |
920 |
|
<dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>, |
921 |
|
method</dt> |
922 |
|
<dd class=ed>@@</dd> |
923 |
|
<dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>, |
924 |
|
method</dt> |
925 |
|
<dd class=ed>@@</dd> |
926 |
</dl> |
</dl> |
927 |
|
|
928 |
<div class=ed> |
<div class=ed> |
935 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
936 |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
937 |
|
|
938 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<p>The nodes of type |
939 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
940 |
|
represents an element type definition. Such a node |
941 |
|
<em class=rfc2119>MUST</em> implement the |
942 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
943 |
|
interface, which extends the <a href="#Node"><code>Node</code></a> |
944 |
|
interface.</p> |
945 |
|
|
946 |
|
<p>An element type definition represents a definition of the element type. |
947 |
|
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
948 |
|
However, an |
949 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
950 |
|
does not represent the element type definition in <abbr>DTD</abbr> itself. |
951 |
|
Even if there are more than one element type declarations for an element type |
952 |
|
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
953 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
954 |
|
node for that element type. In addition, if there are attribute definition |
955 |
|
declarations for an element type, even when there is no element type |
956 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
957 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
958 |
|
node for that element type.</p> |
959 |
|
|
960 |
|
<p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
961 |
|
node cannot be a child of any node. An |
962 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
963 |
|
cannot have any child node.</p> |
964 |
|
|
965 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
966 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
967 |
|
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
968 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
969 |
|
|
970 |
|
readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>; |
971 |
|
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a> |
972 |
|
(in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>); |
973 |
|
void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a> |
974 |
|
(in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>) |
975 |
|
raises (DOMException); |
976 |
}</code></pre> |
}</code></pre> |
977 |
|
|
978 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
<dl> |
979 |
|
<dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn> |
980 |
|
of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt> |
981 |
|
<dd><p>The |
982 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a> |
983 |
|
attribute of |
984 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
985 |
|
<a href="#Entity"><code>Entity</code></a>, and |
986 |
|
<a href="#Notation"><code>Notation</code></a> interface contains the |
987 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node to which the node |
988 |
|
is attached.</p> |
989 |
|
|
990 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return a |
991 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node. It |
992 |
|
<em class=rfc2119>MUST</em> be such a node that whose |
993 |
|
<a href="#elementTypes"><code>elementTypes</code></a> (for an |
994 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
995 |
|
node), <a href="#entities"><code>entities</code></a> (for an |
996 |
|
<a href="#Entity"><code>Entity</code></a> node), or |
997 |
|
<a href="#notations"><code>notations</code></a> (for a |
998 |
|
<a href="#Notation"><code>Notation</code></a> node) attribute contains the |
999 |
|
<code>NamedNodeMap</code> object that contains the node. If there is no such |
1000 |
|
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
1001 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
1002 |
|
<dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn> |
1003 |
|
of type NamedNodeMap, read$B!>(Bonly</dt> |
1004 |
|
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
1005 |
|
attribute definitions belonging to the |
1006 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1007 |
|
node.</p> |
1008 |
|
|
1009 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1010 |
|
<code>NamedNodeMap</code> object that contains all the |
1011 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1012 |
|
belonging to the |
1013 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1014 |
|
The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1015 |
|
read$B!>(Bonly if and only if the node is read$B!>(Bonly. The |
1016 |
|
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be live and |
1017 |
|
the same object <em class=rfc2119>MUST</em> be returned for any |
1018 |
|
invocation.</p> |
1019 |
|
|
1020 |
|
<p>If the |
1021 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1022 |
|
is created during the process to create a <abbr>DOM</abbr> from an |
1023 |
|
<abbr>XML</abbr> document, the following requirements are applied: The |
1024 |
|
<code>NamedNodeMap</code> object in the |
1025 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1026 |
|
attribute <em class=rfc2119>MUST</em> be so transformed that the object |
1027 |
|
contains the |
1028 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1029 |
|
corresponding to the attribute definitions in the attribute definition |
1030 |
|
list declarations processed by the <abbr>XML</abbr> processor and |
1031 |
|
associated to the element type represented by the node. If there are more |
1032 |
|
than one attribute definitions for an attribute, then the definitions other |
1033 |
|
than the first one <em class=rfc2119>MUST</em> be ignored for the purpose |
1034 |
|
of constructing the <code>NamedNodeMap</code> object.</p></dd> |
1035 |
|
<dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>, |
1036 |
|
method</dt> |
1037 |
|
<dd><p>Return the |
1038 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1039 |
|
with the specified name.</p> |
1040 |
|
|
1041 |
|
<p>The |
1042 |
|
<dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn> |
1043 |
|
parameter is the name of the attribute.</p> |
1044 |
|
|
1045 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1046 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
1047 |
|
whose <a href="#nodeName"><code>nodeName</code></a> attribute value is |
1048 |
|
equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>, |
1049 |
|
in the <code>NamedNodeMap</code> in the |
1050 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1051 |
|
attribute of the node. If there is no such node, it |
1052 |
|
<em class=rfc2119>MUST</em> return <code>null</code>.</p></dd> |
1053 |
|
<dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>, |
1054 |
|
method</dt> |
1055 |
|
<dd class=ed>@@</dd> |
1056 |
|
</dl> |
1057 |
|
|
1058 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<div class=ed> |
1059 |
of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] object |
<p>A future version of the specification might define a set of attributes |
1060 |
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
and methods for representing and accessing to the content model of the |
1061 |
|
element type.</p> |
1062 |
[4] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
</div> |
|
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]]]]. |
|
|
|
|
|
** The [CODE(DOMi)@en[ElementTypeDefinition]] Interface |
|
|
|
|
|
[5] The |
|
|
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
|
|
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
|
|
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
|
1063 |
</div> |
</div> |
1064 |
|
|
1065 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
1066 |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
1067 |
|
|
1068 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<p>The nodes of type |
1069 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
1070 |
|
represents an attribute definition. Such a node |
1071 |
|
<em class=rfc2119>MUST</em> implement the |
1072 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
1073 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
1074 |
|
|
1075 |
|
<p>An attribute definition represents a definition of the attribute |
1076 |
|
associated to an element type. It is corresponding to the attribute definition |
1077 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
1078 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
1079 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
1080 |
|
there are more than one attribute definitions for an attribute of an element |
1081 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
1082 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
1083 |
|
that attribute.</p> |
1084 |
|
|
1085 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1086 |
|
node cannot be a child of any node. An |
1087 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1088 |
|
can have zero or more child nodes of same kinds as those allowed for |
1089 |
|
<code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p> |
1090 |
|
|
1091 |
|
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1092 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1093 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1094 |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
1095 |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
1096 |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
1104 |
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
1105 |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
1106 |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
1107 |
|
|
1108 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
1109 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
1110 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
1111 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
1112 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
1113 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
1114 |
|
|
1115 |
<span class=ed>...</span> |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
1116 |
|
|
1117 |
|
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
1118 |
|
readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>; |
1119 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
1120 |
}</code></pre> |
}</code></pre> |
1121 |
|
|
1122 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
<dl> |
1123 |
|
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
1124 |
|
of type |
1125 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1126 |
|
read$B!>(Bonly</dt> |
1127 |
|
<dd><p>The |
1128 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
1129 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1130 |
|
node belongs.</p> |
1131 |
|
|
1132 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
1133 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1134 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
1135 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
1136 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
1137 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1138 |
|
node. If there is no such an |
1139 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
1140 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
1141 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
1142 |
|
<code>unsigned short</code></dt> |
1143 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
1144 |
|
It is expected that this attribute contains a value from the definition group |
1145 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
1146 |
|
|
1147 |
[3] The getter of the [CODE(DOMa)@en[[[attributes]]]] attribute |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1148 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
value associated to this attribute.</p> |
1149 |
[['''MUST''']] return [CODE(IDL)@en[[[null]]]]. |
|
1150 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1151 |
[9] The getter of the [CODE(DOMa)@en[[[baseURI]]]] attribute |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1152 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
exception if the |
1153 |
[['''MUST''']] return the [CODE(DOMa)@en[[[baseURI]]]] |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1154 |
of the [CDOE(DOMa)@en[[[ownerDocument]]]] of the |
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1155 |
[CODE(DOMi)@en[[[AttributeDefinition]]]] object. |
<em class=rfc2119>MUST</em> set the specified value as the value |
1156 |
Note that it might be [CODE(IDL)@en[[[null]]]]. |
associated to this attribute.</p> |
1157 |
|
|
1158 |
[1] The getter of the [CODE(DOMa)@en[[[nodeName]]]] attribute |
<p>If the <code>AttributeDefinition</code> node is created during the process |
1159 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
1160 |
[['''MUST''']] return the name of the attribute. |
appropriate value from the |
1161 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
1162 |
[2] The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
[['''MUST''']] return the normalized default value |
|
|
of the attribute. |
|
|
|
|
|
@@ |
|
|
|
|
|
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
|
|
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object [['''MUST''']] behave as if it were an |
|
|
[CODE(DOMi)@en[[[Attr]]]] object. |
|
|
|
|
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
[['''MUST''']] behave as if the following algorithm |
|
|
is performed: |
|
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object is read-only, then throw an |
|
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
|
= Remove any child node the node has. |
|
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
|
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
|
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
|
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
|
|
</pre> |
|
1163 |
|
|
1164 |
|
<!-- DeclaredValueType --> |
1165 |
<p>The definition group |
<p>The definition group |
1166 |
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
1167 |
integers indicating the declared type of attributes.</p> |
integers indicating the declared type of attributes. The definition |
1168 |
|
group contains the following constants:</p> |
1169 |
|
|
1170 |
<table> |
<table> |
1171 |
<thead> |
<thead> |
1228 |
</div> |
</div> |
1229 |
|
|
1230 |
<p>If the source of the information does not distinguish <q>no value</q> |
<p>If the source of the information does not distinguish <q>no value</q> |
1231 |
and/or <code>unknown</code> <span class=ed>[INFOSET]</span> and |
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
1232 |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
1233 |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
1234 |
be used.</p> |
be used.</p> |
1236 |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
1237 |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
1238 |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
1239 |
constant group.</p> |
definition group.</p> |
1240 |
|
|
1241 |
<pre class=ed> |
</dd> |
1242 |
[7] The |
<dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of |
1243 |
[DFN@en[definition group [CODE(DOM)@en[[[DefaultValueType]]]]]] |
type <code>DOMStringList</code>, read$B!>(Bonly</dt> |
1244 |
contains integers indicating the type of |
<dd><p>The list of allowed attribute values.</p> |
1245 |
default attribute value: |
|
1246 |
,[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]],[CODE(IDL)[[[0]]]],The default value is unknown. |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1247 |
,[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>DOMStringList</code> object associated to this attribute. The object |
1248 |
,[CODE(DOMc)@en[[[REQUIRED_DEFAULT]]]],[CODE(IDL)[[[2]]]],An attribute specification is [CODE(XML)@en[#[[REQUIRED]]]] for the attribute. |
<em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of |
1249 |
,[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]],[CODE(IDL)[[[3]]]],The default value is [CODE(XML)@en[#[[IMPLIED]]]]. |
zero or more characters respectively, possibly with duplications. The |
1250 |
,[CODE(DOMc)@en[[[EXPLICIT_DEFAULT]]]],[CODE(IDL)[[[4]]]],The default value is provided but the attribute is not fixed to it. |
object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node |
1251 |
|
is read$B!>(Bonly.</p> |
1252 |
The type of these constants are |
|
1253 |
[CODE(IDL)@en[[[unsigned]] [[short]]]]. |
<p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1254 |
|
node is created during the process to create a <abbr>DOM</abbr> from an |
1255 |
If the source of the attribute default value type |
<abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain |
1256 |
does not distinguish the [CODE(XML)@en[#[[IMPLIED]]]] |
the names or name tokens allowed for the attribute defined by the node. |
1257 |
default and unknown default, then the |
If the document is well$B!>(Bformed, the object will be empty unless |
1258 |
[CODE(DOMc)@en[[[IMPLIED_DEFAULT]]]] value |
the <a href="#declaredType"><code>declaredType</code></a> is |
1259 |
[['''MUST''']] be used. |
<a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1260 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p> |
1261 |
;; A newly created [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
1262 |
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
<p>If the <a href="#declaredType"><code>declaredType</code></a> is different |
1263 |
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1264 |
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute |
1265 |
|
<em class=rfc2119>MUST</em> be ignored for the purpose of serializing |
1266 |
** Tree-relationship Attributes |
into (part of) <abbr>XML</abbr> document.</p> |
1267 |
|
|
1268 |
[10] |
<div class="note memo"> |
1269 |
The |
<p>When serializing the node it should be noted that the object might |
1270 |
[DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]] |
be empty, might contain duplications, and might contain strings that are |
1271 |
of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface |
not names or name tokens.</p> |
1272 |
is read-only and of type |
</div></dd> |
1273 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]. |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1274 |
It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
type <code>unsigned short</code></dt> |
1275 |
which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
<dd><p>The type of the default for the attribute. It is expected that this |
1276 |
belong to. |
attribute contains a value from the definition group |
1277 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1278 |
If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
1279 |
is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]] |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1280 |
list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node, |
the value associated to this attribute.</p> |
1281 |
then the attribute [['''MUST''']] return the |
|
1282 |
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] node. |
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1283 |
Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]]. |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1284 |
|
exception if the |
1285 |
;; This attribute is analogue to the |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1286 |
[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute |
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1287 |
for [CODE(DOMi)@en[[[ElementTypeDefinition]]]], |
<em class=rfc2119>MUST</em> set the specified value as the value |
1288 |
[CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] |
associated to this attribute.</p> |
1289 |
nodes, or the [CODE(DOMa)@en[[[ownerElement]]]] |
|
1290 |
attribute for [CODE(DOMi)@en[[[Attr]]]] nodes. |
<p>If the |
1291 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1292 |
** Attributes |
created during the process to create a <abbr>DOM</abbr> from an |
1293 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1294 |
[5] |
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
1295 |
The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]] |
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1296 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
1297 |
represents the type of the attribute value. |
<!-- DefaultValueType --> |
1298 |
|
<p>The definition group |
1299 |
This attribute is read-write. |
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
1300 |
The type of the attribute is |
contains integers indicating the type of the default for the attribute. |
1301 |
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
The definition group contains the following constans:</p> |
1302 |
that this attribute has a value from the definition group |
|
1303 |
[CODE(DOM)@en[[[DeclaredValueType]]]]. |
<table> |
1304 |
|
<thead> |
1305 |
The getter [['''MUST''']] return a value associated |
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1306 |
to this attribute. |
</thead> |
1307 |
|
<tbody> |
1308 |
The setter [['''MUST''']] |
<tr> |
1309 |
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
1310 |
[CODE(DOMi)@en[[[DOMException]]]] if the |
<td><code>0</code><td>Unknown.</tr> |
1311 |
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
<tr> |
1312 |
Otherwise, the setter [['''MUST''']] set the specified |
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
1313 |
value as the value associated to this attribute. |
<td><code>1</code><td>Provided explicitly and fixed |
1314 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
1315 |
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
<tr> |
1316 |
object, then it [['''MUST''']] set a value |
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
1317 |
from the [CODE(DOM)@en[[[DeclaredValueType]]]] |
<td><code>2</code><td>No default value and the attribute have to be |
1318 |
definition group. |
explicitly specified.</tr> |
1319 |
|
<tr> |
1320 |
[8] |
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
1321 |
The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]] |
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
1322 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<tr> |
1323 |
represents the type of the attribute default value. |
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
1324 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
1325 |
This attribute is read-write. |
</tbody> |
1326 |
The type of the attribute is |
</table> |
1327 |
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
1328 |
that this attribute has a value from the definition group |
<p>If the source of the default type does not distinguish |
1329 |
[CODE(DOM)@en[[[DefaultValueType]]]]. |
implied and unknown default types, then the value |
1330 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
1331 |
The getter [['''MUST''']] return a value associated |
<em class=rfc2119>MUST</em> be used.</p> |
1332 |
to this attribute. |
|
1333 |
|
<div class="note memo"> |
1334 |
The setter [['''MUST''']] |
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1335 |
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
node created by the |
1336 |
[CODE(DOMi)@en[[[DOMException]]]] if the |
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1337 |
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
method has its <a href="#defaultType"><code>defaultType</code></a> |
1338 |
Otherwise, the setter [['''MUST''']] set the specified |
attribute set to |
1339 |
value as the value associated to this attribute. |
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
1340 |
|
</div></dd> |
1341 |
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
</dl> |
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DefaultValueType]]]] |
|
|
definition group.</pre> |
|
|
</div> |
|
1342 |
|
|
1343 |
</div> |
</div> |
1344 |
|
|
1345 |
|
<div class=section id=section-entity> |
1346 |
|
<h3>Modifications to the <code id=Entity>Entity</code> Interface</h3> |
1347 |
|
|
1348 |
|
<p>The implementation of the <a href="#Entity"><code>Entity</code></a> |
1349 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1350 |
|
<pre class=idl><code>// Modifications to the Entity interface |
1351 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1352 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1353 |
|
attribute DOMString <a href="#notationName">notationName</a>; |
1354 |
|
|
1355 |
|
// Additions to the Entity interface |
1356 |
|
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
1357 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1358 |
|
|
1359 |
|
attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>; |
1360 |
|
</code></pre> |
1361 |
|
|
1362 |
|
<p>The <code id=notationName>notationName</code> attribute of the |
1363 |
|
<a href="#Entity"><code>Entity</code></a> interface is no longer |
1364 |
|
read$B!>(Bonly.</p> |
1365 |
|
|
1366 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1367 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1368 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1369 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
1370 |
|
associated to the attribute. No lexical validation is performed. The new |
1371 |
|
value <em class=rfc2119>MAY</em> be <code>null</code>.</p> |
1372 |
|
|
1373 |
|
<dl> |
1374 |
|
<dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn> |
1375 |
|
of type boolean</dt> |
1376 |
|
<dd><p>Whether the structure of the replacement text of the entity |
1377 |
|
is available via the <code>NodeList</code> object in the |
1378 |
|
<code>childNodes</code> attribute of the entity.</p> |
1379 |
|
|
1380 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1381 |
|
the value associated to this attribute.</p> |
1382 |
|
|
1383 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1384 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1385 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1386 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1387 |
|
value associated to this attribute.</p> |
1388 |
|
|
1389 |
|
<div class="note memo"> |
1390 |
|
<p>The attribute can be set to <code>false</code> even if the |
1391 |
|
<a href="#Entity"><code>Entity</code></a> node has any child node. |
1392 |
|
If the attribute is set to <code>false</code>, then any child node of |
1393 |
|
the <a href="#Entity"><code>Entity</code></a> node ought to be ignored, |
1394 |
|
say, for the purpose of serialization.</p> |
1395 |
|
</div> |
1396 |
|
|
1397 |
|
<p>When an <code>EntityReference</code> node is created by cloning |
1398 |
|
the replacement subtree of the <a href="#Entity"><code>Entity</code></a> |
1399 |
|
node, if the attribute is set to <code>false</code>, then any descendant |
1400 |
|
of the node <em class=rfc2119>MUST</em> be ignored.</p> |
1401 |
|
|
1402 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1403 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1404 |
|
the following requirements are applied: If the entity is an unparsed |
1405 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1406 |
|
<code>false</code>. Otherwise, if the entity is an external entity whose |
1407 |
|
replacement text is not available, or whose replacement text is not converted |
1408 |
|
to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set |
1409 |
|
to <code>false</code>. Otherwise, the attribute |
1410 |
|
<em class=rfc2119>MUST</em> be set to <code>true</code>.</p> |
1411 |
|
|
1412 |
|
<div class="note memo"> |
1413 |
|
<p>An <a href="#Entity"><code>Entity</code></a> node created by the |
1414 |
|
<a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method |
1415 |
|
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
1416 |
|
attribute set to <code>false</code>.</p> |
1417 |
|
</div></dd> |
1418 |
|
<dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn> |
1419 |
|
of type boolean</dt> |
1420 |
|
<dd><p>Whether the entity is declared by an external entity declaration or |
1421 |
|
not. If the value is <code>true</code>, the entity is declared in an entity |
1422 |
|
declaration in the external subset entity or in an external parameter entity. |
1423 |
|
If the value is <code>false</code>, the entity is declared in an entity |
1424 |
|
declaration in the internal subset, or the node is created in memory.</p> |
1425 |
|
|
1426 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1427 |
|
the value associated to this attribute.</p> |
1428 |
|
|
1429 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1430 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1431 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1432 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1433 |
|
value associated to this attribute.</p> |
1434 |
|
|
1435 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1436 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1437 |
|
the following requirements are applied: If the entity is an unparsed |
1438 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1439 |
|
<code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the |
1440 |
|
attribute <em class=rfc2119>MUST</em> be set to the value of whether the |
1441 |
|
entity is declared by an external markup declaration or not.</p></dd> |
1442 |
|
</dl> |
1443 |
|
</div> |
1444 |
|
|
1445 |
|
<div class=section id=section-notation> |
1446 |
|
<h3>Modifications to the <code id=Notation>Notation</code> Interface</h3> |
1447 |
|
|
1448 |
|
<p>The implementation of the <a href="#Notation"><code>Notation</code></a> |
1449 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1450 |
|
<pre class=idl><code>// Modifications to the Notation interface |
1451 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1452 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1453 |
|
|
1454 |
|
// Addition to the Notation interface |
1455 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1456 |
|
</code></pre> |
1457 |
|
</div> |
1458 |
|
|
1459 |
|
</div> |
1460 |
|
|
1461 |
<div id="references" class="section reference"> |
<div id="references" class="section reference"> |
1462 |
<h2>References</h2> |
<h2>References</h2> |