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-03>3 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> |
50 |
<div id="abstract" class="section"> |
<div id="abstract" class="section"> |
51 |
<h2>Abstract</h2> |
<h2>Abstract</h2> |
52 |
|
|
53 |
<div class="ed issue">...</div> |
<p>The <abbr>DOM</abbr> Document Type Definition module is a set of |
54 |
|
<abbr>DOM</abbr> interfaces, including both new interfaces and modifications |
55 |
|
to existing <abbr>DOM</abbr> interfaces, over which <abbr>DOM</abbr> |
56 |
|
applications are able to access to the definitions of the document type.</p> |
57 |
</div> |
</div> |
58 |
|
|
59 |
<div id="status" class="section"> |
<div id="status" class="section"> |
82 |
|
|
83 |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
84 |
|
|
|
<div class="issue ed"> |
|
|
<p>This is a work-in-progress specification for DOM Document Type |
|
|
Definition module, as implemented by manakai and |
|
|
<a href="http://suika.fam.cx/gate/2005/sw/DOM%20XML%20Document%20Type%20Definition">partially documented in the SuikaWiki</a>.</p> |
|
|
</div> |
|
|
|
|
85 |
<p>The <dfn id=term-dom-dtdef><abbr>DOM</abbr> Document Type Definition</dfn> |
<p>The <dfn id=term-dom-dtdef><abbr>DOM</abbr> Document Type Definition</dfn> |
86 |
module is a set of <abbr>DOM</abbr> interfaces, including both new |
module is a set of <abbr>DOM</abbr> interfaces, including both new |
87 |
interfaces and modifications to existing <abbr>DOM</abbr> interfaces, |
interfaces and modifications to existing <abbr>DOM</abbr> interfaces, |
95 |
any of them as a whole.</p> |
any of them as a whole.</p> |
96 |
</div> |
</div> |
97 |
|
|
98 |
<div class="section" id="terminology"> |
<div class="section" id=conformance> |
99 |
<h2>Terminology</h2> |
<h2>Conformance Requirements</h2> |
100 |
|
|
101 |
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
<div class=section id=terminology> |
102 |
<q><em class="rfc2119">MUST NOT</em></q>, |
<h3>Terminology</h3> |
|
<q><em class="rfc2119">SHOULD</em></q>, |
|
|
<q><em class="rfc2119">SHOULD NOT</em></q>, and |
|
|
<q><em class=rfc2119>MAY</em></q> in this |
|
|
document are to be interpreted as described in |
|
|
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
|
|
2119</a> |
|
|
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
|
103 |
|
|
|
<!-- Strictly speaking the paragraph below is not part of terminology. --> |
|
104 |
<p>All examples and notes in this specification are non$B!>(Bnormative, |
<p>All examples and notes in this specification are non$B!>(Bnormative, |
105 |
as are all sections explicitly marked non$B!>(Bnormative. Everything |
as are all sections explicitly marked non$B!>(Bnormative. Everything |
106 |
else in this specification is normative.</p> |
else in this specification is normative.</p> |
107 |
|
|
108 |
<p><span class=ed>Algorithm is normative but non-normative</span>. |
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
109 |
In addition, the order in which <a href="#errors">errors</a> are |
<q><em class="rfc2119">MUST NOT</em></q>, and <q><em class=rfc2119>MAY</em></q> |
110 |
raised is undefined.</p> |
in this document are to be interpreted as described in |
111 |
|
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
112 |
|
2119</a> |
113 |
|
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
114 |
|
|
115 |
<p class=ed><var>A</var> object is an object implementing <var>A</var> |
<p>Conformance requirements phrased as algorithms or specific steps |
116 |
interface.</p> |
<em class=rfc2119>MAY</em> be implemented in any manner, so long as the end |
117 |
|
result is equivalent. Requirements phrased in the imperative as part of |
118 |
|
algorithms are to be interpreted with the meaning of the key word used in |
119 |
|
introducing the algorithm.</p> |
120 |
|
|
121 |
|
<p>Sometimes an exception is phrased as being required to be raised. As |
122 |
|
specified in the <abbr>DOM</abbr> Core specification |
123 |
|
<span class=ed>[DOM3]</span>, |
124 |
|
when the value of the <code>strictErrorChecking</code> attribute of the |
125 |
|
<a href="#Document"><code>Document</code></a> node is <code>false</code>, |
126 |
|
then the exception is not have to be raised.</p> |
127 |
|
|
128 |
|
<p>Some conformance requirements are phrased as requirements on interfaces, |
129 |
|
attributes, methods, or objects. Such requirements are applied to |
130 |
|
implementations.</p> |
131 |
|
|
132 |
|
<p>The construction <q>a <code><var>Foo</var></code> object</q>, where |
133 |
|
<code><var>Foo</var></code> is an interface, is used instead of the more |
134 |
|
accurate <q>an object implementing the interface |
135 |
|
<code><var>Foo</var></code></q>.</p> |
136 |
|
|
137 |
|
<p>The construction <q>raise a <code><var>Bar</var></code></q>, where |
138 |
|
<code><var>Bar</var></code> is an exception code, is used instead of the more |
139 |
|
accurate <q>raise an exception implementing the interface |
140 |
|
<code>DOMException</code> <span class=ed>[DOM3]</span> with its |
141 |
|
<code>code</code> attribute set to <code><var>Bar</var></code></q>.</p> |
142 |
|
|
143 |
|
<p>The term |
144 |
|
<q id=live><a href="http://www.whatwg.org/specs/web-apps/current-work/#live">live</a></q> |
145 |
|
is defined in the HTML5 specification <span class=ed>[HTML5]</span>.</p> |
146 |
|
|
147 |
<p class=ed>@@ ref to DOM Binding Spec</p> |
<p class=ed>@@ ref to DOM Binding Spec</p> |
148 |
|
</div> |
149 |
|
|
150 |
|
<div class=section id=conformance-categories> |
151 |
|
<h3>Conformance Categories</h3> |
152 |
|
|
153 |
<p>If the <code>strictErrorChecking</code> attribute of the |
<p>There are several kinds of products that can be claim to conform to |
154 |
<code>Document</code> node is <code>false</code>, the methods are |
this specification:</p> |
155 |
not required to raise exceptions <span class=ed>[DOM3]</span>.</p> |
<dl> |
156 |
|
<dt id=category-dom-implementation><abbr>DOM</abbr> Implementation</dt> |
157 |
|
<dd>A <abbr>DOM</abbr> implementation (or just written as |
158 |
|
<q>implementation</q> in this document) provides a way to access |
159 |
|
<abbr>DOM</abbr> trees for applications by implementing interfaces defined |
160 |
|
by this and other documents. Unless otherwise noted, requirements in this |
161 |
|
document are applied to <abbr>DOM</abbr> implementations. To implement |
162 |
|
all the features in this document, the implementation have to implement |
163 |
|
some version of <abbr>DOM</abbr> Core (e.g. <abbr>DOM</abbr> level 3 |
164 |
|
<span class=ed>[DOM3]</span>) with one or more language binding (e.g. |
165 |
|
ECMAScript or Java binding <span class=ed>[BINDINGS]</span> or |
166 |
|
Perl binding <span class=ed>[PERLBINDING]</span>).</dd> |
167 |
|
<dt id=category-xml-parser><abbr>XML</abbr> Parser (<abbr>XML</abbr> document |
168 |
|
to <abbr>DOM</abbr> tree converter)</dt> |
169 |
|
<dd>A software component that converts |
170 |
|
<abbr>XML</abbr> 1.0 or 1.1 document (or fragment thereof) into a |
171 |
|
<abbr>DOM</abbr> tree (or fragment thereof) in the context of this |
172 |
|
document. Note that this document does not define any particular way to |
173 |
|
parse an <abbr>XML</abbr> document or to construct an <abbr>DOM</abbr> |
174 |
|
document, but it defines constraints for such processing.</dd> |
175 |
|
<dt id=category-xml-serializer><abbr>XML</abbr> Serializer (<abbr>DOM</abbr> |
176 |
|
tree to <abbr>XML</abbr> document converter)</dt> |
177 |
|
<dd>A software component that converts |
178 |
|
<abbr>DOM</abbr> tree (or fragment thereof) into an <abbr>XML</abbr> 1.0 or |
179 |
|
1.1 document (or fragment thereof). Note that this document does not define |
180 |
|
any particular way to serialize a <abbr>DOM</abbr> tree, but it defines |
181 |
|
constraints for such processing.</dd> |
182 |
|
<dt id=category-infoset-dom><abbr>XML</abbr> Information Set to |
183 |
|
<abbr>DOM</abbr> Tree Converter</dt> |
184 |
|
<dd>A software component that converts an <abbr>XML</abbr> information set |
185 |
|
into a <abbr>DOM</abbr> tree. Note that this documetn does not define |
186 |
|
any particular way for the convertion, but it defines constraints for |
187 |
|
such processing.</dd> |
188 |
|
<dt id=category-dom-infoset><abbr>DOM</abbr> Tree to <abbr>XML</abbr> |
189 |
|
Information Set Converter</dt> |
190 |
|
<dd>A software component that converts a <abbr>DOM</abbr> tree into |
191 |
|
an <abbr>XML</abbr> information set. Note that this documetn does not define |
192 |
|
any particular way for the convertion, but it defines constraints for |
193 |
|
such processing.</dd> |
194 |
|
</dl> |
195 |
|
</div> |
196 |
</div> |
</div> |
197 |
|
|
198 |
<div class=section id=dom-dtdef> |
<div class=section id=dom-dtdef> |
199 |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
200 |
|
|
201 |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
202 |
consists of three interfaces:</p> |
introduces four interfaces: |
203 |
<ul> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>, |
204 |
<li><a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a></li> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>, |
205 |
<li><a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a></li> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
206 |
<li><a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a></li> |
and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>. |
207 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
In addition, it modifies existing interfaces |
|
</ul> |
|
|
|
|
|
<p>In addition, it modifies interfaces |
|
208 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
209 |
|
<a href="#Document"><code>Document</code></a>, |
210 |
<a href="#DocumentType"><code>DocumentType</code></a>, |
<a href="#DocumentType"><code>DocumentType</code></a>, |
211 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Entity"><code>Entity</code></a>, and |
212 |
<a href="#EntityReference"><code>EntityReference</code></a>, |
<a href="#Notation"><code>Notation</code></a>.</p> |
|
<a href="#Notation"><code>Notation</code></a>, and |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>.</p> |
|
213 |
|
|
214 |
<div class=section id=features> |
<div class=section id=features> |
215 |
<h3>Feature Name</h3> |
<h3>Feature String</h3> |
216 |
|
|
217 |
<p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of |
<p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of |
218 |
the <abbr>DOM</abbr> Document Type Definition module, the |
the <abbr>DOM</abbr> Document Type Definition module, the |
219 |
<code>hasFeature</code> method of a <code>DOMImplementation</code> object |
<code>hasFeature</code> method of a <code>DOMImplementation</code> object |
220 |
<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 |
221 |
set to <code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and |
set to |
222 |
<code>3.0</code> respectively.</p> |
<dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn> |
223 |
|
and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively. Any |
224 |
<p>In such an implementation, the <code>getFeature</code> method of a |
method that takes one or more feature names, with or without version number, |
225 |
<code>Document</code> object <em class=rfc2119>MUST</em> return the (at least |
such as <code>hasFeature</code> or <code>getFeature</code>, |
226 |
conceptually) same object implementing the |
<em class=rfc2119>MUST</em> behave in a manner consistent with it.</p> |
|
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface when |
|
|
the parameters are set to |
|
|
<code>http://suika.fam.cx/www/2006/feature/XDoctype</code> and |
|
|
<code>3.0</code> respectively. Likewise, any method that takes one or more |
|
|
feature names with or without version number, including the methods |
|
|
<code>hasFeature</code> and <code>getFeature</code>, |
|
|
<em class=rfc2119>MUST</em> behave in a manner consistent with the |
|
|
aforementioned cases.</p> |
|
227 |
</div> |
</div> |
228 |
|
|
229 |
<div class=section id=section-node> |
<div class=section id=section-node> |
264 |
of the node in the <code>ownerDocument</code> attribute of the node. |
of the node in the <code>ownerDocument</code> attribute of the node. |
265 |
Note that the value might be <code>null</code>.</p> |
Note that the value might be <code>null</code>.</p> |
266 |
</dd> |
</dd> |
267 |
|
<dt><code id=cloneNode>cloneNode</code></dt> |
268 |
|
<dd class=ed> |
269 |
|
<p>A future version of the specification is expected to define the |
270 |
|
behavior of the <a href="#cloneNode"><code>cloneNode</code></a> method |
271 |
|
for those kinds of nodes. In addition, it might revise behavior of |
272 |
|
the method for <a href="#Entity"><code>Entity</code></a>, |
273 |
|
<a href="#Notation"><code>Notation</code></a>, and/or |
274 |
|
<a href="#DocumentType"><code>DocumentType</code></a> nodes.</p> |
275 |
|
</dd> |
276 |
|
<!-- |
277 |
|
<dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd> |
278 |
|
--> |
279 |
|
<dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt> |
280 |
|
<dd class=ed> |
281 |
|
<p>A future version of the specification is expected to define the |
282 |
|
behavior of the method |
283 |
|
for those kinds of nodes. In addition, it might revise behavior of |
284 |
|
the method for <a href="#Entity"><code>Entity</code></a>, |
285 |
|
<a href="#Notation"><code>Notation</code></a>, and/or |
286 |
|
<a href="#DocumentType"><code>DocumentType</code></a> nodes.</p> |
287 |
|
</dd> |
288 |
|
<dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt> |
289 |
|
<dd><p>When invoked, the method <em class=rfc2119>MUST</em> return |
290 |
|
<code>false</code>.</p></dd> |
291 |
|
<dt><code id=isEqualNode>isEqualNode</code></dt> |
292 |
|
<dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method, |
293 |
|
following items are added to the list of conditions for equality:</p> |
294 |
|
|
295 |
|
<ul> |
296 |
|
<li> |
297 |
|
<p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a> |
298 |
|
and at least one of them has the support for the feature |
299 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p> |
300 |
|
<ul> |
301 |
|
<li>they are equal according to <abbr>DOM</abbr> level 3 definition |
302 |
|
<span class=ed>@@ ref</span>, and |
303 |
|
<li>either: |
304 |
|
<ul><!-- |
305 |
|
<li>both of them does not support the feature |
306 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>--> |
307 |
|
<li>exactly one of them support the feature |
308 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
309 |
|
and the <code>length</code> attribute of the <code>NamedNodeMap</code> |
310 |
|
object in the <a href="#elementTypes"><code>elementTypes</code></a> |
311 |
|
attribute of it is equal to <code>0</code>, or</li> |
312 |
|
<li>both of them support the feature |
313 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
314 |
|
and the values of the |
315 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attributes are |
316 |
|
equal (equality of the |
317 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute is same |
318 |
|
as that for the <code>attributes</code> attribute).</li> |
319 |
|
</ul> |
320 |
|
</li> |
321 |
|
</ul> |
322 |
|
</li> |
323 |
|
|
324 |
|
<li><p>If the nodes are |
325 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
326 |
|
the values of the |
327 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
328 |
|
attributes are equal (equality of the |
329 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
330 |
|
attribute is same as that for the <code>attributes</code> attribute).</p></li> |
331 |
|
|
332 |
|
<li><p>If the nodes are |
333 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
334 |
|
the values of the <a href="#declaredType"><code>declaredType</code></a> and |
335 |
|
the <a href="#defaultType"><code>defaultType</code></a> attributes are |
336 |
|
equal respectively.</p></li> |
337 |
|
|
338 |
|
<li><p>If the nodes are |
339 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
340 |
|
the values of the <code>DOMStringList</code> objects in the |
341 |
|
<a href="#allowedTokens"><code>allowedTokens</code></a> attributes |
342 |
|
are equal, i.e. their <code>length</code> attribute values are equal and |
343 |
|
each string exists in a list is contained in another list (their indeces |
344 |
|
may be different), with an additional constraint that the number of the |
345 |
|
items that are equal to a string in a list is equal to the number |
346 |
|
of the items equal to the string in another list.</p></li> |
347 |
|
</ul></dd> |
348 |
|
<dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and |
349 |
|
<code id=lookupPrefix>lookupPrefix</code></dt> |
350 |
|
<dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return |
351 |
|
<code>null</code>.</p></dd> |
352 |
<dt><code id=nodeName>nodeName</code></dt> |
<dt><code id=nodeName>nodeName</code></dt> |
353 |
<dd> |
<dd> |
354 |
<p>If the node is an |
<p>If the node is an |
396 |
<dd> |
<dd> |
397 |
<p>If the node is an |
<p>If the node is an |
398 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
399 |
On getting, the attributes <em class=rfc2119>MUST</em> return the |
On getting, the attributes <em class=rfc2119>MUST</em> return |
400 |
name of the element type.</p> |
<code>null</code>.</p> |
401 |
|
|
402 |
<div class="note memo"> |
<div class="note memo"> |
403 |
<p>Thus, on setting the attributes does nothing |
<p>Thus, on setting the attributes does nothing |
409 |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
410 |
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
411 |
|
|
412 |
<p>If the node is an |
<p>If the node is an |
413 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p> |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
414 |
|
The attribute <em class=rfc2119>MUST</em> behave as if the node |
415 |
<pre class=ed> |
were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd> |
416 |
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
<dt><code id=normalize>normalize</code></dt> |
417 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is |
418 |
[['''MUST''']] return the normalized default value |
normalized, any nodes in the <code>NamedNodeMap</code> object in the |
419 |
of the attribute. |
<a href="#elementTypes"><code>elementTypes</code></a> attribute |
420 |
|
<em class=rfc2119>MUST</em> be normalized as well.</p> |
421 |
@@ |
|
422 |
|
<p>When an |
423 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
424 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
is normalized, any nodes in the <code>NamedNodeMap</code> object in the |
425 |
object [['''MUST''']] behave as if it were an |
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
426 |
[CODE(DOMi)@en[[[Attr]]]] object. |
attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd> |
|
|
|
|
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> |
|
|
</dd> |
|
|
<dt class=ed>@@ ...</dt> |
|
427 |
</dl> |
</dl> |
428 |
|
|
429 |
</div> |
</div> |
430 |
|
|
431 |
|
<div class=section id=section-document> |
432 |
|
<h3>Modifications to the <code id=Document>Document</code> Interface</h3> |
433 |
|
|
434 |
|
<!-- |
435 |
|
<p>If an attempt is made to adopt an |
436 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
437 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
438 |
|
the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em> |
439 |
|
raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@ |
440 |
|
ref</span>.</p> |
441 |
|
--> |
442 |
|
|
443 |
|
<div class=ed> |
444 |
|
<p>Future version of the specification is expected to define what should |
445 |
|
be done if <code>adoptNode</code> or <code>importNode</code> method have to |
446 |
|
adopt or import an |
447 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
448 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node. |
449 |
|
In addition it might revise behavior of those methods for |
450 |
|
<a href="#Entity"><code>Entity</code></a>, |
451 |
|
<a href="#Notation"><code>Notation</code></a>, and/or |
452 |
|
<a href="#DocumentType"><code>DocumentType</code></a> nodes. |
453 |
|
Behavior of <code>normalizeDocument</code> method for these kinds of |
454 |
|
nodes might also be defined in some day.</p> |
455 |
|
</div> |
456 |
|
|
457 |
|
</div> |
458 |
|
|
459 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
460 |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
461 |
|
|
462 |
|
<p>The <a href="#Document"><code>Document</code></a> nodes |
463 |
|
<em class=rfc2119>MUST</em> also implement the |
464 |
|
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface.</p> |
465 |
|
|
466 |
|
<p>An instance of the |
467 |
|
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> |
468 |
|
interface <em class=rfc2119>MUST</em> be able to be obtained by using |
469 |
|
binding$B!>(Bspecific casting methods on an instance of the |
470 |
|
<a href="#Document"><code>Document</code></a> interface (if such |
471 |
|
casting methods are available) or by using the method <code>getFeature</code> |
472 |
|
with parameter values |
473 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
474 |
|
and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the |
475 |
|
<a href="#Document"><code>Document</code></a> node supports the |
476 |
|
feature <code>Core</code> version <code>3.0</code> |
477 |
|
<span class=ed>[DOM3]</span>).</p> |
478 |
|
|
479 |
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
480 |
<em class=rfc2119>MUST</em> be implemented as following:</p> |
<em class=rfc2119>MUST</em> be implemented as following:</p> |
481 |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
496 |
raises (DOMException); |
raises (DOMException); |
497 |
}</code></pre> |
}</code></pre> |
498 |
|
|
|
<div class=ed>@@ cast definition</div> |
|
|
|
|
499 |
<dl> |
<dl> |
500 |
<dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>, |
<dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>, |
501 |
method</dt> |
method</dt> |
630 |
<code>manakaiEntityBaseURI</code>, and |
<code>manakaiEntityBaseURI</code>, and |
631 |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
632 |
<dd>No explicit value is set.</dd> |
<dd>No explicit value is set.</dd> |
633 |
<dt><code>manakaiHasReplacementTree</code> and |
<dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and |
634 |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
635 |
<dd><code>false</code>.</dd> |
<dd><code>false</code>.</dd> |
636 |
<dt><code>nodeName</code></dt> |
<dt><code>nodeName</code></dt> |
798 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
799 |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
800 |
|
|
801 |
|
<p>The <a href="#DocumentType"><code>DocumentType</code></a> nodes |
802 |
|
<em class=rfc2119>MUST</em> also implement the |
803 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
804 |
|
interface.</p> |
805 |
|
|
806 |
|
<p>An instance of the |
807 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
808 |
|
interface <em class=rfc2119>MUST</em> be able to be obtained by using |
809 |
|
binding$B!>(Bspecific casting methods on an instance of the |
810 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface (if such |
811 |
|
casting methods are available) or by using the method <code>getFeature</code> |
812 |
|
with parameter values |
813 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
814 |
|
and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the |
815 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node supports the |
816 |
|
feature <code>Core</code> version <code>3.0</code> |
817 |
|
<span class=ed>[DOM3]</span>).</p> |
818 |
|
|
819 |
<div class="note memo"> |
<div class="note memo"> |
820 |
<p>This interface is a separated interface from the |
<p>This interface is a separated interface from the |
821 |
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
822 |
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
823 |
for the historical reason.</p> |
for the historical reason.</p> |
824 |
|
|
825 |
|
<p class=ed>Should the interface be merged with |
826 |
|
<a href="#DocumentType"><code>DocumentType</code></a>?</p> |
827 |
</div> |
</div> |
828 |
|
|
829 |
<p>The |
<p>The |
852 |
raises (DOMException); |
raises (DOMException); |
853 |
}</code></pre> |
}</code></pre> |
854 |
|
|
|
<pre class=ed> |
|
|
[1] In an implementation that supports the |
|
|
[CODE(URI)@en[[[http://suika.fam.cx/www/2006/feature/XDoctype]]]] |
|
|
feature, a [CODE(DOMi)@en[[[DocumentType]]]] node |
|
|
must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] |
|
|
interface. See [[DOM XML Document Type Definition]>>3] for |
|
|
details. |
|
|
</pre> |
|
|
|
|
855 |
<dl> |
<dl> |
856 |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
857 |
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
858 |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the element |
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
859 |
type definitions belonging to the <code>DocumentType</code> node.</p> |
contains all the element type definitions belonging to the |
860 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
861 |
|
|
862 |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
863 |
<code>NamedNodeMap</code> object that contains all the |
<code>NamedNodeMap</code> object that contains all the |
865 |
nodes belonging to the <code>DocumentType</code> node. The |
nodes belonging to the <code>DocumentType</code> node. The |
866 |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
867 |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
868 |
object <em class=rfc2119>MUST</em> be live and the same object |
object <em class=rfc2119>MUST</em> be <a href="#live">live</a>.</p> |
|
<em class=rfc2119>MUST</em> be returned for any invocation.</p> |
|
869 |
|
|
870 |
<p>If the <code>DocumentType</code> node is created during the process |
<p>If the <code>DocumentType</code> node is created during the process |
871 |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following |
875 |
the <code>ElementTypeDefinition</code> nodes for the element types |
the <code>ElementTypeDefinition</code> nodes for the element types |
876 |
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 |
877 |
attribute definition list declarations processed by the <abbr>XML</abbr> |
attribute definition list declarations processed by the <abbr>XML</abbr> |
878 |
processor. If there is more than one element type declarations for an |
processor. If there are more than one element type declarations for an |
879 |
element type, then the declarations other than the first one |
element type, then the declarations other than the first one |
880 |
<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 |
881 |
<code>NamedNodeMap</code> object.</p></dd> |
<code>NamedNodeMap</code> object.</p></dd> |
882 |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
883 |
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
884 |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the general |
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
885 |
entities belonging to the <code>DocumentType</code> node.</p> |
contains all the general entities belonging to the |
886 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
887 |
|
|
888 |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
889 |
same value as the <code>entities</code> attribute (defined in the |
same value as the <code>entities</code> attribute (defined in the |
890 |
<code>DocumentType</code> interface) of the same node.</p> |
<a href="#DocumentType"><code>DocumentType</code></a> interface) of the same |
891 |
|
node.</p> |
892 |
|
|
893 |
<div class="note memo"> |
<div class="note memo"> |
894 |
<p>This attribute is part of the interface for historical reason.</p> |
<p>This attribute is part of the interface for historical reason.</p> |
916 |
--> |
--> |
917 |
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
918 |
<code>notations</code>, read$B!>(Bonly</code> |
<code>notations</code>, read$B!>(Bonly</code> |
919 |
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
920 |
notations belonging to the <code>DocumentType</code> node.</p> |
contains all the notations belonging to the |
921 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
922 |
|
|
923 |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
924 |
same value as the <code>notations</code> attribute (defined in the |
same value as the <code>notations</code> attribute (defined in the |
925 |
<code>DocumentType</code> interface) of the same node.</p> |
<a href="#DocumentType"><code>DocumentType</code></a> interface) of the same |
926 |
|
node.</p> |
927 |
|
|
928 |
<div class="note memo"> |
<div class="note memo"> |
929 |
<p>This attribute is part of the interface for historical reason.</p> |
<p>This attribute is part of the interface for historical reason.</p> |
930 |
<p>Implementations are not required to implement the |
<p>Implementations are not required to implement the |
931 |
<code>notations</code> attribute twice (for <code>DocumentType</code> |
<code>notations</code> attribute twice (for |
932 |
and <code>DocumentTypeDefinition</code> interfaces); they share exactly |
<a href="#DocumentType"><code>DocumentType</code></a> and |
933 |
same definition.</p> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
934 |
|
interfaces); they share exactly same definition.</p> |
935 |
</div></dd> |
</div></dd> |
936 |
<!-- |
<!-- |
937 |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
958 |
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 |
959 |
reflected by that of the object. |
reflected by that of the object. |
960 |
--> |
--> |
961 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
962 |
|
method</dt> |
963 |
|
<dd><p>Returns the |
964 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
965 |
|
with the specified name.</p> |
966 |
|
|
967 |
|
<p>The |
968 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
969 |
|
parameter is the name of the element type.</p> |
970 |
|
|
971 |
<dt class=ed>@@ other members... |
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
972 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
973 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
974 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
975 |
|
<code>NamedNodeMap</code> object in the |
976 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
977 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
978 |
|
<code>null</code>.</p></dd> |
979 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
980 |
|
method</dt> |
981 |
|
<dd><p>Returns the |
982 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
983 |
|
with the specified name.</p> |
984 |
|
|
985 |
|
<p>The |
986 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
987 |
|
parameter is the name of the element type.</p> |
988 |
|
|
989 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
990 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
991 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
992 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
993 |
|
<code>NamedNodeMap</code> object in the |
994 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
995 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
996 |
|
<code>null</code>.</p></dd> |
997 |
|
<dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>, |
998 |
|
method</dt> |
999 |
|
<dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node |
1000 |
|
with the specified name.</p> |
1001 |
|
|
1002 |
|
<p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn> |
1003 |
|
parameter is the name of the general entity.</p> |
1004 |
|
|
1005 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1006 |
|
<a href="#Entity"><code>Entity</code></a> node, |
1007 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
1008 |
|
<a href="#getEntityNode-name"><var>name</var></a>, in the |
1009 |
|
<code>NamedNodeMap</code> object in the |
1010 |
|
<a href="#entities"><code>entities</code></a> attribute of the |
1011 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
1012 |
|
<code>null</code>.</p></dd> |
1013 |
|
<dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>, |
1014 |
|
method</dt> |
1015 |
|
<dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node |
1016 |
|
with the specified name.</p> |
1017 |
|
|
1018 |
|
<p>The |
1019 |
|
<dfn id=getNotationNode-name class=dom-param><var>name</var></dfn> |
1020 |
|
parameter is the name of the notation.</p> |
1021 |
|
|
1022 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1023 |
|
<a href="#Notation"><code>Notation</code></a> node, |
1024 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
1025 |
|
<a href="#getNotationNode-name"><var>name</var></a>, in the |
1026 |
|
<code>NamedNodeMap</code> object in the |
1027 |
|
<a href="#notations"><code>notations</code></a> attribute of the |
1028 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
1029 |
|
<code>null</code>.</p></dd> |
1030 |
|
<dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>, |
1031 |
|
method</dt> |
1032 |
|
<dd class=ed>@@</dd> |
1033 |
|
<dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>, |
1034 |
|
method</dt> |
1035 |
|
<dd class=ed>@@</dd> |
1036 |
|
<dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>, |
1037 |
|
method</dt> |
1038 |
|
<dd class=ed>@@</dd> |
1039 |
</dl> |
</dl> |
1040 |
|
|
1041 |
<div class=ed> |
<div class=ed> |
1050 |
|
|
1051 |
<p>The nodes of type |
<p>The nodes of type |
1052 |
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
1053 |
represents an element type definition. Such a node implements the |
represents an element type definition. Such a node |
1054 |
|
<em class=rfc2119>MUST</em> implement the |
1055 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1056 |
interface, which extends the <a href="#Node"><code>Node</code></a> |
interface, which extends the <a href="#Node"><code>Node</code></a> |
1057 |
interface.</p> |
interface.</p> |
1070 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1071 |
node for that element type.</p> |
node for that element type.</p> |
1072 |
|
|
1073 |
|
<p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1074 |
|
node cannot be a child of any node. An |
1075 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1076 |
|
cannot have any child node.</p> |
1077 |
|
|
1078 |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1079 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1080 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1081 |
readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1082 |
|
|
1083 |
<span class=ed>@@ more</span> |
readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>; |
1084 |
|
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a> |
1085 |
|
(in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>); |
1086 |
|
void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a> |
1087 |
|
(in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>) |
1088 |
|
raises (DOMException); |
1089 |
}</code></pre> |
}</code></pre> |
1090 |
|
|
1091 |
<pre class=ed> |
<dl> |
1092 |
[DFN@en[[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute]] |
<dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn> |
1093 |
of the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] |
of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt> |
1094 |
interface is defined in [[manakai//DOM Extensions]>>50].</pre> |
<dd><p>The |
1095 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a> |
1096 |
|
attribute of |
1097 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1098 |
|
<a href="#Entity"><code>Entity</code></a>, and |
1099 |
|
<a href="#Notation"><code>Notation</code></a> interface contains the |
1100 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node to which the node |
1101 |
|
is attached.</p> |
1102 |
|
|
1103 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return a |
1104 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node. It |
1105 |
|
<em class=rfc2119>MUST</em> be such a node that whose |
1106 |
|
<a href="#elementTypes"><code>elementTypes</code></a> (for an |
1107 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1108 |
|
node), <a href="#entities"><code>entities</code></a> (for an |
1109 |
|
<a href="#Entity"><code>Entity</code></a> node), or |
1110 |
|
<a href="#notations"><code>notations</code></a> (for a |
1111 |
|
<a href="#Notation"><code>Notation</code></a> node) attribute contains the |
1112 |
|
<code>NamedNodeMap</code> object that contains the node. If there is no such |
1113 |
|
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
1114 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
1115 |
|
<dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn> |
1116 |
|
of type NamedNodeMap, read$B!>(Bonly</dt> |
1117 |
|
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
1118 |
|
contains all the attribute definitions belonging to the |
1119 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1120 |
|
node.</p> |
1121 |
|
|
1122 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1123 |
|
<code>NamedNodeMap</code> object that contains all the |
1124 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1125 |
|
belonging to the |
1126 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1127 |
|
The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1128 |
|
read$B!>(Bonly if and only if the node is read$B!>(Bonly. The |
1129 |
|
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1130 |
|
<a href="#live">live</a>.</p> |
1131 |
|
|
1132 |
|
<p>If the |
1133 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1134 |
|
is created during the process to create a <abbr>DOM</abbr> from an |
1135 |
|
<abbr>XML</abbr> document, the following requirements are applied: The |
1136 |
|
<code>NamedNodeMap</code> object in the |
1137 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1138 |
|
attribute <em class=rfc2119>MUST</em> be so transformed that the object |
1139 |
|
contains the |
1140 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1141 |
|
corresponding to the attribute definitions in the attribute definition |
1142 |
|
list declarations processed by the <abbr>XML</abbr> processor and |
1143 |
|
associated to the element type represented by the node. If there are more |
1144 |
|
than one attribute definitions for an attribute, then the definitions other |
1145 |
|
than the first one <em class=rfc2119>MUST</em> be ignored for the purpose |
1146 |
|
of constructing the <code>NamedNodeMap</code> object.</p></dd> |
1147 |
|
<dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>, |
1148 |
|
method</dt> |
1149 |
|
<dd><p>Return the |
1150 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1151 |
|
with the specified name.</p> |
1152 |
|
|
1153 |
|
<p>The |
1154 |
|
<dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn> |
1155 |
|
parameter is the name of the attribute.</p> |
1156 |
|
|
1157 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1158 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
1159 |
|
whose <a href="#nodeName"><code>nodeName</code></a> attribute value is |
1160 |
|
equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>, |
1161 |
|
in the <code>NamedNodeMap</code> in the |
1162 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1163 |
|
attribute of the node. If there is no such node, it |
1164 |
|
<em class=rfc2119>MUST</em> return <code>null</code>.</p></dd> |
1165 |
|
<dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>, |
1166 |
|
method</dt> |
1167 |
|
<dd class=ed>@@</dd> |
1168 |
|
</dl> |
1169 |
|
|
1170 |
|
<div class=ed> |
1171 |
|
<p>A future version of the specification might define a set of attributes |
1172 |
|
and methods for representing and accessing to the content model of the |
1173 |
|
element type.</p> |
1174 |
|
</div> |
1175 |
</div> |
</div> |
1176 |
|
|
1177 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
1179 |
|
|
1180 |
<p>The nodes of type |
<p>The nodes of type |
1181 |
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
1182 |
represents an attribute definition. Such a node implements the |
represents an attribute definition. Such a node |
1183 |
|
<em class=rfc2119>MUST</em> implement the |
1184 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
1185 |
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
1186 |
|
|
1194 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
1195 |
that attribute.</p> |
that attribute.</p> |
1196 |
|
|
1197 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1198 |
|
node cannot be a child of any node. An |
1199 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1200 |
|
can have zero or more child nodes of same kinds as those allowed for |
1201 |
|
<code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p> |
1202 |
|
|
1203 |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1204 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1205 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1227 |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
1228 |
|
|
1229 |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
1230 |
|
readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>; |
1231 |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
|
|
|
|
<span class=ed>...</span> |
|
1232 |
}</code></pre> |
}</code></pre> |
1233 |
|
|
1234 |
<dl> |
<dl> |
1351 |
definition group.</p> |
definition group.</p> |
1352 |
|
|
1353 |
</dd> |
</dd> |
1354 |
|
<dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of |
1355 |
|
type <code>DOMStringList</code>, read$B!>(Bonly</dt> |
1356 |
|
<dd><p>The list of allowed attribute values.</p> |
1357 |
|
|
1358 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1359 |
|
<code>DOMStringList</code> object associated to this attribute. The object |
1360 |
|
<em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of |
1361 |
|
zero or more characters respectively, possibly with duplications. The |
1362 |
|
object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node |
1363 |
|
is read$B!>(Bonly.</p> |
1364 |
|
|
1365 |
|
<p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1366 |
|
node is created during the process to create a <abbr>DOM</abbr> from an |
1367 |
|
<abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain |
1368 |
|
the names or name tokens allowed for the attribute defined by the node. |
1369 |
|
If the document is well$B!>(Bformed, the object will be empty unless |
1370 |
|
the <a href="#declaredType"><code>declaredType</code></a> is |
1371 |
|
<a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1372 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p> |
1373 |
|
|
1374 |
|
<p>If the <a href="#declaredType"><code>declaredType</code></a> is different |
1375 |
|
from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1376 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute |
1377 |
|
<em class=rfc2119>MUST</em> be ignored for the purpose of serializing |
1378 |
|
into (part of) <abbr>XML</abbr> document.</p> |
1379 |
|
|
1380 |
|
<div class="note memo"> |
1381 |
|
<p>When serializing the node it should be noted that the object might |
1382 |
|
be empty, might contain duplications, and might contain strings that are |
1383 |
|
not names or name tokens.</p> |
1384 |
|
</div></dd> |
1385 |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1386 |
type <code>unsigned short</code></dt> |
type <code>unsigned short</code></dt> |
1387 |
<dd><p>The type of the default for the attribute. It is expected that this |
<dd><p>The type of the default for the attribute. It is expected that this |
1454 |
|
|
1455 |
</div> |
</div> |
1456 |
|
|
1457 |
|
<div class=section id=section-entity> |
1458 |
|
<h3>Modifications to the <code id=Entity>Entity</code> Interface</h3> |
1459 |
|
|
1460 |
|
<p>The implementation of the <a href="#Entity"><code>Entity</code></a> |
1461 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1462 |
|
<pre class=idl><code>// Modifications to the Entity interface |
1463 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1464 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1465 |
|
attribute DOMString <a href="#notationName">notationName</a>; |
1466 |
|
|
1467 |
|
// Additions to the Entity interface |
1468 |
|
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
1469 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1470 |
|
|
1471 |
|
attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>; |
1472 |
|
</code></pre> |
1473 |
|
|
1474 |
|
<p>The <code id=notationName>notationName</code> attribute of the |
1475 |
|
<a href="#Entity"><code>Entity</code></a> interface is no longer |
1476 |
|
read$B!>(Bonly.</p> |
1477 |
|
|
1478 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1479 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1480 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1481 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
1482 |
|
associated to the attribute. No lexical validation is performed. The new |
1483 |
|
value <em class=rfc2119>MAY</em> be <code>null</code>.</p> |
1484 |
|
|
1485 |
|
<dl> |
1486 |
|
<dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn> |
1487 |
|
of type boolean</dt> |
1488 |
|
<dd><p>Whether the structure of the replacement text of the entity |
1489 |
|
is available via the <code>NodeList</code> object in the |
1490 |
|
<code>childNodes</code> attribute of the entity.</p> |
1491 |
|
|
1492 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1493 |
|
the value associated to this attribute.</p> |
1494 |
|
|
1495 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1496 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1497 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1498 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1499 |
|
value associated to this attribute.</p> |
1500 |
|
|
1501 |
|
<div class="note memo"> |
1502 |
|
<p>The attribute can be set to <code>false</code> even if the |
1503 |
|
<a href="#Entity"><code>Entity</code></a> node has any child node. |
1504 |
|
If the attribute is set to <code>false</code>, then any child node of |
1505 |
|
the <a href="#Entity"><code>Entity</code></a> node ought to be ignored, |
1506 |
|
say, for the purpose of serialization.</p> |
1507 |
|
</div> |
1508 |
|
|
1509 |
|
<p>When an <code>EntityReference</code> node is created by cloning |
1510 |
|
the replacement subtree of the <a href="#Entity"><code>Entity</code></a> |
1511 |
|
node, if the attribute is set to <code>false</code>, then any descendant |
1512 |
|
of the node <em class=rfc2119>MUST</em> be ignored.</p> |
1513 |
|
|
1514 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1515 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1516 |
|
the following requirements are applied: If the entity is an unparsed |
1517 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1518 |
|
<code>false</code>. Otherwise, if the entity is an external entity whose |
1519 |
|
replacement text is not available, or whose replacement text is not converted |
1520 |
|
to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set |
1521 |
|
to <code>false</code>. Otherwise, the attribute |
1522 |
|
<em class=rfc2119>MUST</em> be set to <code>true</code>.</p> |
1523 |
|
|
1524 |
|
<div class="note memo"> |
1525 |
|
<p>An <a href="#Entity"><code>Entity</code></a> node created by the |
1526 |
|
<a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method |
1527 |
|
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
1528 |
|
attribute set to <code>false</code>.</p> |
1529 |
|
</div></dd> |
1530 |
|
<dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn> |
1531 |
|
of type boolean</dt> |
1532 |
|
<dd><p>Whether the entity is declared by an external entity declaration or |
1533 |
|
not. If the value is <code>true</code>, the entity is declared in an entity |
1534 |
|
declaration in the external subset entity or in an external parameter entity. |
1535 |
|
If the value is <code>false</code>, the entity is declared in an entity |
1536 |
|
declaration in the internal subset, or the node is created in memory.</p> |
1537 |
|
|
1538 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1539 |
|
the value associated to this attribute.</p> |
1540 |
|
|
1541 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1542 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1543 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1544 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1545 |
|
value associated to this attribute.</p> |
1546 |
|
|
1547 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1548 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1549 |
|
the following requirements are applied: If the entity is an unparsed |
1550 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1551 |
|
<code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the |
1552 |
|
attribute <em class=rfc2119>MUST</em> be set to the value of whether the |
1553 |
|
entity is declared by an external markup declaration or not.</p></dd> |
1554 |
|
</dl> |
1555 |
</div> |
</div> |
1556 |
|
|
1557 |
|
<div class=section id=section-notation> |
1558 |
|
<h3>Modifications to the <code id=Notation>Notation</code> Interface</h3> |
1559 |
|
|
1560 |
|
<p>The implementation of the <a href="#Notation"><code>Notation</code></a> |
1561 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1562 |
|
<pre class=idl><code>// Modifications to the Notation interface |
1563 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1564 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1565 |
|
|
1566 |
|
// Addition to the Notation interface |
1567 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1568 |
|
</code></pre> |
1569 |
|
</div> |
1570 |
|
|
1571 |
|
</div> |
1572 |
|
|
1573 |
<div id="references" class="section reference"> |
<div id="references" class="section reference"> |
1574 |
<h2>References</h2> |
<h2>References</h2> |