/[suikacvs]/markup/xml/domdtdef/domdtdef-work.en.html
Suika

Contents of /markup/xml/domdtdef/domdtdef-work.en.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.24 - (hide annotations) (download) (as text)
Sat Dec 8 13:10:28 2007 UTC (16 years, 11 months ago) by wakaba
Branch: MAIN
Changes since 1.23: +63 -14 lines
File MIME type: text/html
References to bindings specs

1 wakaba 1.1 <!DOCTYPE html>
2     <html lang="en" class="formal-specification status-work-in-progress">
3     <head>
4 wakaba 1.2 <title>DOM Document Type Definition Module</title>
5 wakaba 1.1 <link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec">
6 wakaba 1.4 <link rel="stylesheet" href="http://suika.fam.cx/www/style/def/dom">
7 wakaba 1.1 <link rel="license" href="http://suika.fam.cx/c/gnu/fdl">
8     </head>
9     <body class="has-abstract">
10    
11     <div class="header">
12 wakaba 1.2 <h1>DOM Document Type Definition Module</h1>
13 wakaba 1.21 <h2>Working Draft <time datetime=2007-12-08>8 December 2007</time></h2>
14 wakaba 1.1
15     <dl class="versions-uri">
16     <dt>This Version</dt>
17 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work"
18     >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>&gt;</code></dd>
19 wakaba 1.1 <dt>Latest Version</dt>
20 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef"
21     >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef</a>&gt;</code></dd>
22 wakaba 1.1 <dt>Latest Working Draft</dt>
23 wakaba 1.2 <dd><code class="URI">&lt;<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work"
24     >http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>&gt;</code></dd>
25 wakaba 1.1 <!-- <dt>Previous Version</dt> -->
26     <dt>Version History</dt>
27 wakaba 1.2 <dd><code class=URI>&lt;<a href="http://suika.fam.cx/gate/cvs/markup/xml/domdtdef/domdtdef-work.en.html">http://suika.fam.cx/gate/cvs/markup/xml/domdtdef/domdtdef-work.en.html</a>&gt;</code></dd>
28     <dt id=author>Author</dt>
29 wakaba 1.1 <dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author"
30     lang=ja>Wakaba</a>
31     <code class="mail">&lt;<a href="mailto:w@suika.fam.cx" rel="author"
32     >w@suika.fam.cx</a>&gt;</code></dd>
33     </dl>
34    
35     <p class="copyright" lang="en">&#xA9; <time>2007</time> <a
36     href="http://suika.fam.cx/~wakaba/who?" rel="author">Wakaba</a>.
37     Permission is granted to copy, distribute and/or modify this document
38     under the terms of the <a rel="license"
39     href="http://www.gnu.org/copyleft/fdl.html">GNU Free Documentation License</a>,
40     Version 1.2
41     or any later version published by the <a
42     href="http://www.fsf.org/">Free Software Foundation</a>;
43     with no Invariant Sections, no Front$B!>(BCover Texts, and no Back$B!>(BCover
44     Texts. A copy of the license is
45     available at <code class="URI">&lt;<a
46     href="http://www.gnu.org/copyleft/fdl.html"
47     rel="license">http://www.gnu.org/copyleft/fdl.html</a>&gt;</code>.</p>
48     </div>
49    
50     <div id="abstract" class="section">
51     <h2>Abstract</h2>
52    
53 wakaba 1.22 <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 wakaba 1.1 </div>
58    
59     <div id="status" class="section">
60     <h2>Status of This Document</h2>
61    
62     <p class=section-info><em>This section describes the status of this document
63     at the time of its publication. Other documents
64     might supersede this document.</em></p>
65    
66     <p>This document is a working draft, produced as part of the
67     <a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a>
68     project. It might be updated, replaced, or obsoleted by
69     other documents at any time. It is inappropriate to
70     cite this document as other than <q>work in progress</q>.</p>
71    
72     <p>Comments on this document are welcome and
73     may be sent to the <a href="#author">author</a>.</p>
74    
75     <p>Translations of thie document might be available.
76     The English version of the document is the only
77     normative version.</p>
78     </div>
79    
80     <div id="introduction" class="section">
81     <h2>Introduction</h2>
82    
83     <p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p>
84    
85 wakaba 1.3 <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
87     interfaces and modifications to existing <abbr>DOM</abbr> interfaces,
88     over which <abbr>DOM</abbr> applications are able to access to the
89     definitions of the document type.</p>
90    
91 wakaba 1.23 <p>Interfaces defined in this document are partially modeled and inspired by
92     early drafts of <abbr>DOM</abbr> Level 1
93     <cite class="bibref informative">[<a href="#ref-DOM1WD">DOM1WD</a>]</cite>,
94     <abbr>DOM</abbr> Level 3 Abstract Schemas <abbr>W3C</abbr> Note
95     <cite class="bibref informative">[<a href="#ref-DOM3AS">DOM3AS</a>]</cite>,
96     and <abbr>XML</abbr> Schema <abbr>API</abbr> specification
97     <cite class="bibref informative">[<a href="#ref-XSAPI">XSAPI</a>]</cite>, but
98     they are not compatible with any of them as a whole.</p>
99 wakaba 1.1 </div>
100    
101 wakaba 1.22 <div class="section" id=conformance>
102     <h2>Conformance Requirements</h2>
103 wakaba 1.1
104 wakaba 1.22 <div class=section id=terminology>
105     <h3>Terminology</h3>
106 wakaba 1.1
107     <p>All examples and notes in this specification are non$B!>(Bnormative,
108     as are all sections explicitly marked non$B!>(Bnormative. Everything
109     else in this specification is normative.</p>
110    
111 wakaba 1.22 <p>The key words <q><em class="rfc2119">MUST</em></q>,
112     <q><em class="rfc2119">MUST NOT</em></q>, and <q><em class=rfc2119>MAY</em></q>
113     in this document are to be interpreted as described in
114     <a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr>
115     2119</a>
116     <cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p>
117 wakaba 1.3
118 wakaba 1.22 <p>Conformance requirements phrased as algorithms or specific steps
119     <em class=rfc2119>MAY</em> be implemented in any manner, so long as the end
120     result is equivalent. Requirements phrased in the imperative as part of
121     algorithms are to be interpreted with the meaning of the key word used in
122     introducing the algorithm.</p>
123    
124     <p>Sometimes an exception is phrased as being required to be raised. As
125     specified in the <abbr>DOM</abbr> Core specification
126 wakaba 1.23 <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>,
127 wakaba 1.22 when the value of the <code>strictErrorChecking</code> attribute of the
128     <a href="#Document"><code>Document</code></a> node is <code>false</code>,
129     then the exception is not have to be raised.</p>
130    
131     <p>Some conformance requirements are phrased as requirements on interfaces,
132     attributes, methods, or objects. Such requirements are applied to
133     implementations.</p>
134    
135     <p>The construction <q>a <code><var>Foo</var></code> object</q>, where
136     <code><var>Foo</var></code> is an interface, is used instead of the more
137     accurate <q>an object implementing the interface
138     <code><var>Foo</var></code></q>.</p>
139    
140     <p>The construction <q>raise a <code><var>Bar</var></code></q>, where
141     <code><var>Bar</var></code> is an exception code, is used instead of the more
142     accurate <q>raise an exception implementing the interface
143 wakaba 1.23 <code>DOMException</code>
144     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
145     with its <code>code</code> attribute set to
146     <code><var>Bar</var></code></q>.</p>
147    
148     <p>The terms
149     <em id=live><a href="http://www.whatwg.org/specs/web-apps/current-work/#live">live</a></em>
150     and <em id=setting>setting</em> and <em id=getting>getting</em> of an attribute
151     is defined in the HTML5 specification
152     <cite class="bibref normative">[<a href="#ref-HTML5">HTML5</a>]</cite>.</p>
153 wakaba 1.22
154     <p>The term
155 wakaba 1.23 <em id=read-only><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/glossary.html#dt-readonly-node">read$B!>(Bonly (node)</a></em>
156     is defined in the <abbr>DOM</abbr> Level 3 Core specification
157     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
158 wakaba 1.3
159 wakaba 1.24 <p>The <em id=idl-fragment><abbr>IDL</abbr> fragments</em> in this document are
160     to be interpreted as described in the <cite>Language Bindings for
161     <abbr>DOM</abbr> Specifications</cite> specification
162     <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.</p>
163    
164     <p>Some <abbr>IDL</abbr> fragments are presented as <i>patch</i> to an
165     <abbr>IDL</abbr> fragment defined in another document. They are to be
166     interpreted as an instance of
167     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMembers"><code>InterfaceMembers</code></a>
168     <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.
169     If the <abbr>IDL</abbr> fragment to which the <i>patch</i> is applied has any
170     instance of
171     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
172     with same
173     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#prod-identifier"><code>identifier</code></a>
174     part as that of any instance of
175     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
176     in the <i>patch</i>, then the former instance of
177     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#proddef-InterfaceMember"><code>InterfaceMember</code></a>
178     <em class=rfc2119>MUST</em> be ignored.</p>
179 wakaba 1.22 </div>
180 wakaba 1.12
181 wakaba 1.22 <div class=section id=conformance-categories>
182     <h3>Conformance Categories</h3>
183 wakaba 1.18
184 wakaba 1.22 <p>There are several kinds of products that can be claim to conform to
185     this specification:</p>
186     <dl>
187     <dt id=category-dom-implementation><abbr>DOM</abbr> Implementation</dt>
188     <dd>A <abbr>DOM</abbr> implementation (or just written as
189     <q>implementation</q> in this document) provides a way to access
190     <abbr>DOM</abbr> trees for applications by implementing interfaces defined
191     by this and other documents. Unless otherwise noted, requirements in this
192     document are applied to <abbr>DOM</abbr> implementations. To implement
193     all the features in this document, the implementation have to implement
194 wakaba 1.23 some version of <abbr>DOM</abbr> Core (e.g. <abbr>DOM</abbr> Level 3 Core
195     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>)
196 wakaba 1.24 with one or more language binding (e.g. ECMAScript and Java bindings
197     <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>
198     or Perl binding
199     <cite class="bibref normative">[<a href="#ref-DOMPERL">DOMPERL</a>]</cite>).
200     A conforming implementation <em class=rfc2119>MUST</em> also be a
201     <a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/#dfn-conforming-implementation">conforming
202     implementation</a> of the <abbr>IDL</abbr> fragments in this document, as
203     described in the <cite>Language Bindings for <abbr>DOM</abbr>
204     Specifications</cite> specification
205     <cite class="bibref normative">[<a href="#ref-DOMBIND">DOMBIND</a>]</cite>.</dd>
206 wakaba 1.22 <dt id=category-xml-parser><abbr>XML</abbr> Parser (<abbr>XML</abbr> document
207     to <abbr>DOM</abbr> tree converter)</dt>
208     <dd>A software component that converts
209 wakaba 1.23 <abbr>XML</abbr> 1.0 or 1.1 document
210     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
211     <a href="#ref-XML11">XML11</a>]</cite> (or fragment thereof) into a
212 wakaba 1.22 <abbr>DOM</abbr> tree (or fragment thereof) in the context of this
213     document. Note that this document does not define any particular way to
214     parse an <abbr>XML</abbr> document or to construct an <abbr>DOM</abbr>
215     document, but it defines constraints for such processing.</dd>
216     <dt id=category-xml-serializer><abbr>XML</abbr> Serializer (<abbr>DOM</abbr>
217     tree to <abbr>XML</abbr> document converter)</dt>
218     <dd>A software component that converts
219     <abbr>DOM</abbr> tree (or fragment thereof) into an <abbr>XML</abbr> 1.0 or
220     1.1 document (or fragment thereof). Note that this document does not define
221     any particular way to serialize a <abbr>DOM</abbr> tree, but it defines
222     constraints for such processing.</dd>
223     <dt id=category-infoset-dom><abbr>XML</abbr> Information Set to
224     <abbr>DOM</abbr> Tree Converter</dt>
225     <dd>A software component that converts an <abbr>XML</abbr> information set
226 wakaba 1.23 <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>
227 wakaba 1.22 into a <abbr>DOM</abbr> tree. Note that this documetn does not define
228     any particular way for the convertion, but it defines constraints for
229     such processing.</dd>
230     <dt id=category-dom-infoset><abbr>DOM</abbr> Tree to <abbr>XML</abbr>
231     Information Set Converter</dt>
232     <dd>A software component that converts a <abbr>DOM</abbr> tree into
233     an <abbr>XML</abbr> information set. Note that this documetn does not define
234     any particular way for the convertion, but it defines constraints for
235     such processing.</dd>
236     </dl>
237 wakaba 1.18 </div>
238 wakaba 1.3 </div>
239    
240     <div class=section id=dom-dtdef>
241     <h2><abbr>DOM</abbr> Document Type Definition Module</h2>
242    
243     <p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0,
244 wakaba 1.20 introduces four interfaces:
245     <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>,
246     <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>,
247     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
248     and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>.
249     In addition, it modifies existing interfaces
250 wakaba 1.3 <a href="#Node"><code>Node</code></a>,
251 wakaba 1.20 <a href="#Document"><code>Document</code></a>,
252 wakaba 1.12 <a href="#DocumentType"><code>DocumentType</code></a>,
253 wakaba 1.20 <a href="#Entity"><code>Entity</code></a>, and
254 wakaba 1.23 <a href="#Notation"><code>Notation</code></a>
255     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
256 wakaba 1.3
257     <div class=section id=features>
258 wakaba 1.22 <h3>Feature String</h3>
259 wakaba 1.3
260     <p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of
261     the <abbr>DOM</abbr> Document Type Definition module, the
262     <code>hasFeature</code> method of a <code>DOMImplementation</code> object
263 wakaba 1.23 <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
264 wakaba 1.3 <em class=rfc2119>MUST</em> return <code>true</code> when the parameters are
265 wakaba 1.19 set to
266     <dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn>
267 wakaba 1.22 and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively. Any
268     method that takes one or more feature names, with or without version number,
269     such as <code>hasFeature</code> or <code>getFeature</code>,
270     <em class=rfc2119>MUST</em> behave in a manner consistent with it.</p>
271 wakaba 1.4 </div>
272    
273 wakaba 1.14 <div class=section id=section-node>
274     <h3>Modifications to the <code id=Node>Node</code> Interface</h3>
275    
276 wakaba 1.15 <p>The implementation of the
277     <a href="#Node"><code>Node</code></a> interface
278 wakaba 1.24 <em class=rfc2119>MUST</em> be modified as the following
279     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
280 wakaba 1.14 <pre class=idl><code>// Additions to the Node interface
281    
282     // Additions to the NodeType definition group
283     const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001;
284     const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002;
285     </pre>
286    
287     <p>This specification adds two new types (subinterfaces) of
288     <a href="#Node"><code>Node</code></a>: element type definition (node type
289     <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>,
290     interface
291     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and
292     attribute definition (node type
293     <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>,
294     interface
295     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For
296     these kinds of nodes, methods and attributes in the
297     <a href="#Node"><code>Node</code></a> interface must behave as following:</p>
298    
299     <dl>
300 wakaba 1.15 <dt><code id=attributes>attributes</code></dt>
301     <dd>
302     <p>On getting, the attribute <em class=rfc2119>MUST</em> return
303     <code>null</code>.</p>
304     </dd>
305     <dt><code id=baseURI>baseURI</code></dt>
306     <dd>
307     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
308     value of the <a href="#baseURI"><code>baseURI</code></a> attribute
309     of the node in the <code>ownerDocument</code> attribute of the node.
310     Note that the value might be <code>null</code>.</p>
311     </dd>
312 wakaba 1.20 <dt><code id=cloneNode>cloneNode</code></dt>
313 wakaba 1.22 <dd class=ed>
314     <p>A future version of the specification is expected to define the
315     behavior of the <a href="#cloneNode"><code>cloneNode</code></a> method
316     for those kinds of nodes. In addition, it might revise behavior of
317     the method for <a href="#Entity"><code>Entity</code></a>,
318     <a href="#Notation"><code>Notation</code></a>, and/or
319     <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
320     </dd>
321     <!--
322 wakaba 1.20 <dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd>
323 wakaba 1.22 -->
324 wakaba 1.20 <dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt>
325 wakaba 1.22 <dd class=ed>
326     <p>A future version of the specification is expected to define the
327     behavior of the method
328     for those kinds of nodes. In addition, it might revise behavior of
329     the method for <a href="#Entity"><code>Entity</code></a>,
330     <a href="#Notation"><code>Notation</code></a>, and/or
331     <a href="#DocumentType"><code>DocumentType</code></a> nodes.</p>
332     </dd>
333 wakaba 1.20 <dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt>
334     <dd><p>When invoked, the method <em class=rfc2119>MUST</em> return
335     <code>false</code>.</p></dd>
336 wakaba 1.19 <dt><code id=isEqualNode>isEqualNode</code></dt>
337     <dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method,
338     following items are added to the list of conditions for equality:</p>
339    
340     <ul>
341     <li>
342     <p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a>
343     and at least one of them has the support for the feature
344     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p>
345     <ul>
346 wakaba 1.23 <li>they are equal according to <abbr>DOM</abbr> Level 3 Core definition
347     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>,
348     and
349 wakaba 1.19 <li>either:
350     <ul><!--
351     <li>both of them does not support the feature
352     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>-->
353     <li>exactly one of them support the feature
354     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
355     and the <code>length</code> attribute of the <code>NamedNodeMap</code>
356     object in the <a href="#elementTypes"><code>elementTypes</code></a>
357     attribute of it is equal to <code>0</code>, or</li>
358     <li>both of them support the feature
359     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
360     and the values of the
361     <a href="#elementTypes"><code>elementTypes</code></a> attributes are
362     equal (equality of the
363     <a href="#elementTypes"><code>elementTypes</code></a> attribute is same
364     as that for the <code>attributes</code> attribute).</li>
365     </ul>
366     </li>
367     </ul>
368     </li>
369    
370     <li><p>If the nodes are
371     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
372     the values of the
373     <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
374     attributes are equal (equality of the
375     <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
376     attribute is same as that for the <code>attributes</code> attribute).</p></li>
377    
378     <li><p>If the nodes are
379     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
380     the values of the <a href="#declaredType"><code>declaredType</code></a> and
381     the <a href="#defaultType"><code>defaultType</code></a> attributes are
382     equal respectively.</p></li>
383    
384     <li><p>If the nodes are
385     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>,
386     the values of the <code>DOMStringList</code> objects in the
387     <a href="#allowedTokens"><code>allowedTokens</code></a> attributes
388     are equal, i.e. their <code>length</code> attribute values are equal and
389     each string exists in a list is contained in another list (their indeces
390     may be different), with an additional constraint that the number of the
391     items that are equal to a string in a list is equal to the number
392     of the items equal to the string in another list.</p></li>
393     </ul></dd>
394 wakaba 1.20 <dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and
395     <code id=lookupPrefix>lookupPrefix</code></dt>
396     <dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return
397     <code>null</code>.</p></dd>
398 wakaba 1.15 <dt><code id=nodeName>nodeName</code></dt>
399     <dd>
400     <p>If the node is an
401     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
402     On getting, the attribute <em class=rfc2119>MUST</em> return the
403     name of the element type definition represented by the node.</p>
404    
405     <p>If the node is an
406     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
407     On getting, the attribute <em class=rfc2119>MUST</em> return the
408     name of the attribute definition represented by the node.</p>
409     </dd>
410 wakaba 1.14 <dt><code id=nodeType>nodeType</code></dt>
411     <dd>
412 wakaba 1.24 <p>On getting, the attribute <!--<em class=rfc2119>MUST</em>--> returns
413     <!-- NOTE: No MUST, to avoid circular reference (nodeType==8100[12]
414     is defined that they MUST implement ElementType|AttributeDefinition). -->
415 wakaba 1.14 <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
416     (if the node is an
417     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or
418     <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
419     (if the node is an
420     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p>
421    
422     <!-- NodeType -->
423     <p>Two constants are added to the <code id=NodeType>NodeType</code>
424     definition group of the <a href="#Node"><code>Node</code></a> interface as
425     following:</p>
426     <table>
427     <thead>
428     <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
429     </thead>
430     <tbody>
431     <tr>
432     <th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn>
433     <td><code>81001</code><td>The node is an
434     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr>
435     <tr>
436     <th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn>
437     <td><code>81002</code><td>The node is an
438     <a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr>
439     </tbody>
440     </table>
441     </dd>
442 wakaba 1.15 <dt><code id=nodeValue>nodeValue</code> and
443     <code id=textContent>textContent</code></dt>
444     <dd>
445     <p>If the node is an
446     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>:
447 wakaba 1.21 On getting, the attributes <em class=rfc2119>MUST</em> return
448     <code>null</code>.</p>
449 wakaba 1.15
450 wakaba 1.23 <div class="note memo">
451     <p>Thus, on setting the attributes does nothing
452     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
453     </div>
454 wakaba 1.15
455 wakaba 1.21 <p>If the node is an
456     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:
457     The attribute <em class=rfc2119>MUST</em> behave as if the node
458 wakaba 1.23 were <code>Attr</code>
459     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p></dd>
460 wakaba 1.20 <dt><code id=normalize>normalize</code></dt>
461     <dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is
462     normalized, any nodes in the <code>NamedNodeMap</code> object in the
463     <a href="#elementTypes"><code>elementTypes</code></a> attribute
464     <em class=rfc2119>MUST</em> be normalized as well.</p>
465    
466     <p>When an
467     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
468     is normalized, any nodes in the <code>NamedNodeMap</code> object in the
469     <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
470     attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd>
471 wakaba 1.14 </dl>
472    
473     </div>
474    
475 wakaba 1.20 <div class=section id=section-document>
476     <h3>Modifications to the <code id=Document>Document</code> Interface</h3>
477    
478 wakaba 1.22 <!--
479 wakaba 1.20 <p>If an attempt is made to adopt an
480     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
481     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
482     the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em>
483     raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@
484     ref</span>.</p>
485 wakaba 1.22 -->
486    
487     <div class=ed>
488     <p>Future version of the specification is expected to define what should
489     be done if <code>adoptNode</code> or <code>importNode</code> method have to
490     adopt or import an
491     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or
492     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node.
493     In addition it might revise behavior of those methods for
494     <a href="#Entity"><code>Entity</code></a>,
495     <a href="#Notation"><code>Notation</code></a>, and/or
496     <a href="#DocumentType"><code>DocumentType</code></a> nodes.
497     Behavior of <code>normalizeDocument</code> method for these kinds of
498     nodes might also be defined in some day.</p>
499     </div>
500    
501 wakaba 1.20 </div>
502    
503 wakaba 1.4 <div class=section id=section-documentxdoctype>
504 wakaba 1.7 <h3>The <code>DocumentXDoctype</code> Interface</h3>
505 wakaba 1.4
506 wakaba 1.22 <p>The <a href="#Document"><code>Document</code></a> nodes
507     <em class=rfc2119>MUST</em> also implement the
508     <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface.</p>
509    
510     <p>An instance of the
511     <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>
512     interface <em class=rfc2119>MUST</em> be able to be obtained by using
513     binding$B!>(Bspecific casting methods on an instance of the
514     <a href="#Document"><code>Document</code></a> interface (if such
515     casting methods are available) or by using the method <code>getFeature</code>
516     with parameter values
517     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
518     and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
519     <a href="#Document"><code>Document</code></a> node supports the
520     feature <code>Core</code> version <code>3.0</code>
521 wakaba 1.23 <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>).</p>
522 wakaba 1.22
523 wakaba 1.15 <p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface
524 wakaba 1.24 <em class=rfc2119>MUST</em> be implemented as the following
525     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
526 wakaba 1.4 <pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> {
527 wakaba 1.5 DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a>
528     (in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>)
529     raises (DOMException);
530 wakaba 1.12 <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a>
531 wakaba 1.5 (in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>)
532     raises (DOMException);
533 wakaba 1.12 <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a>
534 wakaba 1.5 (in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>)
535     raises (DOMException);
536 wakaba 1.12 <a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a>
537 wakaba 1.5 (in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>)
538     raises (DOMException);
539 wakaba 1.12 <a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a>
540 wakaba 1.5 (in DOMString <a href="#createNotation-name"><var>name</var></a>)
541     raises (DOMException);
542 wakaba 1.4 }</code></pre>
543    
544 wakaba 1.5 <dl>
545     <dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>,
546     method</dt>
547     <dd>
548     <p>This method creates a <code>DocumentType</code> node with the specified
549     name, belonging to the document.</p>
550 wakaba 1.23 <p>The
551     <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn>
552 wakaba 1.5 parameter is the name of the document type.</p>
553    
554     <p>When invoked, the method <em class=rfc2119>MUST</em> create and
555 wakaba 1.23 return a <a href="#DocumentType"><code>DocumentType</code></a> node with
556     the following attributes:</p>
557 wakaba 1.5 <dl>
558     <dt><code>attributes</code>, <code>parentNode</code></dt>
559     <dd><code>null</code>.</dd>
560 wakaba 1.23 <dt><a href="#elementTypes"><code>elementTypes</code></a>,
561     <a href="#entities"><code>entities</code></a>, and
562     <a href="#notations"><code>notations</code></a></dt>
563     <dd>Empty <code>NamedNodeMap</code> objects respectively.</dd>
564 wakaba 1.5 <dt><code>childNodes</code></dt>
565     <dd>An empty <code>NodeList</code> object.</dd>
566 wakaba 1.23 <dt><a href="#internalSubset"><code>internalSubset</code></a>,
567     <a href="#publicId"><code>publicId</code></a>, and
568     <a href="#systemId"><code>systemId</code></a></dt>
569 wakaba 1.5 <dd>Empty strings.</dd>
570     <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
571     <dd><code>false</code>.</dd>
572     <dt><code>nodeName</code></dt>
573     <dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd>
574     <dt><code>ownerDocument</code></dt>
575 wakaba 1.23 <dd>The <a href="#Document"><code>Document</code></a> node over which the
576     method is invoked.</dd>
577 wakaba 1.5 </dl>
578     <p>In addition, the method <em class=rfc2119>MUST</em> be marked as
579     containing five general entity declarations: <code>amp</code>,
580     <code>lt</code>, <code>gt</code>, <code>quot</code>, and
581     <code>apos</code>.</p>
582     </dd>
583     <dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>,
584     method</dt>
585     <dd>
586     <p>This method creates a <code>ElementTypeDefinition</code> node with the
587     specified name, belonging to the document.</p>
588     <p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn>
589     parameter is the name of the element type defined by the element
590     type definition.</p>
591 wakaba 1.6
592     <p>When invoked, the method <em class=rfc2119>MUST</em> create and
593     return an
594     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
595     node with the following attributes:</p>
596     <dl>
597     <dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt>
598     <dd>An empty <code>NamedNodeMap</code> object.</dd>
599 wakaba 1.23 <dt><a href="#attributes"><code>attributes</code></a>,
600     <code>parentNode</code></dt>
601 wakaba 1.6 <dd><code>null</code>.</dd>
602     <dt><code>childNodes</code></dt>
603     <dd>An empty <code>NodeList</code> object.</dd>
604     <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
605     <dd><code>false</code>.</dd>
606 wakaba 1.23 <dt><a href="#nodeName"><code>nodeName</code></a></dt>
607 wakaba 1.6 <dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd>
608     <dt><code>ownerDocument</code></dt>
609     <dd>The <code>Document</code> node over which the method is invoked.</dd>
610     <dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt>
611     <dd><code>null</code>.</dd>
612     <dt class=ed>@@ Ensure all attributes are defined</dt>
613     </dl>
614 wakaba 1.5 </dd>
615     <dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>,
616     method</dt>
617     <dd>
618     <p>This method creates a <code>AttributeDefinition</code> node with the
619     specified name, belonging to the document.</p>
620     <p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn>
621     parameter is the name of the attribute defined by the attribute
622     definition.</p>
623 wakaba 1.6
624     <p>When invoked, the method <em class=rfc2119>MUST</em> create and
625     return an
626     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
627     node with the following attributes:</p>
628     <dl>
629 wakaba 1.23 <dt><a href="#allowedTokens"><code>allowedTokens</code></a></dt>
630 wakaba 1.6 <dd>An empty <code>DOMStringList</code> object.</dd>
631 wakaba 1.23 <dt><a href="#attributes"><code>attributes</code></a>,
632 wakaba 1.6 <a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>,
633     and <code>parentNode</code></dt>
634     <dd><code>null</code>.</dd>
635     <dt><code>childNodes</code></dt>
636     <dd>An empty <code>NodeList</code> object.</dd>
637 wakaba 1.23 <dt><a href="#declaredType"><code>declaredType</code></a></dt>
638 wakaba 1.6 <dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd>
639 wakaba 1.23 <dt><a href="#defaultType"><code>defaultType</code></a></dt>
640 wakaba 1.6 <dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd>
641     <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
642     <dd><code>false</code>.</dd>
643 wakaba 1.23 <dt><a href="#nodeName"><code>nodeName</code></a></dt>
644 wakaba 1.6 <dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd>
645     <dt><code>ownerDocument</code></dt>
646     <dd>The <code>Document</code> node over which the method is invoked.</dd>
647     <dt class=ed>@@ Ensure all attributes are defined</dt>
648     </dl>
649    
650 wakaba 1.23 <!-- This requirement, if not droped, should be part of xml-id spec.
651 wakaba 1.6 <div class=ed>
652     <p>@@ Should we keep these statements?:
653     However, if the &lt;cfg::cfg|xml-id> configuration
654     parameter is set to <code>true</code> and the <var>name</var>
655     is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]]
656     attribute is set to <code>ID_ATTR</code>.
657     [CODE(DOMa)@en[[[defaultType]]]]?</p>
658 wakaba 1.23 </div>-->
659 wakaba 1.5 </dd>
660     <dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>,
661     method</dt>
662     <dd>
663 wakaba 1.7 <p>This method creates a <a href="#Entity"><code>Entity</code></a> node
664     with the specified name, which represents a general entity, belonging to
665     the document.</p>
666 wakaba 1.5 <p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn>
667     parameter is the name of the general entity.</p>
668 wakaba 1.7
669     <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
670     an <a href="#Entity"><code>Entity</code></a> node with the following
671     attributes:</p>
672     <dl>
673 wakaba 1.23 <dt><code>attributes</code>,
674     <a href="#notationName"><code>notationName</code></a>,
675 wakaba 1.7 <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
676     and <code>parentNode</code></dt>
677     <dd><code>null</code>.</dd>
678     <dt><code>childNodes</code></dt>
679     <dd>An empty <code>NodeList</code> object.</dd>
680     <dt><code>manakaiDeclarationBaseURI</code>,
681     <code>manakaiEntityBaseURI</code>, and
682     <code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt>
683     <dd>No explicit value is set.</dd>
684 wakaba 1.19 <dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and
685 wakaba 1.7 <code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
686     <dd><code>false</code>.</dd>
687     <dt><code>nodeName</code></dt>
688     <dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd>
689     <dd>
690     <div class="note memo">
691     <p>It is not an error for
692     <a href="#createGeneralEntity-name"><var>name</var></a> matching
693     to the name of one of predefined general parsed entities in
694     <abbr>XML</abbr> or <abbr>HTML</abbr>. For example,
695     <a href="#createGeneralEntity-name"><var>name</var></a> might be
696     <code>amp</code>, resulting in an
697     <a href="#Entity"><code>Entity</code></a> node
698     with its <code>nodeName</code> attribute set to <code>amp</code>.</p>
699     </div>
700     </dd>
701     <dt><code>ownerDocument</code></dt>
702     <dd>The <code>Document</code> node over which the method is invoked.</dd>
703 wakaba 1.23 <dt><a href="#publicId"><code>publicId</code></a> and
704     <a href="#systemId"><code>systemId</code></a></dt>
705 wakaba 1.7 <dd><code>null</code>.</dd>
706     <dd class=ed>@@ publicId and systemId should be empty string?</dd>
707     <dt class=ed>@@ Ensure all attributes are defined</dd>
708     </dl>
709 wakaba 1.5 </dd>
710     <dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>,
711     method</dt>
712     <dd>
713     <p>This method creates a <code>Notation</code> node with the
714     specified name, belonging to the document.</p>
715     <p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn>
716     parameter is the name of the notation.</p>
717 wakaba 1.7
718     <p>When invoked, the method <em class=rfc2119>MUST</em> create and return
719     a <code>Notation</code> node with the following attributes:</p>
720     <dl>
721     <dt><code>attributes</code>,
722     <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>,
723     and <code>parentNode</code></dt>
724     <dd><code>null</code>.</dd>
725     <dt><code>childNodes</code></dt>
726     <dd>An empty <code>NodeList</code> object.</dd>
727     <dt><code>manakaiDeclarationBaseURI</code></dt>
728     <dd>No explicit value is set.</dd>
729     <dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt>
730     <dd><code>false</code>.</dd>
731     <dt><code>nodeName</code></dt>
732     <dd><a href="#createNotation-name"><var>name</var></a>.</dd>
733     <dt><code>ownerDocument</code></dt>
734     <dd>The <code>Document</code> node over which the method is invoked.</dd>
735 wakaba 1.23 <dt><a href="#publicId"><code>publicId</code></a> and
736     <a href="#systemId"><code>systemId</code></a></dt>
737 wakaba 1.7 <dd><code>null</code>.</dd>
738     <dd class=ed>@@ publicId and systemId should be empty string?</dd>
739     <dt class=ed>@@ Ensure all attributes are defined</dt>
740     </dl>
741 wakaba 1.5 </dd>
742     </dl>
743 wakaba 1.4
744 wakaba 1.7 <p>These methods <em class=rfc2119>MUST</em> raise an
745 wakaba 1.23 <code>INVALID_CHARACTER_ERR</code> if <var>name</var> is <em>not</em> a legal
746     <code>Name</code>
747     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
748     <a href="#ref-XML11">XML11</a>]</cite> according to the <abbr>XML</abbr>
749     version specified in the <code>xmlVersion</code> attribute of the
750     <a href="#Document"><code>Document</code></a> node.</p>
751 wakaba 1.7
752     <div class="note memo">
753     <p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now,
754 wakaba 1.23 since <abbr>DOM</abbr> Level 3 Core specification
755     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>
756     does not define it for <a href="#Document"><code>Document</code></a>
757     methods.</p>
758 wakaba 1.7
759     <p><var>name</var> does not have to be a namespace qualified name.</p>
760     </div>
761 wakaba 1.4
762     </div>
763    
764 wakaba 1.16
765     <div class=section id=section-documenttype>
766     <h3>Modifications to the <code id=DocumentType>DocumentType</code>
767     Interface</h3>
768    
769     <p>A <a href="#DocumentType"><code>DocumentType</code></a> interface
770     <em class=rfc2119>MAY</em> contain zero or more
771     <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
772     nodes in the <code>NodeList</code> object contained in the
773     <code>childNodes</code> attribute of the
774     <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
775    
776     <p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created
777     during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr>
778     document, the <code>NodeList</code> object in the <code>childNodes</code>
779     object <em class=rfc2119>MUST</em> contains the
780     <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>
781     nodes representing the processing instructions in the document type
782 wakaba 1.23 definition of the document processed
783     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
784     <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr> processor. If
785     the <a href="#DocumentType"><code>DocumentType</code></a> node is marked as
786     <a href="#read-only">read$B!>(Bonly</a>, then all the child nodes
787     <em class=rfc2119>MUST</em> also be marked as
788     <a href="#read-only">read$B!>(Bonly</a>.</p>
789 wakaba 1.16
790     <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created
791 wakaba 1.23 from a
792     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.doctype">document
793     type declaration information item</a>
794     <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>,
795 wakaba 1.16 the <code>NodeList</code> object in the <code>childNodes</code> attribute
796     of the node <em class=rfc2119>MUST</em> contain the
797     <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
798     created from the processing instruction information items in the list in the
799     [children] property of the document type declaration item in the same
800     order.</p>
801    
802     <p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to
803     a document type declaration information item, the list in the [children]
804     property <em class=rfc2119>MUST</em> contain the processng instruction
805     information items created from the
806     <a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes
807     in the <code>NodeList</code> object in the <code>childNodes</code> attribute
808     of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
809    
810     <p>The implementation of the
811     <a href="#DocumentType"><code>DocumentType</code></a> interface
812 wakaba 1.24 <em class=rfc2119>MUST</em> be modified as the following
813     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
814 wakaba 1.16 <pre class=idl><code>// Modifications to the DocumentType interface
815     attribute DOMString <a href="#publicId">publicId</a>;
816     attribute DOMString <a href="#systemId">systemId</a>;
817    
818     attribute DOMString <a href="#internalSubset">internalSubset</a>;
819     </code></pre>
820    
821     <p>The <code id=publicId>publicId</code> attribute and the
822     <code id=systemId>systemId</code> attribute of
823     <a href="#DocumentType"><code>DocumentType</code></a>,
824     <a href="#Entity"><code>Entity</code></a>, and
825     <a href="#Notation"><code>Notation</code></a> interfaces are no longer
826     read$B!>(Bonly.</p>
827    
828     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
829 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
830     <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it <em class=rfc2119>MUST</em>
831     set the specified value as the value associated to the attribute. No
832     normalization, relative reference resolution, or lexical validation is
833     performed. <span class=ed>@@ If the new value is <code>null</code>, should an e
834     mpty string be set?</span></p>
835 wakaba 1.16
836     <div class="note memo">
837     <p>Setting an invalid identifier might make the node unserializable.
838     Setting a public identifier while leaveing system identifier unspecified
839     would also make the <a href="#DocumentType"><code>DocumentType</code></a>
840     or <a href="#Entity"><code>Entity</code></a> node unserializable.</p>
841     </div>
842    
843     <div class=ed>
844     <p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p>
845     </div>
846    
847     <p>The <code id=internalSubset>internalSubset</code> attribute of the
848     <a href="#DocumentType"><code>DocumentType</code></a> interface is no longer
849     read$B!>(Bonly.</p>
850    
851     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
852 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
853     <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it <em class=rfc2119>MUST</em>
854     set the specified value as the value associated to the attribute. No
855     normalization, or lexical validation is performed. <span class=ed>@@ If the
856     new value is <code>null</code>, should an empty string be set?</span></p>
857 wakaba 1.16
858     </div>
859    
860 wakaba 1.4 <div class=section id=section-documenttypedefinition>
861 wakaba 1.7 <h3>The <code>DocumentTypeDefinition</code> Interface</h3>
862 wakaba 1.4
863 wakaba 1.22 <p>The <a href="#DocumentType"><code>DocumentType</code></a> nodes
864     <em class=rfc2119>MUST</em> also implement the
865     <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
866     interface.</p>
867    
868     <p>An instance of the
869     <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
870     interface <em class=rfc2119>MUST</em> be able to be obtained by using
871     binding$B!>(Bspecific casting methods on an instance of the
872     <a href="#DocumentType"><code>DocumentType</code></a> interface (if such
873     casting methods are available) or by using the method <code>getFeature</code>
874     with parameter values
875     <a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>
876     and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the
877     <a href="#DocumentType"><code>DocumentType</code></a> node supports the
878     feature <code>Core</code> version <code>3.0</code>
879 wakaba 1.23 <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>).</p>
880 wakaba 1.22
881 wakaba 1.17 <div class="note memo">
882     <p>This interface is a separated interface from the
883     <a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions
884     to the <a href="#DocumentType"><code>DocumentType</code></a>,
885     for the historical reason.</p>
886 wakaba 1.22
887     <p class=ed>Should the interface be merged with
888     <a href="#DocumentType"><code>DocumentType</code></a>?</p>
889 wakaba 1.17 </div>
890    
891 wakaba 1.15 <p>The
892     <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
893 wakaba 1.24 interface <em class=rfc2119>MUST</em> be implemented as the following
894     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
895 wakaba 1.4 <pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> {
896 wakaba 1.8 readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>;
897     readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>;
898     readonly attribute NamedNodeMap <a href="#notations">notations</a>;
899    
900 wakaba 1.13 <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a>
901     (in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>);
902     <a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a>
903     (in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>);
904     <a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a>
905     (in DOMString <a href="#getNotationNode-name"><var>name</var></a>);
906    
907     void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a>
908     (in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>)
909     raises (DOMException);
910     void <a href="#setGeneralEntityNode">setGeneralEntityNode</a>
911     (in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>)
912     raises (DOMException);
913     void <a href="#setNotationNode">setNotationNode</a>
914     (in DOMString <a href="#setNotationNode-node"><var>node</var></a>)
915     raises (DOMException);
916 wakaba 1.4 }</code></pre>
917    
918 wakaba 1.8 <dl>
919     <dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of
920     type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
921 wakaba 1.22 <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
922     contains all the element type definitions belonging to the
923     <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
924 wakaba 1.8
925     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
926     <code>NamedNodeMap</code> object that contains all the
927     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
928     nodes belonging to the <code>DocumentType</code> node. The
929     <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly
930 wakaba 1.23 if and only if the node is <a href="#read-only">read$B!>(Bonly</a>. The
931     <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
932     <a href="#live">live</a>.</p>
933 wakaba 1.8
934     <p>If the <code>DocumentType</code> node is created during the process
935     to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following
936     requirements are applied: The <code>NamedNodeMap</code> object in the
937     <a href="#elementTypes"><code>elementType</code></a> attribute
938     <em class=rfc2119>MUST</em> be so transformed that the object contains
939     the <code>ElementTypeDefinition</code> nodes for the element types
940     whose name is presented as the <code>Name</code> of the element type or
941 wakaba 1.23 attribute definition list declarations processed
942     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
943     <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr>
944 wakaba 1.21 processor. If there are more than one element type declarations for an
945 wakaba 1.8 element type, then the declarations other than the first one
946     <em class=rfc2119>MUST</em> be ignored for the purpose of constructing the
947     <code>NamedNodeMap</code> object.</p></dd>
948     <dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn>
949     of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt>
950 wakaba 1.22 <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
951     contains all the general entities belonging to the
952     <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
953 wakaba 1.8
954     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
955     same value as the <code>entities</code> attribute (defined in the
956 wakaba 1.22 <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
957     node.</p>
958 wakaba 1.8
959     <div class="note memo">
960     <p>This attribute is part of the interface for historical reason.</p>
961     </div></dd>
962     <!--
963 wakaba 1.4 All entities declared in the document type definition
964     contained in or referenced from the document entity
965     might not be exposed through this collection, depending
966     on the information provided by the XML processor for
967     the DOM implementation. In particular, it might not
968     contain any entity if entity references are expanded
969     at the parse time. An implementation [['''MUST NOT''']]
970     expose an [CODE(DOMi)@en[[[Entity]]]] node whose [CODE(DOMa)@en[[[nodeName]]]]
971     is equal to the name of one of five predefined general entities in
972     XML through the collection as the result of parsing of an XML
973     document that has no error. Duplicate entity declarations are also discarded.
974    
975     The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
976     object that contains all the [CODE(DOMi)@en[[[Entity]]]] nodes
977     representing general entities belong to the node. The returned
978     [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
979     the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
980     and therefore any change of read-only flag on the node is immediately
981     reflected by that of the object.
982 wakaba 1.8 -->
983     <dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type
984     <code>notations</code>, read$B!>(Bonly</code>
985 wakaba 1.22 <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
986     contains all the notations belonging to the
987     <a href="#DocumentType"><code>DocumentType</code></a> node.</p>
988 wakaba 1.8
989     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
990     same value as the <code>notations</code> attribute (defined in the
991 wakaba 1.22 <a href="#DocumentType"><code>DocumentType</code></a> interface) of the same
992     node.</p>
993 wakaba 1.8
994     <div class="note memo">
995     <p>This attribute is part of the interface for historical reason.</p>
996     <p>Implementations are not required to implement the
997 wakaba 1.22 <code>notations</code> attribute twice (for
998     <a href="#DocumentType"><code>DocumentType</code></a> and
999     <a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>
1000     interfaces); they share exactly same definition.</p>
1001 wakaba 1.8 </div></dd>
1002     <!--
1003 wakaba 1.4 If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is
1004     created from an XML document, duplicate notation declarations, if any, in DTD
1005     [['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]]
1006     object and only the first declaration [['''MUST''']] be
1007     made available as a [CODE(DOMi)@en[[[Notation]]]] node.
1008    
1009     ;; This definition is based on one for the
1010     [CODE(DOMa)@en[[[notations]]]] attribute of the
1011     [CODE(DOMi)@en[[[DocumentType]]]] interface in DOM XML module.
1012     Since duplication is violation to the Validity Constraint,
1013     XML parsers might vary on how notations are notified to
1014     the application. In particular, [CODE(InfoProp)@en[[[notations]]]]
1015     property of the document information item in XML Information Set
1016     is so defined that in case ''any'' notation is declared for
1017     multiple times then the property has no value.
1018    
1019     The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]]
1020     object that contains all the [CODE(DOMi)@en[[[Notation]]]] nodes
1021     representing notations belong to the node. The returned
1022     [CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if
1023     the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live
1024     and therefore any change of read-only flag on the node is immediately
1025     reflected by that of the object.
1026 wakaba 1.8 -->
1027 wakaba 1.20 <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
1028     method</dt>
1029     <dd><p>Returns the
1030     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1031     with the specified name.</p>
1032    
1033     <p>The
1034     <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
1035     parameter is the name of the element type.</p>
1036    
1037     <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1038     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1039     whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1040     <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
1041     <code>NamedNodeMap</code> object in the
1042     <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
1043     node. If there is no such node, it <em class=rfc2119>MUST</em> return
1044     <code>null</code>.</p></dd>
1045     <dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>,
1046     method</dt>
1047     <dd><p>Returns the
1048     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1049     with the specified name.</p>
1050    
1051     <p>The
1052     <dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn>
1053     parameter is the name of the element type.</p>
1054    
1055     <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1056     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1057     whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1058     <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the
1059     <code>NamedNodeMap</code> object in the
1060     <a href="#elementTypes"><code>elementTypes</code></a> attribute of the
1061     node. If there is no such node, it <em class=rfc2119>MUST</em> return
1062     <code>null</code>.</p></dd>
1063     <dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>,
1064     method</dt>
1065     <dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node
1066     with the specified name.</p>
1067    
1068     <p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn>
1069     parameter is the name of the general entity.</p>
1070    
1071     <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1072     <a href="#Entity"><code>Entity</code></a> node,
1073     whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1074     <a href="#getEntityNode-name"><var>name</var></a>, in the
1075     <code>NamedNodeMap</code> object in the
1076     <a href="#entities"><code>entities</code></a> attribute of the
1077     node. If there is no such node, it <em class=rfc2119>MUST</em> return
1078     <code>null</code>.</p></dd>
1079     <dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>,
1080     method</dt>
1081 wakaba 1.23 <dd><p>Returns the <a href="#Notation"><code>Notation</code></a> node
1082 wakaba 1.20 with the specified name.</p>
1083 wakaba 1.4
1084 wakaba 1.20 <p>The
1085     <dfn id=getNotationNode-name class=dom-param><var>name</var></dfn>
1086     parameter is the name of the notation.</p>
1087    
1088     <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1089     <a href="#Notation"><code>Notation</code></a> node,
1090     whose <a href="#nodeName"><code>nodeName</code></a> is equal to
1091     <a href="#getNotationNode-name"><var>name</var></a>, in the
1092     <code>NamedNodeMap</code> object in the
1093     <a href="#notations"><code>notations</code></a> attribute of the
1094     node. If there is no such node, it <em class=rfc2119>MUST</em> return
1095     <code>null</code>.</p></dd>
1096     <dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>,
1097     method</dt>
1098     <dd class=ed>@@</dd>
1099     <dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>,
1100     method</dt>
1101     <dd class=ed>@@</dd>
1102     <dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>,
1103     method</dt>
1104     <dd class=ed>@@</dd>
1105 wakaba 1.8 </dl>
1106 wakaba 1.4
1107 wakaba 1.8 <div class=ed>
1108     <p>A future version of this interface might define the
1109     <code>parameterEntities</code> and getter/setter for parameter entities.
1110     </div>
1111 wakaba 1.4
1112     </div>
1113    
1114     <div class=section id=section-elementtypedefinition>
1115 wakaba 1.7 <h3>The <code>ElementTypeDefinition</code> Interface</h3>
1116 wakaba 1.4
1117 wakaba 1.17 <p>The nodes of type
1118     <a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>
1119 wakaba 1.21 represents an element type definition. Such a node
1120     <em class=rfc2119>MUST</em> implement the
1121 wakaba 1.17 <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1122     interface, which extends the <a href="#Node"><code>Node</code></a>
1123     interface.</p>
1124    
1125     <p>An element type definition represents a definition of the element type.
1126     It is corresponding to the element type declaration in <abbr>DTD</abbr>.
1127     However, an
1128     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1129     does not represent the element type definition in <abbr>DTD</abbr> itself.
1130     Even if there are more than one element type declarations for an element type
1131     in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1132     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1133     node for that element type. In addition, if there are attribute definition
1134     declarations for an element type, even when there is no element type
1135     declaration for that element type, the <abbr>DOM</abbr> will contain an
1136     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1137     node for that element type.</p>
1138    
1139 wakaba 1.21 <p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1140     node cannot be a child of any node. An
1141     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1142     cannot have any child node.</p>
1143    
1144 wakaba 1.15 <p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1145 wakaba 1.24 interface <em class=rfc2119>MUST</em> be implemented as the following
1146     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1147 wakaba 1.10 <pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> {
1148 wakaba 1.19 readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1149 wakaba 1.10
1150 wakaba 1.21 readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>;
1151     <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a>
1152     (in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>);
1153     void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a>
1154     (in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>)
1155     raises (DOMException);
1156 wakaba 1.4 }</code></pre>
1157    
1158 wakaba 1.19 <dl>
1159     <dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn>
1160     of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt>
1161     <dd><p>The
1162     <a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>
1163     attribute of
1164     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1165     <a href="#Entity"><code>Entity</code></a>, and
1166 wakaba 1.23 <a href="#Notation"><code>Notation</code></a> interfaces contain the
1167 wakaba 1.19 <a href="#DocumentType"><code>DocumentType</code></a> node to which the node
1168     is attached.</p>
1169    
1170     <p>On getting, the attribute <em class=rfc2119>MUST</em> return a
1171     <a href="#DocumentType"><code>DocumentType</code></a> node. It
1172     <em class=rfc2119>MUST</em> be such a node that whose
1173     <a href="#elementTypes"><code>elementTypes</code></a> (for an
1174     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1175     node), <a href="#entities"><code>entities</code></a> (for an
1176     <a href="#Entity"><code>Entity</code></a> node), or
1177     <a href="#notations"><code>notations</code></a> (for a
1178     <a href="#Notation"><code>Notation</code></a> node) attribute contains the
1179     <code>NamedNodeMap</code> object that contains the node. If there is no such
1180     a <a href="#DocumentType"><code>DocumentType</code></a> node,
1181     then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd>
1182 wakaba 1.21 <dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn>
1183     of type NamedNodeMap, read$B!>(Bonly</dt>
1184 wakaba 1.22 <dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that
1185     contains all the attribute definitions belonging to the
1186 wakaba 1.21 <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>
1187     node.</p>
1188    
1189     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1190     <code>NamedNodeMap</code> object that contains all the
1191     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1192     belonging to the
1193     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1194     The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1195 wakaba 1.23 read$B!>(Bonly if and only if the node is <a href="#read-only">read$B!>(Bonly</a>.
1196     The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be
1197 wakaba 1.22 <a href="#live">live</a>.</p>
1198 wakaba 1.21
1199     <p>If the
1200     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node
1201     is created during the process to create a <abbr>DOM</abbr> from an
1202     <abbr>XML</abbr> document, the following requirements are applied: The
1203     <code>NamedNodeMap</code> object in the
1204     <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1205     attribute <em class=rfc2119>MUST</em> be so transformed that the object
1206     contains the
1207     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1208     corresponding to the attribute definitions in the attribute definition
1209 wakaba 1.23 list declarations processed
1210     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1211     <a href="#ref-XML11">XML11</a>]</cite> by the <abbr>XML</abbr> processor and
1212 wakaba 1.21 associated to the element type represented by the node. If there are more
1213     than one attribute definitions for an attribute, then the definitions other
1214     than the first one <em class=rfc2119>MUST</em> be ignored for the purpose
1215     of constructing the <code>NamedNodeMap</code> object.</p></dd>
1216     <dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>,
1217     method</dt>
1218     <dd><p>Return the
1219     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1220     with the specified name.</p>
1221    
1222     <p>The
1223     <dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn>
1224     parameter is the name of the attribute.</p>
1225    
1226     <p>When invoked, the method <em class=rfc2119>MUST</em> return the
1227     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node,
1228     whose <a href="#nodeName"><code>nodeName</code></a> attribute value is
1229     equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>,
1230     in the <code>NamedNodeMap</code> in the
1231     <a href="#attributeDefinitions"><code>attributeDefinitions</code></a>
1232     attribute of the node. If there is no such node, it
1233     <em class=rfc2119>MUST</em> return <code>null</code>.</p></dd>
1234     <dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>,
1235     method</dt>
1236     <dd class=ed>@@</dd>
1237 wakaba 1.19 </dl>
1238 wakaba 1.20
1239     <div class=ed>
1240     <p>A future version of the specification might define a set of attributes
1241     and methods for representing and accessing to the content model of the
1242     element type.</p>
1243     </div>
1244 wakaba 1.4 </div>
1245    
1246     <div class=section id=section-attributedefinition>
1247 wakaba 1.7 <h3>The <code>AttributeDefinition</code> Interface</h3>
1248 wakaba 1.4
1249 wakaba 1.17 <p>The nodes of type
1250     <a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>
1251 wakaba 1.21 represents an attribute definition. Such a node
1252     <em class=rfc2119>MUST</em> implement the
1253 wakaba 1.17 <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface,
1254     which extends the <a href="#Node"><code>Node</code></a> interface.</p>
1255    
1256     <p>An attribute definition represents a definition of the attribute
1257     associated to an element type. It is corresponding to the attribute definition
1258     in the attribute list declaration in <abbr>DTD</abbr>. However, an
1259     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does
1260     not represent the attribute definition in <abbr>DTD</abbr> itself. Even if
1261     there are more than one attribute definitions for an attribute of an element
1262     type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an
1263     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for
1264     that attribute.</p>
1265    
1266 wakaba 1.21 <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1267     node cannot be a child of any node. An
1268     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1269     can have zero or more child nodes of same kinds as those allowed for
1270 wakaba 1.23 <code>Attr</code> nodes
1271     <cite class="bibref normative">[<a href="#ref-DOM3CORE">DOM3CORE</a>]</cite>.</p>
1272 wakaba 1.21
1273 wakaba 1.15 <p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1274 wakaba 1.24 interface <em class=rfc2119>MUST</em> be implemented as the following
1275     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1276 wakaba 1.10 <pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> {
1277 wakaba 1.9 <span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span>
1278     const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0;
1279     const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1;
1280     const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2;
1281     const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3;
1282     const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4;
1283     const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5;
1284     const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6;
1285     const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7;
1286     const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8;
1287     const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9;
1288     const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10;
1289     const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11;
1290 wakaba 1.17
1291     <span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span>
1292     const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0;
1293     const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1;
1294     const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2;
1295     const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3;
1296     const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4;
1297 wakaba 1.4
1298 wakaba 1.10 readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>;
1299    
1300     readonly attribute unsigned short <a href="#declaredType">declaredType</a>;
1301 wakaba 1.21 readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>;
1302 wakaba 1.10 readonly attribute unsigned short <a href="#defaultType">defaultType</a>;
1303 wakaba 1.4 }</code></pre>
1304    
1305 wakaba 1.11 <dl>
1306     <dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn>
1307     of type
1308     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>,
1309     read$B!>(Bonly</dt>
1310     <dd><p>The
1311     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to
1312     which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1313     node belongs.</p>
1314    
1315     <p>On getting, the attribute <em class=rfc2119>MUST</em> return an
1316     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node.
1317     It <em class=rfc2119>MUST</em> be such a node that whose
1318     <a href="#attributeDefinitons"><code>attributeDefinitions</code></a>
1319     attribute contains the <code>NamedNodeMap</code> object that contains
1320     the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1321     node. If there is no such an
1322     <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node,
1323     then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p>
1324     <dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type
1325     <code>unsigned short</code></dt>
1326 wakaba 1.23 <dd><p>The declared type
1327     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1328     <a href="#ref-XML11">XML11</a>]</cite> of the attribute. It is expected that
1329     this attribute contains a value from the definition group
1330 wakaba 1.11 <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p>
1331    
1332     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1333     value associated to this attribute.</p>
1334    
1335     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1336 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the
1337 wakaba 1.11 <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1338 wakaba 1.23 is <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it
1339 wakaba 1.11 <em class=rfc2119>MUST</em> set the specified value as the value
1340     associated to this attribute.</p>
1341    
1342     <p>If the <code>AttributeDefinition</code> node is created during the process
1343     to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an
1344     appropriate value from the
1345     <a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant
1346     group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1347    
1348     <!-- DeclaredValueType -->
1349 wakaba 1.9 <p>The definition group
1350     <dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains
1351 wakaba 1.11 integers indicating the declared type of attributes. The definition
1352     group contains the following constants:</p>
1353 wakaba 1.9
1354     <table>
1355     <thead>
1356     <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1357     </thead>
1358     <tbody>
1359     <tr>
1360     <th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code>
1361 wakaba 1.23 <td><code>0</code><td><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">No
1362     value</a>
1363     <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>.</tr>
1364 wakaba 1.9 <tr>
1365     <th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code>
1366 wakaba 1.23 <td><code>1</code><td><code>CDATA</code>
1367     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1368     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1369 wakaba 1.9 <tr>
1370     <th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code>
1371 wakaba 1.23 <td><code>2</code><td><code>ID</code>
1372     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1373     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1374 wakaba 1.9 <tr>
1375     <th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code>
1376 wakaba 1.23 <td><code>3</code><td><code>IDREF</code>
1377     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1378     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1379 wakaba 1.9 <tr>
1380     <th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code>
1381 wakaba 1.23 <td><code>4</code><td><code>IDREFS</code>
1382     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1383     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1384 wakaba 1.9 <tr>
1385     <th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code>
1386 wakaba 1.23 <td><code>5</code><td><code>ENTITY</code>
1387     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1388     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1389 wakaba 1.9 <tr>
1390     <th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code>
1391 wakaba 1.23 <td><code>6</code><td><code>ENTITIES</code>
1392     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1393     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1394 wakaba 1.9 <tr>
1395     <th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code>
1396 wakaba 1.23 <td><code>7</code><td><code>NMTOKEN</code>
1397     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1398     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1399 wakaba 1.9 <tr>
1400     <th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code>
1401 wakaba 1.23 <td><code>8</code><td><code>NMTOKENS</code>
1402     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1403     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1404 wakaba 1.9 <tr>
1405     <th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code>
1406 wakaba 1.23 <td><code>9</code><td><code>NOTATION</code>
1407     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1408     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1409 wakaba 1.9 <tr>
1410     <th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code>
1411 wakaba 1.23 <td><code>10</code><td>Enumeration
1412     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1413     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1414 wakaba 1.9 <tr>
1415     <th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code>
1416 wakaba 1.23 <td><code>11</code><td><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">Unknown</a>,
1417     because no declaration for the attribute has been read but the
1418     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#infoitem.document">[all declaration processed]</a>
1419     property
1420     <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>
1421     would be false.</tr>
1422 wakaba 1.9 </tbody>
1423     </table>
1424    
1425     <p>If no attribute type information is available, or if the source
1426 wakaba 1.23 of the information does not distinguish
1427     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">no
1428     value</a> and
1429     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">unknown</a>
1430     <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite>,
1431     then the value
1432 wakaba 1.9 <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>
1433     <em class=rfc2119>MUST</em> be used.</p>
1434    
1435     <div class="note memo">
1436     <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1437     created by the
1438     <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1439     method has its <a href="#declaredType"><code>declaredType</code></a> attribute
1440     set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p>
1441     </div>
1442    
1443 wakaba 1.23 <p>If the source of the information does not distinguish
1444     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">no
1445     value</a> and/or
1446     <a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204/#intro.null">unknown</a>
1447     <cite class="bibref normative">[<a href="#ref-INFOSET">INFOSET</a>]</cite> and
1448     <code>CDATA</code>
1449     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1450     <a href="#ref-XML11">XML11</a>]</cite>, then the value
1451 wakaba 1.9 <a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em>
1452     be used.</p>
1453    
1454 wakaba 1.24 <p>In Perl binding
1455     <cite class="bibref normative">[<a href="#ref-DOMPERL">DOMPERL</a>]</cite>, the
1456 wakaba 1.9 <code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the
1457     <a href="#DeclaredValueType"><code>DeclaredValueType</code></a>
1458 wakaba 1.11 definition group.</p>
1459 wakaba 1.4
1460 wakaba 1.11 </dd>
1461 wakaba 1.21 <dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of
1462     type <code>DOMStringList</code>, read$B!>(Bonly</dt>
1463     <dd><p>The list of allowed attribute values.</p>
1464    
1465     <p>On getting, the attribute <em class=rfc2119>MUST</em> return the
1466     <code>DOMStringList</code> object associated to this attribute. The object
1467     <em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of
1468     zero or more characters respectively, possibly with duplications. The
1469     object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node
1470 wakaba 1.23 is <a href="#read-only">read$B!>(Bonly</a>.</p>
1471 wakaba 1.21
1472     <p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1473     node is created during the process to create a <abbr>DOM</abbr> from an
1474     <abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain
1475     the names or name tokens allowed for the attribute defined by the node.
1476     If the document is well$B!>(Bformed, the object will be empty unless
1477     the <a href="#declaredType"><code>declaredType</code></a> is
1478     <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1479     <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p>
1480    
1481     <p>If the <a href="#declaredType"><code>declaredType</code></a> is different
1482     from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or
1483     <a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute
1484     <em class=rfc2119>MUST</em> be ignored for the purpose of serializing
1485     into (part of) <abbr>XML</abbr> document.</p>
1486    
1487     <div class="note memo">
1488     <p>When serializing the node it should be noted that the object might
1489     be empty, might contain duplications, and might contain strings that are
1490     not names or name tokens.</p>
1491     </div></dd>
1492 wakaba 1.10 <dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of
1493     type <code>unsigned short</code></dt>
1494     <dd><p>The type of the default for the attribute. It is expected that this
1495     attribute contains a value from the definition group
1496     <a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p>
1497    
1498     <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1499     the value associated to this attribute.</p>
1500    
1501     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1502 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the
1503 wakaba 1.10 <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node
1504 wakaba 1.23 is <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it
1505 wakaba 1.10 <em class=rfc2119>MUST</em> set the specified value as the value
1506     associated to this attribute.</p>
1507    
1508 wakaba 1.12 <p>If the
1509     <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is
1510     created during the process to create a <abbr>DOM</abbr> from an
1511     <abbr>XML</abbr> document, an appropriate value from the
1512 wakaba 1.11 <a href="#DefaultValueType"><code>DefaultValueType</code></a> definition
1513     group <em class=rfc2119>MUST</em> be set to the attribute.</p>
1514    
1515     <!-- DefaultValueType -->
1516     <p>The definition group
1517     <dfn id=DefaultValueType><code>DefaultValueType</code></dfn>
1518     contains integers indicating the type of the default for the attribute.
1519     The definition group contains the following constans:</p>
1520    
1521     <table>
1522     <thead>
1523     <tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr>
1524     </thead>
1525     <tbody>
1526     <tr>
1527     <th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn>
1528     <td><code>0</code><td>Unknown.</tr>
1529     <tr>
1530     <th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn>
1531 wakaba 1.23 <td><code>1</code><td>Provided explicitly and only the value is allowed.
1532     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1533     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1534 wakaba 1.11 <tr>
1535     <th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn>
1536     <td><code>2</code><td>No default value and the attribute have to be
1537     explicitly specified.</tr>
1538     <tr>
1539     <th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn>
1540 wakaba 1.23 <td><code>3</code><td>Implied
1541     <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>,
1542     <a href="#ref-XML11">XML11</a>]</cite>.</tr>
1543 wakaba 1.11 <tr>
1544     <th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn>
1545     <td><code>4</code><td>Provided explicitly.</tr>
1546     </tbody>
1547     </table>
1548    
1549     <p>If the source of the default type does not distinguish
1550     implied and unknown default types, then the value
1551     <a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a>
1552     <em class=rfc2119>MUST</em> be used.</p>
1553    
1554     <div class="note memo">
1555     <p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>
1556     node created by the
1557     <a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a>
1558     method has its <a href="#defaultType"><code>defaultType</code></a>
1559     attribute set to
1560     <a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p>
1561     </div></dd>
1562 wakaba 1.10 </dl>
1563 wakaba 1.4
1564 wakaba 1.3 </div>
1565    
1566 wakaba 1.19 <div class=section id=section-entity>
1567     <h3>Modifications to the <code id=Entity>Entity</code> Interface</h3>
1568    
1569     <p>The implementation of the <a href="#Entity"><code>Entity</code></a>
1570 wakaba 1.24 interface <em class=rfc2119>MUST</em> be modified as the following
1571     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1572 wakaba 1.19 <pre class=idl><code>// Modifications to the Entity interface
1573     attribute DOMString <a href="#publicId">publicId</a>;
1574     attribute DOMString <a href="#systemId">systemId</a>;
1575     attribute DOMString <a href="#notationName">notationName</a>;
1576    
1577     // Additions to the Entity interface
1578     attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>;
1579     readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1580 wakaba 1.20
1581     attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>;
1582 wakaba 1.19 </code></pre>
1583    
1584     <p>The <code id=notationName>notationName</code> attribute of the
1585     <a href="#Entity"><code>Entity</code></a> interface is no longer
1586     read$B!>(Bonly.</p>
1587    
1588     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1589 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1590     <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it <em class=rfc2119>MUST</em>
1591     set the specified value as the value associated to the attribute. No lexical
1592     validation is performed. The new value <em class=rfc2119>MAY</em> be
1593     <code>null</code>.</p>
1594 wakaba 1.19
1595     <dl>
1596     <dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn>
1597     of type boolean</dt>
1598     <dd><p>Whether the structure of the replacement text of the entity
1599     is available via the <code>NodeList</code> object in the
1600     <code>childNodes</code> attribute of the entity.</p>
1601    
1602     <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1603     the value associated to this attribute.</p>
1604    
1605     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1606 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1607     <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it
1608     <em class=rfc2119>MUST</em> set the specified value as the
1609 wakaba 1.19 value associated to this attribute.</p>
1610    
1611     <div class="note memo">
1612     <p>The attribute can be set to <code>false</code> even if the
1613     <a href="#Entity"><code>Entity</code></a> node has any child node.
1614     If the attribute is set to <code>false</code>, then any child node of
1615     the <a href="#Entity"><code>Entity</code></a> node ought to be ignored,
1616     say, for the purpose of serialization.</p>
1617     </div>
1618    
1619     <p>When an <code>EntityReference</code> node is created by cloning
1620     the replacement subtree of the <a href="#Entity"><code>Entity</code></a>
1621     node, if the attribute is set to <code>false</code>, then any descendant
1622     of the node <em class=rfc2119>MUST</em> be ignored.</p>
1623    
1624     <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1625     the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1626     the following requirements are applied: If the entity is an unparsed
1627     entity, then the attribute <em class=rfc2119>MUST</em> be set to
1628     <code>false</code>. Otherwise, if the entity is an external entity whose
1629     replacement text is not available, or whose replacement text is not converted
1630     to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set
1631     to <code>false</code>. Otherwise, the attribute
1632     <em class=rfc2119>MUST</em> be set to <code>true</code>.</p>
1633    
1634     <div class="note memo">
1635     <p>An <a href="#Entity"><code>Entity</code></a> node created by the
1636     <a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method
1637     has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a>
1638     attribute set to <code>false</code>.</p>
1639     </div></dd>
1640 wakaba 1.20 <dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn>
1641     of type boolean</dt>
1642     <dd><p>Whether the entity is declared by an external entity declaration or
1643     not. If the value is <code>true</code>, the entity is declared in an entity
1644     declaration in the external subset entity or in an external parameter entity.
1645     If the value is <code>false</code>, the entity is declared in an entity
1646     declaration in the internal subset, or the node is created in memory.</p>
1647    
1648     <p>On getting, the attribute <em class=rfc2119>MUST</em> return
1649     the value associated to this attribute.</p>
1650    
1651     <p>On setting, the attribute <em class=rfc2119>MUST</em> raise a
1652 wakaba 1.23 <code>NO_MODIFICATION_ALLOWED_ERR</code> if the node is
1653     <a href="#read-only">read$B!>(Bonly</a>. Otherwise, it
1654     <em class=rfc2119>MUST</em> set the specified value as the value associated
1655     to this attribute.</p>
1656 wakaba 1.20
1657     <p>If the <a href="#Entity"><code>Entity</code></a> node is created during
1658     the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document,
1659     the following requirements are applied: If the entity is an unparsed
1660     entity, then the attribute <em class=rfc2119>MUST</em> be set to
1661     <code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the
1662     attribute <em class=rfc2119>MUST</em> be set to the value of whether the
1663     entity is declared by an external markup declaration or not.</p></dd>
1664 wakaba 1.19 </dl>
1665 wakaba 1.1 </div>
1666 wakaba 1.3
1667 wakaba 1.19 <div class=section id=section-notation>
1668     <h3>Modifications to the <code id=Notation>Notation</code> Interface</h3>
1669 wakaba 1.3
1670 wakaba 1.19 <p>The implementation of the <a href="#Notation"><code>Notation</code></a>
1671 wakaba 1.24 interface <em class=rfc2119>MUST</em> be modified as the following
1672     <a href="#idl-fragment"><abbr>IDL</abbr> fragment</a>:</p>
1673 wakaba 1.19 <pre class=idl><code>// Modifications to the Notation interface
1674     attribute DOMString <a href="#publicId">publicId</a>;
1675     attribute DOMString <a href="#systemId">systemId</a>;
1676 wakaba 1.1
1677 wakaba 1.19 // Addition to the Notation interface
1678     readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>;
1679     </code></pre>
1680     </div>
1681    
1682     </div>
1683 wakaba 1.1
1684     <div id="references" class="section reference">
1685     <h2>References</h2>
1686    
1687     <div id="normative-references" class="section normative reference">
1688     <h3>Normative References</h3>
1689    
1690     <dl>
1691     <dt id=ref-DOM3CORE>DOM3CORE</dt>
1692 wakaba 1.23 <dd><cite><a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407">Document
1693     Object Model (<abbr>DOM</abbr>) Level 3 Core Specification, Version
1694     1.0</a></cite>, <abbr>W3C</abbr> Recommendation, <time datetime=2004-04-07>7
1695     April 2004</time>. <em>This</em> version of the specification is referenced.
1696     The latest version of the specification is available at
1697     <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Level-3-Core">http://www.w3.org/TR/DOM-Level-3-Core</a>></code>.</dd>
1698 wakaba 1.24 <dt id=ref-DOMBIND>DOMBIND</dt>
1699     <dd><cite><a href="http://www.w3.org/TR/2007/WD-DOM-Bindings-20071017/">Language
1700     Bindings for <abbr>DOM</abbr> Specifications</a></cite>, <abbr>W3C</abbr>
1701     Working Draft, <time datetime=2007-10-17>17 October 2007</time>.
1702     <em>This</em> version of the specification is referenced. The latest version
1703     of the specification is available at
1704     <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Bindings/">http://www.w3.org/TR/DOM-Bindings/</a>></code>.</dd>
1705     <dt id=ref-DOMPERL>DOMPERL</dt>
1706     <dd><cite><a href="http://suika.fam.cx/gate/2005/sw/manakai/DOM%20Perl%20Binding">manakai's
1707     <abbr>DOM</abbr> Perl Binding</a></cite>, editor's draft. Work in
1708     progress.</dd>
1709 wakaba 1.23 <dt id=ref-HTML5>HTML5</dt>
1710     <dd><cite><a href="http://whatwg.org/html5"><abbr>HTML</abbr> 5</a></cite>,
1711     <abbr title="Web Hypertext Application Technology Working Group">WHATWG</abbr>
1712     Working Draft. Work in progress.</dd>
1713     <dt id=ref-INFOSET>INFOSET</dt>
1714     <dd><cite><a href="http://www.w3.org/TR/2004/REC-xml-infoset-20040204"><abbr>XML</abbr>
1715     Information Set (Second Edition)</a></cite>, <abbr>W3C</abbr> Recommendation,
1716     <time datetime=2004-02-04>4 February 2004</time>. <em>This</em> version of
1717     the specification is referenced. The latest version of the specification is
1718     available at
1719     <code class=uri>&lt;<a href="http://www.w3.org/TR/xml-infoset">http://www.w3.org/TR/xml-infoset</a>></code>.</dd>
1720 wakaba 1.1 <dt id="ref-KEYWORDS">KEYWORDS</dt>
1721     <dd><cite><a href="urn:ietf:rfc:2119">Key words for use in
1722     <abbr>RFCs</abbr> to Indicate Requirement Levels</a></cite>,
1723     <abbr title="Internet Engineering Task Force">IETF</abbr>
1724     <a href="urn:ietf:bcp:14"><abbr title="Best Current Practice">BCP</abbr>
1725     14</a>, <abbr title="Request for Comments">RFC</abbr> 2119,
1726     <time datetime=1997-03>March 1997</time>.
1727     <em>This</em> version of the specification is referenced.</dd>
1728     <dt id=ref-XML10">XML10</dt>
1729     <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml-20060816">Extensible
1730     Markup Language (<abbr>XML</abbr>) 1.0 (Fourth Edition)</a></cite>,
1731     <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
1732     2006</time>, edited in place <time datetime=2006-09-29>29 September
1733 wakaba 1.23 2006</time>. <em>This</em> version of the specification is referenced. The
1734     latest version of the specification is available at
1735     <code class=uri>&lt;<a href="http://www.w3.org/TR/xml">http://www.w3.org/TR/xml</a>&gt;</code>.</dd>
1736 wakaba 1.1 <dt id=ref-XML11>XML11</dt>
1737 wakaba 1.23 <dd><cite><a href="http://www.w3.org/TR/2006/REC-xml11-20060816/">Extensible
1738     Markup Language (<abbr>XML</abbr>) 1.1 (Second Edition)</a></cite>,
1739     <abbr>W3C</abbr> Recommendation, <time datetime=2006-08-16>16 August
1740     2006</time>, edited in place <time datetime=2006-09-29>29 September
1741 wakaba 1.24 2006</time>. <em>This</em> version of the specification is referenced. The
1742 wakaba 1.23 latest version of the specification is available at
1743     <code class=uri>&lt;<a href="http://www.w3.org/TR/xml11">http://www.w3.org/TR/xml11</a>></code>.</dd>
1744 wakaba 1.1 </dl>
1745     </div>
1746    
1747     <div id="informative-references" class="section informative reference">
1748     <h3>Non$B!>(Bnormative References</h3>
1749    
1750 wakaba 1.23 <dl>
1751     <dt id=ref-DOM1WD>DOM1WD</dt>
1752     <dd><cite><a href="http://www.w3.org/TR/WD-DOM-971209/">Document Object
1753     Model Specification</a></cite>, <abbr>W3C</abbr> Working Draft,
1754     <time datetime=1997-12-09>9 December 1998</time>.</dd>
1755     <dd><cite><a href="http://www.w3.org/TR/WD-DOM-19980318/">Document Object
1756     Model Specification</a></cite>, <abbr>W3C</abbr> Working Draft,
1757     <time datetime=1998-03-18>18 March 1998</time>.</dd>
1758     <dd><cite><a href="http://www.w3.org/TR/1998/WD-DOM-19980416/">Document
1759     Object Model Specification, Version 1.0</a></cite>, <abbr>W3C</abbr> Working
1760     Draft, <time datetime=1998-04-16>16 April 1998</time>.</dd>
1761     <dt id=ref-DOM3AS>DOM3AS</dt>
1762     <dd><cite><a href="http://www.w3.org/TR/2002/NOTE-DOM-Level-3-AS-20020725/">Document
1763     Object Model (<abbr>DOM</abbr>) Level 3 Abstract Schemas Specification,
1764     Version 1.0</a></cite>, <abbr>W3C</abbr> Note, <time datetime=2002-07-25>25
1765     July 2002</time>. The latest version of the specification is available at
1766     <code class=uri>&lt;<a href="http://www.w3.org/TR/DOM-Level-3-AS">http://www.w3.org/TR/DOM-Level-3-AS</a>></code>.</dd>
1767     <dt id=ref-XSAPI>XSAPI</dt>
1768     <dd><cite><a href="http://www.w3.org/Submission/2004/SUBM-xmlschema-api-20040309/"><abbr>XML</abbr>
1769     Schema <abbr>API</abbr></a></cite>, <abbr>W3C</abbr> Member Submission,
1770     <time datetime=2004-03-09>9 March 2004</time>. The latest version of the
1771     specification is available at
1772     <code class=uri>&lt;<a href="http://www.w3.org/Submission/xmlschema-api/">http://www.w3.org/Submission/xmlschema-api/</a>></code>.</dd>
1773 wakaba 1.1 </dl>
1774     </div>
1775    
1776     </div>
1777    
1778     </body>
1779     </html>

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24