1 |
<!DOCTYPE html> |
<!DOCTYPE html> |
2 |
<html lang="en" class="formal-specification status-work-in-progress"> |
<html lang="en" class="formal-specification status-work-in-progress"> |
3 |
<head> |
<head> |
4 |
<title>manakai's XML Conformance Checking</title> |
<title>DOM Document Type Definition Module</title> |
5 |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
<link rel="stylesheet" href="http://suika.fam.cx/www/style/html/spec"> |
6 |
|
<link rel="stylesheet" href="http://suika.fam.cx/www/style/def/dom"> |
7 |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
<link rel="license" href="http://suika.fam.cx/c/gnu/fdl"> |
|
<style> |
|
|
a[id]::before { |
|
|
content: "[" attr(id) "]"; |
|
|
color: gray; |
|
|
font-size: 70%; |
|
|
font-family: Courier New, monospace; |
|
|
vertical-align: 60%; |
|
|
} |
|
|
</style> |
|
8 |
</head> |
</head> |
9 |
<body class="has-abstract"> |
<body class="has-abstract"> |
10 |
|
|
11 |
<div class="header"> |
<div class="header"> |
12 |
<h1>manakai's <abbr>XML</abbr> Conformance Checking</h1> |
<h1>DOM Document Type Definition Module</h1> |
13 |
<h2>Working Draft <time datetime=2007-12-01>1 December 2007</time></h2> |
<h2>Working Draft <time datetime=2007-12-08>8 December 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
17 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work" |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work" |
18 |
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>></code></dd> |
>http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>></code></dd> |
19 |
<dt>Latest Version</dt> |
<dt>Latest Version</dt> |
20 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc" |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef" |
21 |
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc</a>></code></dd> |
>http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef</a>></code></dd> |
22 |
<dt>Latest Working Draft</dt> |
<dt>Latest Working Draft</dt> |
23 |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work" |
<dd><code class="URI"><<a href="http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work" |
24 |
>http://suika.fam.cx/www/markup/xml/xmlcc/xmlcc-work</a>></code></dd> |
>http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work</a>></code></dd> |
25 |
<!-- <dt>Previous Version</dt> --> |
<!-- <dt>Previous Version</dt> --> |
26 |
<dt>Version History</dt> |
<dt>Version History</dt> |
27 |
<dd><code class=URI><<a href="http://suika.fam.cx/gate/cvs/markup/xml/xmlcc/xmlcc-work.en.html">http://suika.fam.cx/gate/cvs/markup/xml/xmlcc/xmlcc-work.en.html</a>></code></dd> |
<dd><code class=URI><<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>></code></dd> |
28 |
</dl> |
<dt id=author>Author</dt> |
|
<dl class="authors" id="author"> |
|
|
<dt>Author</dt> |
|
29 |
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
<dd><a href="http://suika.fam.cx/~wakaba/who?" rel="author" |
30 |
lang=ja>Wakaba</a> |
lang=ja>Wakaba</a> |
31 |
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
<code class="mail"><<a href="mailto:w@suika.fam.cx" rel="author" |
50 |
<div id="abstract" class="section"> |
<div id="abstract" class="section"> |
51 |
<h2>Abstract</h2> |
<h2>Abstract</h2> |
52 |
|
|
53 |
<div class="ed issue">...</div> |
<p>The <abbr>DOM</abbr> Document Type Definition module is a set of |
54 |
|
<abbr>DOM</abbr> interfaces, including both new interfaces and modifications |
55 |
|
to existing <abbr>DOM</abbr> interfaces, over which <abbr>DOM</abbr> |
56 |
|
applications are able to access to the definitions of the document type.</p> |
57 |
</div> |
</div> |
58 |
|
|
59 |
<div id="status" class="section"> |
<div id="status" class="section"> |
64 |
might supersede this document.</em></p> |
might supersede this document.</em></p> |
65 |
|
|
66 |
<p>This document is a working draft, produced as part of the |
<p>This document is a working draft, produced as part of the |
|
<a href="http://suika.fam.cx/www/markup/html/whatpm/readme">Whatpm</a> |
|
|
subproject of the |
|
67 |
<a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
<a href="http://suika.fam.cx/www/manakai-core/doc/web/">manakai</a> |
68 |
project. It might be updated, replaced, or obsoleted by |
project. It might be updated, replaced, or obsoleted by |
69 |
other documents at any time. It is inappropriate to |
other documents at any time. It is inappropriate to |
82 |
|
|
83 |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
<p class=section-info>This section is <em>non$B!>(Bnormative</em>.</p> |
84 |
|
|
85 |
<div class="issue ed">...</div> |
<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 |
|
<p>Interfaces defined in this specification are partially modeled from |
92 |
|
early drafts of <abbr>DOM</abbr> level 1 <span class=ed>@@ ref</span>, |
93 |
|
<abbr>DOM</abbr> Abstract Schema level 3 <span class=ed>@@ ref</span>, and |
94 |
|
<abbr>XML</abbr> Schema <abbr>API</abbr>, but are not compatible with |
95 |
|
any of them as a whole.</p> |
96 |
|
</div> |
97 |
|
|
98 |
|
<div class="section" id=conformance> |
99 |
|
<h2>Conformance Requirements</h2> |
100 |
|
|
101 |
</div> |
<div class=section id=terminology> |
102 |
|
<h3>Terminology</h3> |
103 |
|
|
104 |
<div class="section" id="terminology"> |
<p>All examples and notes in this specification are non$B!>(Bnormative, |
105 |
<h2>Terminology</h2> |
as are all sections explicitly marked non$B!>(Bnormative. Everything |
106 |
|
else in this specification is normative.</p> |
107 |
|
|
108 |
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
<p>The key words <q><em class="rfc2119">MUST</em></q>, |
109 |
<q><em class="rfc2119">MUST NOT</em></q>, |
<q><em class="rfc2119">MUST NOT</em></q>, and <q><em class=rfc2119>MAY</em></q> |
110 |
<q><em class="rfc2119">SHOULD</em></q>, |
in this document are to be interpreted as described in |
|
<q><em class="rfc2119">SHOULD NOT</em></q>, and |
|
|
<q><em class=rfc2119>MAY</em></q> in this |
|
|
document are to be interpreted as described in |
|
111 |
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
<a href="urn:ietf:rfc:2119"><abbr title="Request for Comments">RFC</abbr> |
112 |
2119</a> |
2119</a> |
113 |
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
<cite class="bibref normative">[<a href="#ref-KEYWORDS">KEYWORDS</a>]</cite>.</p> |
114 |
|
|
115 |
<!-- Strictly speaking the paragraph below is not part of terminology. --> |
<p>Conformance requirements phrased as algorithms or specific steps |
116 |
<p>All examples and notes in this specification are non$B!>(Bnormative, |
<em class=rfc2119>MAY</em> be implemented in any manner, so long as the end |
117 |
as are all sections explicitly marked non$B!>(Bnormative. Everything |
result is equivalent. Requirements phrased in the imperative as part of |
118 |
else in this specification is normative.</p> |
algorithms are to be interpreted with the meaning of the key word used in |
119 |
|
introducing the algorithm.</p> |
120 |
|
|
121 |
|
<p>Sometimes an exception is phrased as being required to be raised. As |
122 |
|
specified in the <abbr>DOM</abbr> Core specification |
123 |
|
<span class=ed>[DOM3]</span>, |
124 |
|
when the value of the <code>strictErrorChecking</code> attribute of the |
125 |
|
<a href="#Document"><code>Document</code></a> node is <code>false</code>, |
126 |
|
then the exception is not have to be raised.</p> |
127 |
|
|
128 |
|
<p>Some conformance requirements are phrased as requirements on interfaces, |
129 |
|
attributes, methods, or objects. Such requirements are applied to |
130 |
|
implementations.</p> |
131 |
|
|
132 |
|
<p>The construction <q>a <code><var>Foo</var></code> object</q>, where |
133 |
|
<code><var>Foo</var></code> is an interface, is used instead of the more |
134 |
|
accurate <q>an object implementing the interface |
135 |
|
<code><var>Foo</var></code></q>.</p> |
136 |
|
|
137 |
|
<p>The construction <q>raise a <code><var>Bar</var></code></q>, where |
138 |
|
<code><var>Bar</var></code> is an exception code, is used instead of the more |
139 |
|
accurate <q>raise an exception implementing the interface |
140 |
|
<code>DOMException</code> <span class=ed>[DOM3]</span> with its |
141 |
|
<code>code</code> attribute set to <code><var>Bar</var></code></q>.</p> |
142 |
|
|
143 |
|
<p>The term |
144 |
|
<q id=live><a href="http://www.whatwg.org/specs/web-apps/current-work/#live">live</a></q> |
145 |
|
is defined in the HTML5 specification <span class=ed>[HTML5]</span>.</p> |
146 |
|
|
147 |
<p><span class=ed>Algorithm is normative but non-normative</span>. |
<p class=ed>@@ ref to DOM Binding Spec</p> |
|
In addition, the order in which <a href="#errors">errors</a> are |
|
|
raised is undefined.</p> |
|
148 |
</div> |
</div> |
149 |
|
|
150 |
|
<div class=section id=conformance-categories> |
151 |
|
<h3>Conformance Categories</h3> |
152 |
|
|
153 |
<div class=section id=error-categories> |
<p>There are several kinds of products that can be claim to conform to |
154 |
<h2>Error Classification</h2> |
this specification:</p> |
155 |
|
<dl> |
156 |
|
<dt id=category-dom-implementation><abbr>DOM</abbr> Implementation</dt> |
157 |
|
<dd>A <abbr>DOM</abbr> implementation (or just written as |
158 |
|
<q>implementation</q> in this document) provides a way to access |
159 |
|
<abbr>DOM</abbr> trees for applications by implementing interfaces defined |
160 |
|
by this and other documents. Unless otherwise noted, requirements in this |
161 |
|
document are applied to <abbr>DOM</abbr> implementations. To implement |
162 |
|
all the features in this document, the implementation have to implement |
163 |
|
some version of <abbr>DOM</abbr> Core (e.g. <abbr>DOM</abbr> level 3 |
164 |
|
<span class=ed>[DOM3]</span>) with one or more language binding (e.g. |
165 |
|
ECMAScript or Java binding <span class=ed>[BINDINGS]</span> or |
166 |
|
Perl binding <span class=ed>[PERLBINDING]</span>).</dd> |
167 |
|
<dt id=category-xml-parser><abbr>XML</abbr> Parser (<abbr>XML</abbr> document |
168 |
|
to <abbr>DOM</abbr> tree converter)</dt> |
169 |
|
<dd>A software component that converts |
170 |
|
<abbr>XML</abbr> 1.0 or 1.1 document (or fragment thereof) into a |
171 |
|
<abbr>DOM</abbr> tree (or fragment thereof) in the context of this |
172 |
|
document. Note that this document does not define any particular way to |
173 |
|
parse an <abbr>XML</abbr> document or to construct an <abbr>DOM</abbr> |
174 |
|
document, but it defines constraints for such processing.</dd> |
175 |
|
<dt id=category-xml-serializer><abbr>XML</abbr> Serializer (<abbr>DOM</abbr> |
176 |
|
tree to <abbr>XML</abbr> document converter)</dt> |
177 |
|
<dd>A software component that converts |
178 |
|
<abbr>DOM</abbr> tree (or fragment thereof) into an <abbr>XML</abbr> 1.0 or |
179 |
|
1.1 document (or fragment thereof). Note that this document does not define |
180 |
|
any particular way to serialize a <abbr>DOM</abbr> tree, but it defines |
181 |
|
constraints for such processing.</dd> |
182 |
|
<dt id=category-infoset-dom><abbr>XML</abbr> Information Set to |
183 |
|
<abbr>DOM</abbr> Tree Converter</dt> |
184 |
|
<dd>A software component that converts an <abbr>XML</abbr> information set |
185 |
|
into a <abbr>DOM</abbr> tree. Note that this documetn does not define |
186 |
|
any particular way for the convertion, but it defines constraints for |
187 |
|
such processing.</dd> |
188 |
|
<dt id=category-dom-infoset><abbr>DOM</abbr> Tree to <abbr>XML</abbr> |
189 |
|
Information Set Converter</dt> |
190 |
|
<dd>A software component that converts a <abbr>DOM</abbr> tree into |
191 |
|
an <abbr>XML</abbr> information set. Note that this documetn does not define |
192 |
|
any particular way for the convertion, but it defines constraints for |
193 |
|
such processing.</dd> |
194 |
|
</dl> |
195 |
|
</div> |
196 |
|
</div> |
197 |
|
|
198 |
<p class=ed>If a <code>Document</code> node has no |
<div class=section id=dom-dtdef> |
199 |
xml-well-formedness-error, entity-error, and unknown-error, |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
|
then it is well-formed. If a well-formed <code>Document</code> |
|
|
node has no xml-validity-error, it is valid.</p> |
|
200 |
|
|
201 |
<div class="note memo"> |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
202 |
<p>A well$B!>(Bformed <code>Document</code> can be safely serialized |
introduces four interfaces: |
203 |
into a well$B!>(Bformed XML document. A valid <code>Document</code> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>, |
204 |
can be easily serialized into a valid XML document.</p> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>, |
205 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
206 |
|
and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>. |
207 |
|
In addition, it modifies existing interfaces |
208 |
|
<a href="#Node"><code>Node</code></a>, |
209 |
|
<a href="#Document"><code>Document</code></a>, |
210 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
211 |
|
<a href="#Entity"><code>Entity</code></a>, and |
212 |
|
<a href="#Notation"><code>Notation</code></a>.</p> |
213 |
|
|
214 |
|
<div class=section id=features> |
215 |
|
<h3>Feature String</h3> |
216 |
|
|
217 |
|
<p>In a <abbr>DOM</abbr> implementation that supports the version 3.0 of |
218 |
|
the <abbr>DOM</abbr> Document Type Definition module, the |
219 |
|
<code>hasFeature</code> method of a <code>DOMImplementation</code> object |
220 |
|
<em class=rfc2119>MUST</em> return <code>true</code> when the parameters are |
221 |
|
set to |
222 |
|
<dfn id=feature-XDoctype><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></dfn> |
223 |
|
and <dfn id=feature-XDoctype-3.0><code>3.0</code></dfn> respectively. Any |
224 |
|
method that takes one or more feature names, with or without version number, |
225 |
|
such as <code>hasFeature</code> or <code>getFeature</code>, |
226 |
|
<em class=rfc2119>MUST</em> behave in a manner consistent with it.</p> |
227 |
</div> |
</div> |
228 |
|
|
229 |
<p class=ed>To be a conforming <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-validating">validating XML processor</a>, |
<div class=section id=section-node> |
230 |
...</p> |
<h3>Modifications to the <code id=Node>Node</code> Interface</h3> |
231 |
|
|
232 |
<p>Errors are classified into these |
<p>The implementation of the |
233 |
<dfn id=error-category title="error category">error categories</dfn>:</p> |
<a href="#Node"><code>Node</code></a> interface |
234 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
235 |
|
<pre class=idl><code>// Additions to the Node interface |
236 |
|
|
237 |
|
// Additions to the NodeType definition group |
238 |
|
const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001; |
239 |
|
const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002; |
240 |
|
</pre> |
241 |
|
|
242 |
|
<p>This specification adds two new types (subinterfaces) of |
243 |
|
<a href="#Node"><code>Node</code></a>: element type definition (node type |
244 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>, |
245 |
|
interface |
246 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and |
247 |
|
attribute definition (node type |
248 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>, |
249 |
|
interface |
250 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For |
251 |
|
these kinds of nodes, methods and attributes in the |
252 |
|
<a href="#Node"><code>Node</code></a> interface must behave as following:</p> |
253 |
|
|
254 |
<dl id=errors> |
<dl> |
255 |
<dt><dfn id=entity-error><code>entity-error</code></dfn></dt> |
<dt><code id=attributes>attributes</code></dt> |
256 |
<dd> |
<dd> |
257 |
<p class=ed>@@</p> |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
258 |
<div class="note memo"> |
<code>null</code>.</p> |
|
<p>This <span class=ed>algorithm</span> does not support |
|
|
<abbr>DOM</abbr> tree with one or more <code>EntityReference</code> |
|
|
nodes. It is expected that any entity references are expanded |
|
|
at the parse time and any unexpandable entity references |
|
|
make parse time errors raised so that never result in |
|
|
<abbr>DOM</abbr> tree with <code>EntityReference</code> nodes.</p> |
|
|
</div> |
|
259 |
</dd> |
</dd> |
260 |
<dt><dfn id=round-trip-error><code>round-trip-error</code></dfn></dt> |
<dt><code id=baseURI>baseURI</code></dt> |
|
<dd class=ed>@@</dd> |
|
|
<dt><dfn id=round-trip-warning><code>round-trip-warning</code></dfn></dt> |
|
261 |
<dd> |
<dd> |
262 |
<p>A <a href="#round-trip-warning"><code>round-trip-warning</code></a> |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
263 |
will be raised when a construct, which might not be restored to the same |
value of the <a href="#baseURI"><code>baseURI</code></a> attribute |
264 |
construct when it is serialized and then re-parsed by a conforming |
of the node in the <code>ownerDocument</code> attribute of the node. |
265 |
processor, is encountered.</p> |
Note that the value might be <code>null</code>.</p> |
|
<div class="example memo"> |
|
|
<p>For a <code>Comment</code> node a |
|
|
<a href="#round-trip-warning"><code>round-trip-warning</code></a> will |
|
|
be raised, since <abbr>XML</abbr> processors are not required to |
|
|
report texts of comments for applications.</p> |
|
|
</div> |
|
266 |
</dd> |
</dd> |
267 |
<dt class=ed><dfn id=unknown-error><code>unknown-error</code></dfn>?</dt> |
<dt><code id=cloneNode>cloneNode</code></dt> |
268 |
<dd class=ed>@@</dd> |
<dd class=ed> |
269 |
<dt><dfn id=xml-misc-error><code>xml-misc-error</code></dt> |
<p>A future version of the specification is expected to define the |
270 |
<dd>An <abbr>XML</abbr> <i>error</i> (<abbr>XML</abbr> 1.0 |
behavior of the <a href="#cloneNode"><code>cloneNode</code></a> method |
271 |
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite> |
for those kinds of nodes. In addition, it might revise behavior of |
272 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-error">error</a> / |
the method for <a href="#Entity"><code>Entity</code></a>, |
273 |
<abbr>XML</abbr> 1.1 |
<a href="#Notation"><code>Notation</code></a>, and/or |
274 |
<cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite> |
<a href="#DocumentType"><code>DocumentType</code></a> nodes.</p> |
|
<a href="@@/#dt-error">error</a>) |
|
|
that is not classified to any other <a href="#error-category">error |
|
|
category</a>.</dd> |
|
|
<dt><dfn id=xml-misc-fatal-error><code>xml-misc-fatal-error</code></dt> |
|
|
<dd>An <abbr>XML</abbr> <i>fatal error</i> (<abbr>XML</abbr> 1.0 |
|
|
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite> |
|
|
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-fatal">fatal |
|
|
error</a> / <abbr>XML</abbr> 1.1 |
|
|
<cite class="bibref normative">[<a href="#ref-XML11">XML11</a>]</cite> |
|
|
<a href="@@/#dt-fatal">fatal error</a>) |
|
|
that is not classified to any other <a href="#error-category">error |
|
|
category</a>. <span class=ed>@@ What errors fall into this category?</span></dd> |
|
|
<dt><dfn id=xml-misc-recommendation><code>xml-misc-recommendation</code></dfn></dt> |
|
|
<dd> |
|
|
<p>An |
|
|
<a href="#xml-misc-recommendation"><code>xml-misc-recommendation</code></a> |
|
|
will be raised if a <em class=rfc2119>SHOULD</em>$B!>(Blevel requirement |
|
|
in <abbr>XML</abbr> specification is not met.</p> |
|
275 |
</dd> |
</dd> |
276 |
<dt><dfn id=xml-validity-error><code>xml-validity-error</code></dfn></dt> |
<!-- |
277 |
<dd>A violation of validity constraint in XML document.</dd> |
<dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd> |
278 |
<dt><dfn id=xml-well-formedness-error><code>xml-well-formedness-error</code></dfn></dt> |
--> |
279 |
<dd><p>If an <code>xml-well-formedness-error</code> is raised, |
<dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt> |
280 |
it would not be possible to generate an XML serialization that |
<dd class=ed> |
281 |
would match to the appropriate production rule and that would not |
<p>A future version of the specification is expected to define the |
282 |
violate to any well$B!>(Bformedness constraint in XML |
behavior of the method |
283 |
specification <cite class="bibref normative">[<a href="#ref-XML10">XML10</a>, |
for those kinds of nodes. In addition, it might revise behavior of |
284 |
<a href="#ref-XML11">XML11</a>]</cite>.</p></dd> |
the method for <a href="#Entity"><code>Entity</code></a>, |
285 |
</dl> |
<a href="#Notation"><code>Notation</code></a>, and/or |
286 |
|
<a href="#DocumentType"><code>DocumentType</code></a> nodes.</p> |
287 |
<div class=ed><p>@@ TODO: #dt-atuseroption at user option |
</dd> |
288 |
(MAY or MUST), #dt-compat for compatibility, |
<dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt> |
289 |
#dt-interop for interoperability</p></div> |
<dd><p>When invoked, the method <em class=rfc2119>MUST</em> return |
290 |
|
<code>false</code>.</p></dd> |
291 |
|
<dt><code id=isEqualNode>isEqualNode</code></dt> |
292 |
|
<dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method, |
293 |
|
following items are added to the list of conditions for equality:</p> |
294 |
|
|
295 |
|
<ul> |
296 |
|
<li> |
297 |
|
<p>If the nodes are <a href="#DocumentType"><code>DocumentType</code></a> |
298 |
|
and at least one of them has the support for the feature |
299 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>:</p> |
300 |
|
<ul> |
301 |
|
<li>they are equal according to <abbr>DOM</abbr> level 3 definition |
302 |
|
<span class=ed>@@ ref</span>, and |
303 |
|
<li>either: |
304 |
|
<ul><!-- |
305 |
|
<li>both of them does not support the feature |
306 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a>,</li>--> |
307 |
|
<li>exactly one of them support the feature |
308 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
309 |
|
and the <code>length</code> attribute of the <code>NamedNodeMap</code> |
310 |
|
object in the <a href="#elementTypes"><code>elementTypes</code></a> |
311 |
|
attribute of it is equal to <code>0</code>, or</li> |
312 |
|
<li>both of them support the feature |
313 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
314 |
|
and the values of the |
315 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attributes are |
316 |
|
equal (equality of the |
317 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute is same |
318 |
|
as that for the <code>attributes</code> attribute).</li> |
319 |
|
</ul> |
320 |
|
</li> |
321 |
|
</ul> |
322 |
|
</li> |
323 |
|
|
324 |
</div> |
<li><p>If the nodes are |
325 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
326 |
|
the values of the |
327 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
328 |
|
attributes are equal (equality of the |
329 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
330 |
|
attribute is same as that for the <code>attributes</code> attribute).</p></li> |
331 |
|
|
332 |
|
<li><p>If the nodes are |
333 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
334 |
|
the values of the <a href="#declaredType"><code>declaredType</code></a> and |
335 |
|
the <a href="#defaultType"><code>defaultType</code></a> attributes are |
336 |
|
equal respectively.</p></li> |
337 |
|
|
338 |
|
<li><p>If the nodes are |
339 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>, |
340 |
|
the values of the <code>DOMStringList</code> objects in the |
341 |
|
<a href="#allowedTokens"><code>allowedTokens</code></a> attributes |
342 |
|
are equal, i.e. their <code>length</code> attribute values are equal and |
343 |
|
each string exists in a list is contained in another list (their indeces |
344 |
|
may be different), with an additional constraint that the number of the |
345 |
|
items that are equal to a string in a list is equal to the number |
346 |
|
of the items equal to the string in another list.</p></li> |
347 |
|
</ul></dd> |
348 |
|
<dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and |
349 |
|
<code id=lookupPrefix>lookupPrefix</code></dt> |
350 |
|
<dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return |
351 |
|
<code>null</code>.</p></dd> |
352 |
|
<dt><code id=nodeName>nodeName</code></dt> |
353 |
|
<dd> |
354 |
|
<p>If the node is an |
355 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
356 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
357 |
|
name of the element type definition represented by the node.</p> |
358 |
|
|
359 |
|
<p>If the node is an |
360 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
361 |
|
On getting, the attribute <em class=rfc2119>MUST</em> return the |
362 |
|
name of the attribute definition represented by the node.</p> |
363 |
|
</dd> |
364 |
|
<dt><code id=nodeType>nodeType</code></dt> |
365 |
|
<dd> |
366 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
367 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
368 |
|
(if the node is an |
369 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or |
370 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
371 |
|
(if the node is an |
372 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p> |
373 |
|
|
374 |
|
<!-- NodeType --> |
375 |
|
<p>Two constants are added to the <code id=NodeType>NodeType</code> |
376 |
|
definition group of the <a href="#Node"><code>Node</code></a> interface as |
377 |
|
following:</p> |
378 |
|
<table> |
379 |
|
<thead> |
380 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
381 |
|
</thead> |
382 |
|
<tbody> |
383 |
|
<tr> |
384 |
|
<th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn> |
385 |
|
<td><code>81001</code><td>The node is an |
386 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr> |
387 |
|
<tr> |
388 |
|
<th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn> |
389 |
|
<td><code>81002</code><td>The node is an |
390 |
|
<a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr> |
391 |
|
</tbody> |
392 |
|
</table> |
393 |
|
</dd> |
394 |
|
<dt><code id=nodeValue>nodeValue</code> and |
395 |
|
<code id=textContent>textContent</code></dt> |
396 |
|
<dd> |
397 |
|
<p>If the node is an |
398 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
399 |
|
On getting, the attributes <em class=rfc2119>MUST</em> return |
400 |
|
<code>null</code>.</p> |
401 |
|
|
402 |
<div class=section id=parsing-xml> |
<div class="note memo"> |
403 |
<h2>Parsing <abbr>XML</abbr> Document</h2> |
<p>Thus, on setting the attributes does nothing |
404 |
|
<span class=ed>[DOM3]</span>.</p> |
405 |
<ul> |
</div> |
|
<li>If the <abbr>XML</abbr> document does not begin with an |
|
|
<abbr>XML</abbr> declaration, then raise an |
|
|
<a href="#xml-misc-recommentation" id=xmr-xml-decl><code>xml-misc-recommendation</code></a>.</li> |
|
|
<li>If the replacement text of an entity declaration is |
|
|
<code><</code>, then raise an |
|
|
<a href="#xml-misc-warning" id=xmw-entity-value-lt><code>xml-misc-warning</code></a>.<!-- |
|
|
"strongly advised to avoid" in a Note in Section 2.3 of [XML10], [XML11]. |
|
|
--></li> |
|
|
<li>If there is an element type declaration whose <code>Name</code> |
|
|
value is already declared, then raise an |
|
|
<a href="#xml-validity-error" id=vc-edunique><code>xml-validity-error</code></a>.</li> |
|
|
<li>If attribute definition whose <code>Name</code> is |
|
|
<code>xml:space</code> has <span class=ed>declared type different from |
|
|
(default|preserve), (default), or (preserve)</span>, then raise an |
|
|
<a href="#xml-misc-error" id=xme-ad-xml-space><code>xml-misc-error</code></a>. |
|
|
<span class=ed>@@ duplication with |
|
|
<a href="#xml-at-xml-space">#xml-at-xml-space</a>.<!-- |
|
|
<!ATTLIST e xml:space CDATA #IMPLIED xml:space CDATA #IMPLIED> --></span></li> |
|
|
<li>If an empty-element tag is used for an element which is <em>not</em> |
|
|
declared <code>EMPTY</code>, then raise an |
|
|
<a href="#xml-misc-recommentation" id=xmr-emptyelemtag-not-empty><code>xml-misc-recommendation</code></a>.</li> |
|
|
<li>If an empty-element tag is <em>not</em> used for an element which is |
|
|
declared <code>EMPTY</code>, then raise an |
|
|
<a href="#xml-misc-recommentation" id=xmr-empty-not-emptyelemtag><code>xml-misc-recommendation</code></a>.</li> |
|
|
<!-- |
|
406 |
|
|
407 |
#vc-PEinMarkupDecl Validity constraint: Proper Declaration/PE Nesting |
<p>On setting, the <a href="#textContent"><code>textContent</code></a> |
408 |
#wfc-PEinInternalSubset Well-formedness constraint: PEs in Internal Subset |
attribute <em class=rfc2119>MUST NOT</em> raise a |
409 |
#ExtSubset Well-formedness constraint: External Subset |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
410 |
#PE-between-Decls Well-formedness constraint: PE Between Declarations |
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
411 |
#GIMatch Well-formedness constraint: Element Type Match |
|
412 |
#uniqattspec Well-formedness constraint: Unique Att Spec |
<p>If the node is an |
413 |
#NoExternalRefs Well-formedness constraint: No External Entity References |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
414 |
#CleanAttrVals Well-formedness constraint: No < in Attribute Values |
The attribute <em class=rfc2119>MUST</em> behave as if the node |
415 |
#vc-PEinGroup Validity constraint: Proper Group/PE Nesting |
were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd> |
416 |
"For interoperability, if a parameter-entity reference appears in a choice, seq, or Mixed construct, its replacement text SHOULD contain at least one non-blank character, and neither the first nor last non-blank character of the replacement text SHOULD be a connector (| or ,)." |
<dt><code id=normalize>normalize</code></dt> |
417 |
"For interoperability, an XML processor MAY at user option issue a warning when more than one attribute-list declaration is provided for a given element type, or more than one attribute definition is provided for a given attribute, but this is not an error." |
<dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is |
418 |
#condsec-nesting Validity constraint: Proper Conditional Section/PE Nesting |
normalized, any nodes in the <code>NamedNodeMap</code> object in the |
419 |
#wf-Legalchar Well-formedness constraint: Legal Character |
<a href="#elementTypes"><code>elementTypes</code></a> attribute |
420 |
#textent Well-formedness constraint: Parsed Entity |
<em class=rfc2119>MUST</em> be normalized as well.</p> |
421 |
#norecursion Well-formedness constraint: No Recursion |
|
422 |
#indtd Well-formedness constraint: In DTD |
<p>When an |
423 |
"External parsed entities SHOULD each begin with a text declaration." |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
424 |
"It is an error for a reference to an unparsed entity to appear in the EntityValue in an entity declaration." |
is normalized, any nodes in the <code>NamedNodeMap</code> object in the |
425 |
#UniqueNotationName Validity constraint: Unique Notation Name |
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
426 |
|
attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd> |
427 |
@@ Need detailed review, but maybe should be in parsing phase |
</dl> |
|
|
|
|
#vc-check-rmd Validity constraint: Standalone Document Declaration |
|
|
|
|
|
@@ Need dtailed review |
|
|
|
|
|
#wf-entdeclared Well-formedness constraint: Entity Declared |
|
|
#vc-entdeclared Validity constraint: Entity Declared |
|
|
"For interoperability, valid documents SHOULD declare the entities amp, lt, gt, apos, quot, in the form specified in 4.6 Predefined Entities." |
|
|
"If the entities lt or amp are declared, they MUST be declared as internal entities whose replacement text is a character reference to the respective character (less-than sign or ampersand) being escaped; the double escaping is REQUIRED for these entities so that references to them produce a well-formed result. If the entities gt, apos, or quot are declared, they MUST be declared as internal entities whose replacement text is the single character being escaped (or a character reference to that character; the double escaping here is OPTIONAL but harmless)." |
|
|
|
|
|
@@ flaged and then reported in DOM check phase |
|
|
|
|
|
"Entities encoded in UTF-16 MUST and entities encoded in UTF-8 MAY begin with the Byte Order Mark" |
|
|
"In the absence of external character encoding information (such as MIME headers), parsed entities which are stored in an encoding other than UTF-8 or UTF-16 MUST begin with a text declaration" |
|
|
"In an encoding declaration, the values "UTF-8", "UTF-16", "ISO-10646-UCS-2", and "ISO-10646-UCS-4" SHOULD be used for the various encodings and transformations of Unicode / ISO/IEC 10646, the values "ISO-8859-1", "ISO-8859-2", ... "ISO-8859-n" (where n is the part number) SHOULD be used for the parts of ISO 8859, and the values "ISO-2022-JP", "Shift_JIS", and "EUC-JP" SHOULD be used for the various encoded forms of JIS X-0208-1997. It is RECOMMENDED that character encodings registered (as charsets) with the Internet Assigned Numbers Authority [IANA-CHARSETS], other than those just listed, be referred to using their registered names; other encodings SHOULD use names starting with an "x-" prefix." |
|
428 |
|
|
429 |
@@ in parsing phase |
</div> |
430 |
|
|
431 |
"It is a fatal error when an XML processor encounters an entity with an encoding that it is unable to process. It is a fatal error if an XML entity is determined (via default, encoding declaration, or higher-level protocol) to be in a certain encoding but contains byte sequences that are not legal in that encoding." |
<div class=section id=section-document> |
432 |
|
<h3>Modifications to the <code id=Document>Document</code> Interface</h3> |
433 |
|
|
434 |
|
<!-- |
435 |
|
<p>If an attempt is made to adopt an |
436 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
437 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
438 |
|
the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em> |
439 |
|
raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@ |
440 |
|
ref</span>.</p> |
441 |
--> |
--> |
|
</ul> |
|
|
</div> |
|
442 |
|
|
443 |
<div class="section" id=checking-dom> |
<div class=ed> |
444 |
<h2>Checking <abbr>DOM</abbr></h2> |
<p>Future version of the specification is expected to define what should |
445 |
|
be done if <code>adoptNode</code> or <code>importNode</code> method have to |
446 |
<p>The following algorithms and definitions are applied to |
adopt or import an |
447 |
<abbr>XML</abbr> documents; especially, they are not applied |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
448 |
to <abbr>HTML</abbr> documents.<!-- TODO: ref to HTML5 --></p> |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node. |
449 |
|
In addition it might revise behavior of those methods for |
450 |
<div class=section id=definitions> |
<a href="#Entity"><code>Entity</code></a>, |
451 |
<h3>Definitions</h3> |
<a href="#Notation"><code>Notation</code></a>, and/or |
452 |
|
<a href="#DocumentType"><code>DocumentType</code></a> nodes. |
453 |
<p>The <dfn id=xml-version><abbr>XML</abbr> version</dfn> of a node is |
Behavior of <code>normalizeDocument</code> method for these kinds of |
454 |
the <abbr>XML</abbr> version of the document to which the node belongs. |
nodes might also be defined in some day.</p> |
455 |
For a <code>Documemt</code> node, the <abbr>XML</abbr> version |
</div> |
|
of the document is the value of the <code>xmlVersion</code> |
|
|
attribute of the node. For a <code>DocumentType</code> node whose |
|
|
<code>ownerDocument</code> attribute is set to <code>null</code>, |
|
|
the <abbr>XML</abbr> version of the document is <code>1.0</code><!-- |
|
|
since createDocumentType [DOM3CORE] assumes XML 1.0 [XML10TE] -->. |
|
|
For any other node, the <abbr>XML</abbr> version of the document |
|
|
is that of the <code>Document</code> node contained in the |
|
|
<code>ownerDocument</code> attribute of the node.</p> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<div class=section id=checking-components> |
|
|
<h3>Conformance Checking Algorithms for Components</h3> |
|
|
|
|
|
<p>To |
|
|
<dfn id=algorithm-to-validate-an-xml-character-data title="validate an XML string">to |
|
|
validate an <abbr>XML</abbr> string (<dfn id=var-s><var>s</var></dfn>)</dfn>, |
|
|
the following algorithm <em class=rfc2119>MUST</em> be used:</p> |
|
|
<ol> |
|
|
<li>If <var>s</var> contains a character that is <em>not</em> in |
|
|
the character class <a href="#class-Char10"><code>Char10</code></a>, |
|
|
then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-illegal-char><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>If <var>s</var> contains a character that is in the character |
|
|
class <a href="#class-CompatChar10"><code>CompatChar10</code></a>, |
|
|
then raise an |
|
|
<a href="#xml-misc-warning" id=xmw-compat-char><code>xml-misc-warning</code></a>.</li> |
|
|
<li>If <var>s</var> contains a character that is in the character |
|
|
class <a href="#class-ControlChar10"><code>ControlChar10</code></a>, |
|
|
then raise an |
|
|
<a href="#xml-misc-warning" id=xmw-control-char><code>xml-misc-warning</code></a>.</li> |
|
|
<li class=ed>@@ XML 1.1 support</li> |
|
|
<li>If <var>s</var> contains a <code class=char>U+000D</code> |
|
|
<code class=charname>CARRIAGE RETURN</code> character, then |
|
|
raise a |
|
|
<a href="#round-trip-error" id=rte-cr><code>round-trip-error</code></a>. |
|
|
<span class=ed>@@ We should not raise duplicate errors for U+000D |
|
|
in attribute values. In addition, we should support a mode where |
|
|
U+000D will be serialized as 
 (so that no round-trip-error |
|
|
will be raised).</span></li> |
|
|
</ol> |
|
|
|
|
|
<p>To |
|
|
<dfn id=algorithm-to-validate-a-name title="validate a Name">validate a |
|
|
<code>Name</code> (<dfn id=var-name-s><var>s</var></dfn>)</dfn>, the following |
|
|
algorithm <em class=rfc2119>MUST</em> be used:</p> |
|
|
<ol> |
|
|
<li>If <var>s</var> is an empty string, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-name-empty><code>xml-well-formedness-error</code></a>. |
|
|
Abort these steps.</li> |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate |
|
|
<var>s</var> as an <abbr>XML</abbr> string</a>.</li> |
|
|
<li>If the first character in <var>s</var> is a character that is |
|
|
<em>not</em> in the character class |
|
|
<a href="#class-NameStartChar10"><code>NameStartChar10</code></a>, then raise |
|
|
an |
|
|
<a href="#xml-well-formedness-error" id=wfe-name-startchar><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>If a character other than the first character in <var>s</var> is a |
|
|
character that is <em>not</em> in the character class |
|
|
<a href="#class-NameChar10"><code>NameChar10</code></a>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-name-char><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>If <var>s</var> begins with the string <code>xml</code> (in any |
|
|
case combination), then raise an |
|
|
<a href="#xml-misc-warning" id=xmw-reserved-name><code>xml-misc-warning</code></a>. |
|
|
<span class=ed>@@ except for attribute names <code>xml:lang</code>, |
|
|
<code>xml:space</code>, <code>xml:base</code>, <code>xml:id</code>, |
|
|
<code>xmlns</code>, <code>xmlns:<var>*</var></code>, |
|
|
pi name <code>xml-stylesheet</code>.</span><!-- |
|
|
"names beginning with a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization in this or future versions of this specification.": |
|
|
xmlns, xml-stylesheet, xml:base and xml:id specifications violate to this sentense! |
|
|
--></li> |
|
|
<!-- COLON in Name is a lowercase "should not" in a Note of [XML10], |
|
|
[XML11]. --> |
|
|
<li class=ed>@@ XML 1.1 support</li> |
|
|
</ol> |
|
|
|
|
|
<p>To |
|
|
<dfn id=algorithm-to-validate-an-ncname title="validate an NCName">validate |
|
|
an <code>NCName</code> (<dfn id=var-ncname-s><var>s</var></dfn>)</dfn>, the |
|
|
following algorithm <em class=rfc2119>MUST</em> be used:</p> |
|
|
<ol> |
|
|
<li><a href="#algorithm-to-validate-a-name" title="validate a Name">Validate |
|
|
<var>s</var> as a <code>Name</code></a>.</li> |
|
|
<li class=ed>@@</li> |
|
|
</ol> |
|
|
|
|
|
<p>To |
|
|
<dfn id=algorithm-to-validate-a-public-identifier title="validate a public identifier">validate |
|
|
a public identifier (<dfn id=var-pid><var>pid</var></dfn>)</dfn>, the |
|
|
following algorithm <em class=rfc2119>MUST</em> be used:</p> |
|
|
<ol> |
|
|
<li>If <var>pid</var> is <code>null</code>, abort these steps.</li> |
|
|
<li>If <var>pid</var> contains a character that is <em>not</em> in the |
|
|
character class <a href="#class-PubidChar"><code>PubidChar</code></a>, then |
|
|
raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-pubid-char><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>If <var>pid</var> contains one of <code class=char>U+0009</code> |
|
|
<code class=charname>CHARACTER TABULATION</code>, |
|
|
<code class=char>U+000A</code> <code class=charname>CARRIAGE RETURN</code>, |
|
|
and <code class=char>U+000D</code> <code class=charname>LINE FEED</code> |
|
|
characters, if the first character of <var>pid</var> is |
|
|
<code class=char>U+0020</code> <code class=charname>SPACE</code> character, |
|
|
if the last character of <var>pid</var> is <code class=char>U+0020</code> |
|
|
<code class=charname>SPACE</code> character, or if there is a |
|
|
<code class=char>U+0020</code> <code class=charname>SPACE</code> character |
|
|
immediately followed by another <code class=char>U+0020</code> |
|
|
<code class=charname>SPACE</code> character in <var>pid</var>, then it is a |
|
|
<a href="#round-trip-error" id=rte-pubid-space><code>round-trip-error</code></a>. |
|
|
<span class=ed>Is this really a roundtripness problem? XML spec |
|
|
does only define the way to match public identifiers in fact, no |
|
|
canonical form.</span></li> |
|
|
</ol> |
|
|
|
|
|
<p>To |
|
|
<dfn id=algorithm-to-validate-a-system-identifier title="validate a system identifier">validate |
|
|
a system identifier (<dfn id=var-sid><var>sid</var></dfn>)</dfn>, the |
|
|
following algorithm <em class=rfc2119>MUST</em> be used:</p> |
|
|
<ol> |
|
|
<li>If <var>sid</var> is <code>null</code>, abort these steps.</li> |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate |
|
|
<var>sid</var> as an <abbr>XML</abbr> string</a>.</li> |
|
|
<li>If <var>sid</var> contains both <code class=char>U+0022</code> |
|
|
<code class=charname>QUOTATION MARK</code> (<code class=char>"</code>) and |
|
|
<code class=char>U+0027</code> <code class=charname>APOSTROPHE</code> |
|
|
(<code class=char>'</code>) characters, raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-sid-lit><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>If <var>sid</var> contains at least one <code class=char>U+0023</code> |
|
|
<code class=charname>NUMBER SIGN</code> (<code class=char>#</code>) |
|
|
character, then raise an |
|
|
<a href="#xml-misc-error" id=xme-sid-fragment><code>xml-misc-error</code></a>.</li> |
|
|
<li class=ed>@@ If <var>sid</var> cannot be converted to a URI |
|
|
reference, then raise a fact-level error (xml-misc-warning?).<!-- |
|
|
XML 1.0 has no conformance language for system identifier being |
|
|
a URI reference. --></li> |
|
|
</ol> |
|
456 |
|
|
457 |
</div> |
</div> |
458 |
|
|
459 |
<div class=section id=checking-node> |
<div class=section id=section-documentxdoctype> |
460 |
<h3>Checking <code>Node</code></h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
461 |
|
|
462 |
<p>The algorithm <dfn title="to check a node" id=algorithm-to-check-a-node>to |
<p>The <a href="#Document"><code>Document</code></a> nodes |
463 |
check a node (<dfn id=var-n><var>n</var></dfn>)</dfn> is defined as |
<em class=rfc2119>MUST</em> also implement the |
464 |
following:</p> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface.</p> |
465 |
<dl class=switch> |
|
466 |
<dt>If <var>n</var> is an <code>Attr</code> node</dt> |
<p>An instance of the |
467 |
<dd> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> |
468 |
<ol> |
interface <em class=rfc2119>MUST</em> be able to be obtained by using |
469 |
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
binding$B!>(Bspecific casting methods on an instance of the |
470 |
<code>localName</code> attribute value as an <code>NCName</code></a>.</li> |
<a href="#Document"><code>Document</code></a> interface (if such |
471 |
<li>If the <code>prefix</code> attribute value is different from |
casting methods are available) or by using the method <code>getFeature</code> |
472 |
<code>null</code>, then <a href="#algorithm-to-validate-an-ncname">validate |
with parameter values |
473 |
the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li> |
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
474 |
<li>For each node <dfn id=var-attr-nc><var>n<sub><var>c</var></sub></var></dfn> in the |
and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the |
475 |
<code>childNodes</code> list of <var>n</var>, |
<a href="#Document"><code>Document</code></a> node supports the |
476 |
<ol> |
feature <code>Core</code> version <code>3.0</code> |
477 |
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a |
<span class=ed>[DOM3]</span>).</p> |
478 |
<code>Text</code> or <code>EntityReference</code> node, then it is an |
|
479 |
<a href="#xml-well-formedness-error" id=wfe-attr-child><code>xml-well-formedness-error</code></a>.</li> |
<p>The <a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a> interface |
480 |
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an |
<em class=rfc2119>MUST</em> be implemented as following:</p> |
481 |
<code>EntityReference</code> node, then it is an |
<pre class=idl><code>interface <dfn id=DocumentXDoctype><code>DocumentXDoctype</code></dfn> { |
482 |
<a href="#entity-error" id=ee-attr-er><code>entity-error</code></a>.</li> |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
483 |
<li>Otherwise, |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
484 |
<a href="#algorithm-to-check-a-node" title="check a node">check |
raises (DOMException); |
485 |
<var>n<sub><var>c</var></sub></var></a> recusrively.</li> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
486 |
</ol></li> |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
487 |
<li>If <code>nodeName</code> attribute of <var>n</var> is |
raises (DOMException); |
488 |
<code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span> |
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
489 |
and <code>value</code> attribute of <var>n</var> is neither |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
490 |
<code>default</code> nor <code>preserve</code>, then it is an |
raises (DOMException); |
491 |
<a href="#xml-misc-error" id=xme-attr-xml-space><code>xml-misc-error</code></a>.<!-- |
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
492 |
Note that <!ATTLIST e xml:space (default|preserve) "a">... |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
493 |
<e xml:space="default"/> is conforming and valid. --></li> |
raises (DOMException); |
494 |
<li class=ed>@@ xml:lang value is not a language tag [RFC 3066 or its |
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
495 |
successor] or an empty string, then xml-misc-warning |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
496 |
(a "fact"-level error; not an XML error).</li> |
raises (DOMException); |
497 |
<li class=ed>@@ <code>specified</code>, |
}</code></pre> |
498 |
<code>manakaiAttributeType</code> (#ValueType Validity constraint: Attribute Value Type)</li> |
|
499 |
<!-- xml:space MUST be declared to be valid. --> |
<dl> |
500 |
<li>Let <dfn id=var-v><var>v</var></dfn> be the value of the |
<dt><dfn id=createDocumentTypeDefinition class=dom-method><code>createDocumentTypeDefinition</code></dfn>, |
501 |
attribute <code>value</code> of <var>n</var>.</li> |
method</dt> |
|
<li>Validate the <var>n</var> against the <span class=ed>declared |
|
|
type</span> as following: |
|
|
<dl class=switch> |
|
|
<dt class=ed><code>ID_ATTR</code></dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><span class=ed>Validate <var>v</var> as an |
|
|
<code>Name</code>.</span> If it fails, then raise an |
|
|
<a href="#xml-validity-error" id=vc-id-name><code>xml-validity-error</code></a>.</li> |
|
|
<li><span class=ed>If <code>ID</code> <var>v</var> is defined,</span> |
|
|
then raise an |
|
|
<a href="#xml-validity-error" id=vc-id-duplication><code>xml-validity-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt class=ed>IDREF_ATTR</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><span class=ed>Validate <var>v</var> as an |
|
|
<code>Name</code>.</span> If it fails, then raise an |
|
|
<a href="#xml-validity-error" id=vc-idref-name><code>xml-validity-error</code></a>.</li> |
|
|
<li><span class=ed>If <code>ID</code> <var>v</var> is NOT |
|
|
defined,</span> then raise an |
|
|
<a href="#xml-validity-error" id=vc-idref-match><code>xml-validity-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt class=ed>IDREFS_ATTR</dt> |
|
|
<dd class=ed>@@</dd> |
|
|
<dt class=ed>ENTITY_ATTR</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><span class=ed>Validate <var>v</var> as an |
|
|
<code>Name</code>.</span> If it fails, then raise an |
|
|
<a href="#xml-validity-error" id=vc-entname-name><code>xml-validity-error</code></a>.</li> |
|
|
<li><span class=ed>If <code>Entity</code> <var>v</var> is NOT |
|
|
defined,</span> then raise an |
|
|
<a href="#xml-validity-error" id=vc-entname-match><code>xml-validity-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt class=ed>ENTITIES_ATTR</dt> |
|
|
<dd class=ed>@@</dd> |
|
|
<dt class=ed>NMTOKEN_ATTR</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><span class=ed>Validate <var>v</var> as an |
|
|
<code>Nmtoken</code>.</span> If it fails, then raise an |
|
|
<a href="#xml-validity-error" id=vc-nmtok-name><code>xml-validity-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt class=ed>NMTOKENS_ATTR</dt> |
|
|
<dd class=ed>@@</dd> |
|
|
<dt class=ed>NOTATION_ATTR</dt> |
|
|
<dd class=ed><var>v</var> must be one of enumerated values. |
|
|
If not, then raise an |
|
|
<a href="#xml-validity-error" id=vc-notatn-match><code>xml-validity-error</code></a>.</dd> |
|
|
<dt class=ed>ENUMERATED_ATTR</dt> |
|
|
<dd class=ed><var>v</var> must be one of enumerated values. |
|
|
If not, then raise an |
|
|
<a href="#xml-validity-error" id=vc-enum><code>xml-validity-error</code></a>.</dd> |
|
|
<dt class=ed>@@</dt> |
|
|
</dl> |
|
|
</li> |
|
|
<li>If <span class=ed>type ID and default is NOT #IMPLIED or #REQUIRED</span>, then |
|
|
raise an |
|
|
<a href="#xml-validity-error" id=vc-id-default><code>xml-validity-error</code></a>.</li> |
|
|
<li class=ed>@@ #FixedAttr Validity constraint: Fixed Attribute Default</li> |
|
|
<li class=ed>@@ strict serialization error for U+000D, U+000A, and |
|
|
U+0009 characters, leading/trailing U+0020, and U+0020{2,} string?</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>AttributeDefinition</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li class=ed></li> |
|
|
<li>If <code>nodeName</code> attribute of <var>n</var> is |
|
|
<code>xml:space</code> <span class=ed>@@ or {xml namespace}:space ?</span> |
|
|
and <span class=ed>its declared type is different from (default|preserve), |
|
|
(default), or (preserve)</span>, then raise an |
|
|
<a href="#xml-misc-error" id=xme-at-xml-space><code>xml-misc-error</code></a>.</li> |
|
|
<li>For each node <dfn id=var-ad-nc><var>n<sub><var>c</var></sub></var></dfn> in the |
|
|
<code>childNodes</code> list of <var>n</var>, |
|
|
<ol> |
|
|
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a |
|
|
<code>Text</code> or <code>EntityReference</code> node, then it is an |
|
|
<a href="#xml-well-formedness-error" id=wfe-at-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an |
|
|
<code>EntityReference</code> node, then it is an |
|
|
<a href="#entity-error" id=ee-at-er><code>entity-error</code></a>.</li> |
|
|
<li>Otherwise, |
|
|
<a href="#algorithm-to-check-a-node" title="check a node">check |
|
|
<var>n<sub><var>c</var></sub></var></a> recusrively.</li> |
|
|
</ol></li> |
|
|
<li class=ed>If <code>NOTATION_ATTR</code>, enumerated values MUST |
|
|
be declared. If not, then raise an |
|
|
<a href="#xml-validity-error" id=vc-notatn-declared><code>xml-validity-error</code></a>.</li> |
|
|
<li class=ed>If <code>NOTATION_ATTR</code> or <code>ENUMERATED_ATTR</code>, |
|
|
values MUST all be distinct. If not, then raise an |
|
|
<a href="#xml-validity-error" id=vc-no-duplicate-tokens><code>xml-validity-error</code></a>.</li> |
|
|
<li class=ed>If <code>NOTATION_ATTR</code> on an <code>EMPTY</code> |
|
|
element, then raise an |
|
|
<a href="#xml-validity-error" id=vc-no-notation-empty><code>xml-validity-error</code></a>.</li> |
|
|
<li class=ed>@@ #defattrvalid Validity constraint: Attribute Default Value Syntactically Correct</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is a <code>CDATASection</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
|
|
data</a>.</li> |
|
|
<li>If the <code>data</code> attribute value contains |
|
|
a string <code>]]></code>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-cs-mse><code>xml-well-formedness-error</code></a>.<!-- "for compatibility" --></li> |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
|
any nodes, they are in |
|
|
<a href="#xml-well-formedness-error" id=wfe-cs-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is a <code>Comment</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li>Raise an |
|
|
<a href="#round-trip-warning" id=rtw-comment><code>round-trip-warning</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the |
|
|
<code>data</code> attribute value as an <abbr>XML</abbr> character |
|
|
data</a>.</li> |
|
|
<li>If the <code>data</code> attribute value contains |
|
|
a string <code>--</code>, or if it ends with a character |
|
|
<code>-</code>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-comment-com><code>xml-well-formedness-error</code></a>.<!-- |
|
|
"for compatibility" --></li> |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
|
any nodes, they are in |
|
|
<a href="#xml-well-formedness-error" id=wfe-comment-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is a <code>Document</code> node</dt> |
|
502 |
<dd> |
<dd> |
503 |
<ol> |
<p>This method creates a <code>DocumentType</code> node with the specified |
504 |
<li>If <a href="#xml-version"><abbr>XML</abbr> version</a> of <var>n</var> |
name, belonging to the document.</p> |
505 |
is different from <code>1.0</code> or <code>1.1</code>, |
<p>The <dfn id=createDocumentTypeDefinition-name class=dom-param><var>name</var></dfn> |
506 |
then it is an <code class=ed>unknown-error?</code>.</li> |
parameter is the name of the document type.</p> |
507 |
<li>If the <code>xmlEncoding</code> attribute value does <em>not</em> |
|
508 |
match to <code>[A-Za-z] ([A-Za-z0-9._] | '-')*</code> |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
509 |
<span class=ed>@@ formal def</span>, then it is an |
return a <code>DocumentType</code> node with the following attributes:</p> |
510 |
<a href="#xml-well-formedness-error" id=wfe-encoding><code>xml-well-formedness-error</code></a>.</li> |
<dl> |
511 |
<li>The <code>childNodes</code> list of <var>n</var> have to |
<dt><code>attributes</code>, <code>parentNode</code></dt> |
512 |
consist of zero or more <code>Comment</code> and/or |
<dd><code>null</code>.</dd> |
513 |
<code>ProcessingInstruction</code> nodes, followed by |
<dt><code>elementTypes</code>, <code>generalEntities</code>, and |
514 |
an optional <code>DocumentType</code> node, followed |
<code>notations</code></dt> |
515 |
by zero or more <code>Comment</code> and/or |
<dd>Empty <code>NamedNodeMap</code> objects.</dd> |
516 |
<code>ProcessingInstruction</code> nodes, followed by |
<dt><code>entities</code></dt> |
517 |
an <code>Element</code> node, followed |
<dd>The same value as the <code>generalEntities</code> attribute.</dd> |
518 |
by zero or more <code>Comment</code> and/or |
<dt><code>childNodes</code></dt> |
519 |
<code>ProcessingInstruction</code> nodes. Any violation to this is an |
<dd>An empty <code>NodeList</code> object.</dd> |
520 |
<a href="#xml-well-formedness-error" id=wfe-document-child><code>xml-well-formedness-error</code></a>.</li> |
<dt><code>internalSubset</code>, <code>publicId</code>, and |
521 |
<li>For each node <dfn id=var-document-nc><var>n<sub><var>c</var></sub></var></dfn> |
<code>systemId</code></dt> |
522 |
in the <code>childNodes</code> list of <var>n</var>, |
<dd>Empty strings.</dd> |
523 |
<ol> |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
524 |
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
<dd><code>false</code>.</dd> |
525 |
<code>EntityReference</code> node, then |
<dt><code>nodeName</code></dt> |
526 |
<a href="#algorithm-to-check-a-node" title="check a node">check |
<dd><a href="#createDocumentTypeDefinition-name"><var>name</var></a>.</dd> |
527 |
<var>n<sub><var>c</var></sub></var></a> recursively.</li> |
<dt><code>ownerDocument</code></dt> |
528 |
</ol></li> |
<dd>The <code>Document</code> over which the method is invoked.</dd> |
529 |
<li class=ed>@@ <code>allDeclarationsProcessed</code></li> |
</dl> |
530 |
</ol> |
<p>In addition, the method <em class=rfc2119>MUST</em> be marked as |
531 |
|
containing five general entity declarations: <code>amp</code>, |
532 |
|
<code>lt</code>, <code>gt</code>, <code>quot</code>, and |
533 |
|
<code>apos</code>.</p> |
534 |
</dd> |
</dd> |
535 |
<dt>If <var>n</var> is a <code>DocumentFragment</code> node</dt> |
<dt><dfn id=createElementTypeDefinition class=dom-method><code>createElementTypeDefinition</code></dfn>, |
536 |
|
method</dt> |
537 |
<dd> |
<dd> |
538 |
<ol> |
<p>This method creates a <code>ElementTypeDefinition</code> node with the |
539 |
<li>For each node <dfn id=var-df-nc><var>n<sub><var>c</var></sub></var></dfn> |
specified name, belonging to the document.</p> |
540 |
in the <code>childNodes</code> list of <var>n</var>, |
<p>The <dfn id=createElementTypeDefinition-name class=dom-param><var>name</var></dfn> |
541 |
<ol> |
parameter is the name of the element type defined by the element |
542 |
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
type definition.</p> |
543 |
<code>Element</code>, <code>Text</code>, <code>CDATASection</code>, |
|
544 |
<code>Comment</code>, <code>ProcessingInstruction</code>, or |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
545 |
<code>EntityReference</code> node, then it is an |
return an |
546 |
<a href="#xml-well-formedness-error" id=wfe-df-child><code>xml-well-formedness-error</code></a>.</li> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
547 |
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an |
node with the following attributes:</p> |
548 |
<code>EntityReference</code> node, then it is an |
<dl> |
549 |
<a href="#entity-error" id=ee-df-er><code>entity-error</code></a>.</li> |
<dt><a href="#attributeDefinitions"><code>attributeDefinitions</code></a></dt> |
550 |
<li>Otherwise, |
<dd>An empty <code>NamedNodeMap</code> object.</dd> |
551 |
<a href="#algorithm-to-check-a-node" title="check a node">check |
<dt><code>attributes</code>, <code>parentNode</code></dt> |
552 |
<var>n<sub><var>c</var></sub></var></a> recursively.</li> |
<dd><code>null</code>.</dd> |
553 |
</ol></li> |
<dt><code>childNodes</code></dt> |
554 |
</ol> |
<dd>An empty <code>NodeList</code> object.</dd> |
555 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
556 |
|
<dd><code>false</code>.</dd> |
557 |
|
<dt><code>nodeName</code></dt> |
558 |
|
<dd><a href="#createElementTypeDefinition-name"><var>name</var></a>.</dd> |
559 |
|
<dt><code>ownerDocument</code></dt> |
560 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
561 |
|
<dt><a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a></dt> |
562 |
|
<dd><code>null</code>.</dd> |
563 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
564 |
|
</dl> |
565 |
</dd> |
</dd> |
566 |
<dt>If <var>n</var> is a <code>DocumentType</code> node</dt> |
<dt><dfn id=createAttributeDefinition class=dom-method><code>createAttributeDefinition</code></dfn>, |
567 |
|
method</dt> |
568 |
<dd> |
<dd> |
569 |
<ol> |
<p>This method creates a <code>AttributeDefinition</code> node with the |
570 |
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
specified name, belonging to the document.</p> |
571 |
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
<p>The <dfn id=createAttributeDefinition-name class=dom-param><var>name</var></dfn> |
572 |
<li>Follow the following substeps: |
parameter is the name of the attribute defined by the attribute |
573 |
<ol> |
definition.</p> |
574 |
<li>If <code>ownerDocument</code> attribute of <var>n</var> is |
|
575 |
<code>null</code>, then abort these substeps.</li> |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and |
576 |
<li>If <code>documentElement</code> attribute of the node |
return an |
577 |
set to <code>ownerDocument</code> attribute of <var>n</var> is |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
578 |
<code>null</code>, then abort these substeps.</li> |
node with the following attributes:</p> |
579 |
<li>If <code>nodeName</code> attribute of the node set to |
<dl> |
580 |
<code>documentElement</code> attribute of the node set to |
<dt><code>allowedTokens</code></dt> |
581 |
<code>ownerDocument</code> attribute of <var>n</var> is |
<dd>An empty <code>DOMStringList</code> object.</dd> |
582 |
different from <code>nodeName</code> of <var>n</var>, |
<dt><code>attributes</code>, |
583 |
then raise an |
<a href="#ownerElementTypeDefinition"><code>ownerElementTypeDefinition</code></a>, |
584 |
<a href="#xml-validity-error" id=vc-roottype><code>xml-validity-error</code></a>.</li></li> |
and <code>parentNode</code></dt> |
585 |
</ol> |
<dd><code>null</code>.</dd> |
586 |
</li> |
<dt><code>childNodes</code></dt> |
587 |
<li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate |
<dd>An empty <code>NodeList</code> object.</dd> |
588 |
the <code>publicId</code> attribute value as a public identifier</a>.</li> |
<dt><code>declaredType</code></dt> |
589 |
<li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate |
<dd><a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</dd> |
590 |
the <code>systemId</code> attribute value as a system identifier</a>.</li> |
<dt><code>defaultType</code></dt> |
591 |
<li>If the <code>publicId</code> attribute value of <var>n</var> is |
<dd><a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</dd> |
592 |
<em>not</em> <code>null</code> and the <code>systemId</code> attribute |
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
593 |
value of <var>n</var> is <code>null</code>, then raise an |
<dd><code>false</code>.</dd> |
594 |
<a href="#xml-well-formedness-error" id=wfe-dt-sid><code>xml-well-formedness-error</code></a>. |
<dt><code>nodeName</code></dt> |
595 |
<span class=ed>@@ publicId == null? Or, publicId == ""</span></li> |
<dd><a href="#createAttributeDefinition-name"><var>name</var></a>.</dd> |
596 |
<li>For each node <dfn id=var-dt-nc><var>n<sub><var>c</var></sub></var></dfn> |
<dt><code>ownerDocument</code></dt> |
597 |
in the <code>childNodes</code> list of <var>n</var>, |
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
598 |
<ol> |
<dt class=ed>@@ Ensure all attributes are defined</dt> |
599 |
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> a |
</dl> |
600 |
<code>ProcessingInstruction</code> node, then it is an |
|
601 |
<a href="#xml-well-formedness-error" id=wfe-dt-child><code>xml-well-formedness-error</code></a>. |
<div class=ed> |
602 |
<span class=ed>@@ ref to manakai's extensions</span></li> |
<p>@@ Should we keep these statements?: |
603 |
<li>Otherwise, <!-- if n_c is not an EntityReference node, --> |
However, if the <cfg::cfg|xml-id> configuration |
604 |
<a href="#algorithm-to-check-a-node" title="check a node">check |
parameter is set to <code>true</code> and the <var>name</var> |
605 |
<var>n<sub><var>c</var></sub></var></a> recusrively.</li> |
is <code>xml:id</code>, then the [CODE(DOMa)@en[[[declaredType]]]] |
606 |
</ol></li> |
attribute is set to <code>ID_ATTR</code>. |
607 |
<li>For each node in the <code>entities</code>, <code>notations</code>, |
[CODE(DOMa)@en[[[defaultType]]]]?</p> |
608 |
and <code>elementTypes</code> lists of <var>n</var>, |
</div> |
|
<a href="#algorithm-to-check-a-node" title="check a node">check the |
|
|
node</a> recursively.</li> |
|
|
<li class=ed>@@ externally declared?</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>Element</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>localName</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li>If the <code>prefix</code> attribute value is different from |
|
|
<code>null</code>, then <a href="#algorithm-to-validate-an-ncname">validate |
|
|
the <code>prefix</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li>For each node <dfn id=var-element-nc><var>n<sub><var>c</var></sub></var></dfn> |
|
|
in the <code>childNodes</code> list of <var>n</var>, |
|
|
<ol> |
|
|
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
|
|
<code>Element</code>, |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
|
|
<code>ProcessingInstruction</code>, or |
|
|
<code>EntityReference</code> node, then it is an |
|
|
<a href="#xml-well-formedness-error" id=wfe-element-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an |
|
|
<code>EntityReference</code> node, then it is an |
|
|
<a href="#entity-error" id=ee-element-er><code>entity-error</code></a>.</li> |
|
|
<li>Otherwise, |
|
|
<a href="#algorithm-to-check-a-node" title="check a node">check |
|
|
<var>n<sub><var>c</var></sub></var></a> recursively.</li> |
|
|
</ol></li> |
|
|
<li class=ed>@@ #elementvalid Validity constraint: Element Valid</li> |
|
|
<li>Let <var>attrs</var> be the value of the <code>attribute</code> |
|
|
attribute of <var>n</var>. Check conformance of <var>attrs</var> |
|
|
as following: |
|
|
<ol> |
|
|
<li>If <var>attrs</var> contains an <code>Attr</code> node whose |
|
|
<code>nodeName</code> attribute value is equal to that of another |
|
|
<code>Attr</code> node in <var>attrs</var>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-uniqattspec><code>xml-well-formedness-error</code></a>.<!-- |
|
|
#uniqattspec Well-formedness constraint: Unique Att Spec --></li> |
|
|
<li class=ed>@@ #RequiredAttr Validity constraint: Required Attribute</li> |
|
|
</ol> |
|
|
</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>ElementTypeDefinition</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li class=ed></li> |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
|
any nodes, they are in |
|
|
<a href="#xml-well-formedness-error" id=wfe-et-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#elemdecls">At user option, an XML processor MAY issue a warning when a declaration mentions an element type for which no declaration is provided, but this is not an error.</q></li> |
|
|
<li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#sec-element-content">For compatibility, it is an error if the content model allows an element to match more than one occurrence of an element type in the content model. </q></li> |
|
|
<li class=ed>@@ #vc-MixedChildrenUnique |
|
|
Validity constraint: No Duplicate Types</li> |
|
|
<li class=ed>@@ <q cite="http://www.w3.org/TR/2006/REC-xml-20060816/#attdecls">At user option, an XML processor MAY issue a warning if attributes are declared for an element type not itself declared, but this is not an error.</q></li> |
|
|
<li>If there is more than one <code>AttributeDefinition</code> node |
|
|
with <span class=ed>attribute type <code>ID</code></span> in the |
|
|
<code>NamedNodeMap</code> list contained in the |
|
|
<code>attributeDefinitions</code> attribute of <var>n</var>, then raise an |
|
|
<a href="#xml-validity-error" id=vc-one-id-per-el><code>xml-validity-error</code></a>.</li> |
|
|
<li>If there is more than one <code>AttributeDefinition</code> node |
|
|
with <span class=ed>attribute type <code>NOTATION</code></span> in the |
|
|
<code>NamedNodeMap</code> list contained in the |
|
|
<code>attributeDefinitions</code> attribute of <var>n</var>, then raise an |
|
|
<a href="#xml-validity-error" id=vc-one-notation-per><code>xml-validity-error</code></a>.</li> |
|
|
<li class=ed>"For interoperability, the same Nmtoken SHOULD NOT occur more than once in the enumerated attribute types of a single element type."</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>Entity</code> node whose |
|
|
<code>notationName</code> attribute value is <code>null</code> (i.e. a |
|
|
parsed entity)</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li>Raise an |
|
|
<a href="#entity-error" id=ee-entity-node><code>entity-error</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate |
|
|
the <code>publicId</code> attribute value as a public identifier</a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate |
|
|
the <code>systemId</code> attribute value as a system identifier</a>.</li> |
|
|
<li>If the <code>publicId</code> attribute value of <var>n</var> is |
|
|
<em>not</em> <code>null</code> and the <code>systemId</code> attribute |
|
|
value of <var>n</var> is <code>null</code>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-entity-sid><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>For each node <dfn id=var-entity-nc><var>n<sub><var>c</var></sub></var></dfn> |
|
|
in the <code>childNodes</code> list of <var>n</var>, |
|
|
<ol> |
|
|
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
|
|
<code>Element</code>, |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
|
|
<code>ProcessingInstruction</code>, or <code>EntityReference</code> |
|
|
node, then it is an |
|
|
<a href="#xml-well-formedness-error" id=wfe-entity-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is an |
|
|
<code>EntityReference</code> node, then it is an |
|
|
<a href="#entity-error" id=ee-er-er><code>entity-error</code></a>.</li> |
|
|
<li>Otherwise, |
|
|
<a href="#algorithm-to-check-a-node" title="check a node">check |
|
|
<var>n<sub><var>c</var></sub></var></a> recursively.</li> |
|
|
</ol></li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>Entity</code> node whose |
|
|
<code>notationName</code> attribute value is <em>not</em> <code>null</code> |
|
|
(i.e. an unparsed entity)</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate |
|
|
the <code>publicId</code> attribute value as a public identifier</a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate |
|
|
the <code>systemId</code> attribute value as a system identifier</a>.</li> |
|
|
<li>If the <code>systemId</code> attribute value of <var>n</var> is |
|
|
<code>null</code>, then raise an |
|
|
<a href="#xml-well-formedness-error" id=wfe-uentity-sid><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>notationName</code> attribute value of <var>n</var> as an |
|
|
<code>NCName</code></a>.</li> |
|
|
<li class=ed>@@ #not-declared Validity constraint: Notation Declared</li> |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
|
any nodes, they are in |
|
|
<a href="#xml-well-formedness-error" id=wfe-uentity-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is an <code>EntityReference</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li>An <a href="#entity-error" id=ee-er-node><code>entity-error</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li>For each node <dfn id=var-er-nc><var>n<sub><var>c</var></sub></var></dfn> |
|
|
in the <code>childNodes</code> list of <var>n</var>, |
|
|
<ol> |
|
|
<li>If <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
|
|
<code>Element</code>, |
|
|
<code>Text</code>, <code>CDATASection</code>, <code>Comment</code>, |
|
|
<code>ProcessingInstruction</code>, or <code>EntityReference</code> |
|
|
node, then it is an |
|
|
<a href="#xml-well-formedness-error" id=wfe-er-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
<li>Otherwise, if <var>n<sub><var>c</var></sub></var> is <em>not</em> an |
|
|
<code>EntityReference</code> node, then it is an |
|
|
<a href="#entity-error" id=ee-entity-er><code>entity-error</code></a>.</li> |
|
|
<li>Otherwise, |
|
|
<a href="#algorithm-to-check-a-node" title="check a node">check |
|
|
<var>n<sub><var>c</var></sub></var></a> recursively.</li> |
|
|
</ol></li> |
|
|
</ol> |
|
|
</dd> |
|
|
<dt>If <var>n</var> is a <code>Notation</code> node</dt> |
|
|
<dd> |
|
|
<ol> |
|
|
<li><a href="#algorithm-to-validate-an-ncname">Validate the |
|
|
<code>nodeName</code> attribute value as an <code>NCName</code></a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-public-identifier" title="validate a public identifier">Validate |
|
|
the <code>publicId</code> attribute value as a public identifier</a>.</li> |
|
|
<li><a href="#algorithm-to-validate-a-system-identifier" title="validate a system identifier">Validate |
|
|
the <code>systemId</code> attribute value as a system identifier</a>.</li> |
|
|
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
|
any nodes, they are in |
|
|
<a href="#xml-well-formedness-error" id=wfe-notation-child><code>xml-well-formedness-error</code></a>.</li> |
|
|
</ol> |
|
609 |
</dd> |
</dd> |
610 |
<dt>If <var>n</var> is a <code>ProcessingInstruction</code> node</dt> |
<dt><dfn id=createGeneralEntity class=dom-method><code>createGeneralEntity</code></dfn>, |
611 |
|
method</dt> |
612 |
<dd> |
<dd> |
613 |
<ol> |
<p>This method creates a <a href="#Entity"><code>Entity</code></a> node |
614 |
<li>If the <code>target</code> attribute value matches to the string |
with the specified name, which represents a general entity, belonging to |
615 |
<code>xml</code> in any case combination, then raise a |
the document.</p> |
616 |
<a href="#xml-well-formedness-error" id=wfe-pi-xml><code>xml-well-formedness-error</code></a>.</li> |
<p>The <dfn id=createGeneralEntity-name class=dom-param><var>name</var></dfn> |
617 |
<li>Otherwise, <a href="#algorithm-to-validate-an-ncname">validate the |
parameter is the name of the general entity.</p> |
618 |
<code>target</code> attribute value as an <code>NCName</code></a>.</li> |
|
619 |
<li>Then, |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
620 |
<a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">validate |
an <a href="#Entity"><code>Entity</code></a> node with the following |
621 |
the <code>data</code> attribute value as an <abbr>XML</abbr> character |
attributes:</p> |
622 |
data</a>.</li> |
<dl> |
623 |
<li>If the <code>data</code> attribute value contains a string |
<dt><code>attributes</code>, <code>notationName</code>, |
624 |
<code>?></code>, then raise a |
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
625 |
<a href="#xml-well-formedness-error" id=wfe-pi-pic><code>xml-well-formedness-error</code></a>.</li> |
and <code>parentNode</code></dt> |
626 |
<li>If the <code>data</code> attribute value starts with either |
<dd><code>null</code>.</dd> |
627 |
<code class=char>U+0009</code> <code class=charname>CHARACTER |
<dt><code>childNodes</code></dt> |
628 |
TABULATION</code>, <code class=char>U+000A</code> <code class=charname>LINE |
<dd>An empty <code>NodeList</code> object.</dd> |
629 |
FEED</code>, <code class=char>U+000D</code> <code class=charname>CARRIAGE |
<dt><code>manakaiDeclarationBaseURI</code>, |
630 |
RETURN</code>, or <code class=char>U+0020</code> |
<code>manakaiEntityBaseURI</code>, and |
631 |
<code class=charname>SPACE</code> character, then raise a |
<code>manakaiEntityURI</code> <span class=ed>@@ ref</span></dt> |
632 |
<a href="#round-trip-error" id=rte-pi-s><code>round-trip-error</code></a>.</li> |
<dd>No explicit value is set.</dd> |
633 |
<li>If the <code>childNodes</code> list of <var>n</var> contains |
<dt><a href="#hasReplacementTree"><code>hasReplacementTree</code></a> and |
634 |
any nodes, then raise an |
<code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
635 |
<a href="#xml-well-formedness-error" id=wfe-pi-child><code>xml-well-formedness-error</code></a>.</li> |
<dd><code>false</code>.</dd> |
636 |
</ol> |
<dt><code>nodeName</code></dt> |
637 |
|
<dd><a href="#createGeneralEntity-name"><var>name</var></a>.</dd> |
638 |
|
<dd> |
639 |
|
<div class="note memo"> |
640 |
|
<p>It is not an error for |
641 |
|
<a href="#createGeneralEntity-name"><var>name</var></a> matching |
642 |
|
to the name of one of predefined general parsed entities in |
643 |
|
<abbr>XML</abbr> or <abbr>HTML</abbr>. For example, |
644 |
|
<a href="#createGeneralEntity-name"><var>name</var></a> might be |
645 |
|
<code>amp</code>, resulting in an |
646 |
|
<a href="#Entity"><code>Entity</code></a> node |
647 |
|
with its <code>nodeName</code> attribute set to <code>amp</code>.</p> |
648 |
|
</div> |
649 |
|
</dd> |
650 |
|
<dt><code>ownerDocument</code></dt> |
651 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
652 |
|
<dt><code>publicId</code>, and <code>systemId</code></dt> |
653 |
|
<dd><code>null</code>.</dd> |
654 |
|
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
655 |
|
<dt class=ed>@@ Ensure all attributes are defined</dd> |
656 |
|
</dl> |
657 |
</dd> |
</dd> |
658 |
<dt>If <var>n</var> is a <code>Text</code> node</dt> |
<dt><dfn id=createNotation class=dom-method><code>createNotation</code></dfn>, |
659 |
|
method</dt> |
660 |
<dd> |
<dd> |
661 |
<ol> |
<p>This method creates a <code>Notation</code> node with the |
662 |
<li><a href="#algorithm-to-validate-an-xml-character-data" title="validate an XML string">Validate the |
specified name, belonging to the document.</p> |
663 |
<code>data</code> attribute value as an <abbr>XML</abbr> character |
<p>The <dfn id=createNotation-name class=dom-param><var>name</var></dfn> |
664 |
data</a>.</li> |
parameter is the name of the notation.</p> |
665 |
<li>If the <code>childNodes</code> list of <var>n</var> contains |
|
666 |
any nodes, they are in |
<p>When invoked, the method <em class=rfc2119>MUST</em> create and return |
667 |
<a href="#xml-well-formedness-error" id=wfe-text-child><code>xml-well-formedness-error</code></a>.</li> |
a <code>Notation</code> node with the following attributes:</p> |
668 |
</ol> |
<dl> |
669 |
|
<dt><code>attributes</code>, |
670 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a>, |
671 |
|
and <code>parentNode</code></dt> |
672 |
|
<dd><code>null</code>.</dd> |
673 |
|
<dt><code>childNodes</code></dt> |
674 |
|
<dd>An empty <code>NodeList</code> object.</dd> |
675 |
|
<dt><code>manakaiDeclarationBaseURI</code></dt> |
676 |
|
<dd>No explicit value is set.</dd> |
677 |
|
<dt><code>manakaiReadOnly</code> <span class=ed>[manakai]</span></dt> |
678 |
|
<dd><code>false</code>.</dd> |
679 |
|
<dt><code>nodeName</code></dt> |
680 |
|
<dd><a href="#createNotation-name"><var>name</var></a>.</dd> |
681 |
|
<dt><code>ownerDocument</code></dt> |
682 |
|
<dd>The <code>Document</code> node over which the method is invoked.</dd> |
683 |
|
<dt><code>publicId</code> and <code>systemId</code></dt> |
684 |
|
<dd><code>null</code>.</dd> |
685 |
|
<dd class=ed>@@ publicId and systemId should be empty string?</dd> |
686 |
|
<dt class=ed>@@ Ensure all attributes are defined</dt> |
687 |
|
</dl> |
688 |
</dd> |
</dd> |
|
<dt>Otherwise</dt> |
|
|
<dd><span class=ed>xml-well-formedness-error? unknown-error?</span></dd> |
|
689 |
</dl> |
</dl> |
690 |
|
|
691 |
|
<p>These methods <em class=rfc2119>MUST</em> raise an |
692 |
|
<code>INVALID_CHARACTER_ERR</code> exception <span class=ed>@@ ref</span> |
693 |
|
if <var>name</var> is <em>not</em> a legal <code>Name</code> according to |
694 |
|
the <abbr>XML</abbr> version in use, as specified in the |
695 |
|
<code>xmlVersion</code> attribute of the <code>Document</code> node.</p> |
696 |
|
|
697 |
|
<div class="note memo"> |
698 |
|
<p>Non$B!>(B<abbr>XML</abbr> case is intentionally left unspecified for now, |
699 |
|
since <abbr>DOM3</abbr> specification <span class=ed>@@ ref</span> does not |
700 |
|
define it for <code>Document</code> methods.</p> |
701 |
|
|
702 |
|
<p><var>name</var> does not have to be a namespace qualified name.</p> |
703 |
</div> |
</div> |
704 |
|
|
705 |
</div> |
</div> |
706 |
|
|
|
<div id=classes class=section> |
|
|
<h2>Character Classes</h2> |
|
707 |
|
|
708 |
<p>This section defines a couple of character classes. |
<div class=section id=section-documenttype> |
709 |
These classes are referred to by algorithms specified above.</p> |
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
710 |
|
Interface</h3> |
711 |
|
|
712 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
713 |
|
<em class=rfc2119>MAY</em> contain zero or more |
714 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
715 |
|
nodes in the <code>NodeList</code> object contained in the |
716 |
|
<code>childNodes</code> attribute of the |
717 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
718 |
|
|
719 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
720 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
721 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
722 |
|
object <em class=rfc2119>MUST</em> contains the |
723 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
724 |
|
nodes representing the processing instructions in the document type |
725 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
726 |
|
the <abbr>XML</abbr> processor. If the |
727 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
728 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
729 |
|
also be marked as read$B!>(Bonly.</p> |
730 |
|
|
731 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
732 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
733 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
734 |
|
of the node <em class=rfc2119>MUST</em> contain the |
735 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
736 |
|
created from the processing instruction information items in the list in the |
737 |
|
[children] property of the document type declaration item in the same |
738 |
|
order.</p> |
739 |
|
|
740 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
741 |
|
a document type declaration information item, the list in the [children] |
742 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
743 |
|
information items created from the |
744 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
745 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
746 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
747 |
|
|
748 |
|
<p>The implementation of the |
749 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
750 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
751 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
752 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
753 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
754 |
|
|
755 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
756 |
|
</code></pre> |
757 |
|
|
758 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
759 |
|
<code id=systemId>systemId</code> attribute of |
760 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
761 |
|
<a href="#Entity"><code>Entity</code></a>, and |
762 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
763 |
|
read$B!>(Bonly.</p> |
764 |
|
|
765 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
766 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
767 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
768 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
769 |
|
associated to the attribute. No normalization, relative reference resolution, |
770 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
771 |
|
value is <code>null</code>, ...</span></p> |
772 |
|
|
|
<p>Character class <dfn id=class-Char10><code>Char10</code></dfn> |
|
|
contains the following characters:</p> |
|
|
<ul> |
|
|
<li><code class=char>U+0009</code> <code class=charname>CHARACTER |
|
|
TABULATION</code></li> |
|
|
<li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li> |
|
|
<li><code class=char>U+000D</code> <code class=charname>CARRIAGE |
|
|
RETURN</code></li> |
|
|
<li><code class=char>U+0020</code> <code class=charname>SPACE</code> |
|
|
.. <code class=char>U+D7FF</code></li> |
|
|
<li><code class=char>U+E000</code> .. <code class=char>U+FFFD</code> |
|
|
<code class=charname>REPLACEMENT CHARACTER</code></li> |
|
|
<li><code class=char>U+10000</code> .. <code class=char>U+10FFFF</code></li> |
|
|
</ul> |
|
773 |
<div class="note memo"> |
<div class="note memo"> |
774 |
<p>This character class contains all characters allowed in the production rule |
<p>Setting an invalid identifier might make the node unserializable. |
775 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Char"><code>Char</code></a> |
Setting a public identifier while leaveing system identifier unspecified |
776 |
of <abbr>XML</abbr> 1.0 |
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
777 |
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p> |
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
|
</div> |
|
|
|
|
|
<p>Character class <dfn id=class-CompatChar10><code>CompatChar10</code></dfn> |
|
|
contains the following characters:</p> |
|
|
<ul> |
|
|
<li class=ed>@@ <q>Document authors are encouraged to avoid "compatibility characters", as defined in section 6.8 of [Unicode @@ Unicode 2.0 @@] (see also D21 in section 3.6 of [Unicode3]).</q></li> |
|
|
</ul> |
|
|
|
|
|
<p>Character class <dfn id=class-ControlChar10><code>ControlChar10</code></dfn> |
|
|
contains the following characters:</p> |
|
|
<ul> |
|
|
<li><code class=char>U+007F</code> <code class=charname>DELETE</code> .. |
|
|
<code class=char>U+0084</code> <code class=charname>INDEX</code></li> |
|
|
<li><code class=char>U+0086</code> <code class=charname>START OF SELECTED |
|
|
AREA</code> .. <code class=char>U+009F</code> <code class=charname>APPLICATION |
|
|
PROGRAM COMMAND</code></li> |
|
|
<li><code class=char>U+FDD0</code> .. <code class=char>U+FDEF</code></li> |
|
|
<li><code class=char>U+1FFFE</code> .. <code class=char>U+1FFFF</code></li> |
|
|
<li><code class=char>U+2FFFE</code> .. <code class=char>U+2FFFF</code></li> |
|
|
<li><code class=char>U+3FFFE</code> .. <code class=char>U+3FFFF</code></li> |
|
|
<li><code class=char>U+4FFFE</code> .. <code class=char>U+4FFFF</code></li> |
|
|
<li><code class=char>U+5FFFE</code> .. <code class=char>U+5FFFF</code></li> |
|
|
<li><code class=char>U+6FFFE</code> .. <code class=char>U+6FFFF</code></li> |
|
|
<li><code class=char>U+7FFFE</code> .. <code class=char>U+7FFFF</code></li> |
|
|
<li><code class=char>U+8FFFE</code> .. <code class=char>U+8FFFF</code></li> |
|
|
<li><code class=char>U+9FFFE</code> .. <code class=char>U+9FFFF</code></li> |
|
|
<li><code class=char>U+AFFFE</code> .. <code class=char>U+AFFFF</code></li> |
|
|
<li><code class=char>U+BFFFE</code> .. <code class=char>U+BFFFF</code></li> |
|
|
<li><code class=char>U+CFFFE</code> .. <code class=char>U+CFFFF</code></li> |
|
|
<li><code class=char>U+DFFFE</code> .. <code class=char>U+DFFFF</code></li> |
|
|
<li><code class=char>U+EFFFE</code> .. <code class=char>U+EFFFF</code></li> |
|
|
<li><code class=char>U+FFFFE</code> .. <code class=char>U+FFFFF</code></li> |
|
|
<li><code class=char>U+10FFFE</code> .. <code class=char>U+10FFFF</code></li> |
|
|
</ul> |
|
|
<div class="note memo"> |
|
|
<p>This character class contains the characters listed in the Note in |
|
|
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#charsets">Section 2.2</a> |
|
|
of <abbr>XML</abbr> 1.0 |
|
|
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>, |
|
|
as amended by |
|
|
<a href="http://www.w3.org/XML/xml-V10-4e-errata#E02">errata</a>.</p> |
|
778 |
</div> |
</div> |
779 |
|
|
780 |
<p>The character class <dfn id=class-NameStartChar10><code>NameStartChar10</code></dfn> |
<div class=ed> |
781 |
contains the following characters:</p> |
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
782 |
<ul class=ed> |
</div> |
783 |
</ul> |
|
784 |
<div class="note memo"> |
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
785 |
<p>This character class contains all characters allowed as the first character |
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
786 |
of a string matching to the production rule |
read$B!>(Bonly.</p> |
787 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Name"><code>Name</code></a> |
|
788 |
of <abbr>XML</abbr> 1.0 |
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
789 |
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p> |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
790 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
791 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
792 |
|
associated to the attribute. No normalization, or lexical validation is |
793 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
794 |
|
...</span></p> |
795 |
|
|
796 |
</div> |
</div> |
797 |
|
|
798 |
<p>The character class <dfn id=class-NameChar10><code>NameChar10</code></dfn> |
<div class=section id=section-documenttypedefinition> |
799 |
contains the following characters:</p> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
800 |
<ul> |
|
801 |
<li>The characters in the character class |
<p>The <a href="#DocumentType"><code>DocumentType</code></a> nodes |
802 |
<a href="#class-NameStartChar10">NameStartChar10</a>.</li> |
<em class=rfc2119>MUST</em> also implement the |
803 |
<li class=ed></li> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
804 |
</ul> |
interface.</p> |
805 |
|
|
806 |
|
<p>An instance of the |
807 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
808 |
|
interface <em class=rfc2119>MUST</em> be able to be obtained by using |
809 |
|
binding$B!>(Bspecific casting methods on an instance of the |
810 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface (if such |
811 |
|
casting methods are available) or by using the method <code>getFeature</code> |
812 |
|
with parameter values |
813 |
|
<a href="#feature-XDoctype"><code>http://suika.fam.cx/www/2006/feature/XDoctype</code></a> |
814 |
|
and <a href="#feature-XDoctype-3.0"><code>3.0</code></a> respectively (if the |
815 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node supports the |
816 |
|
feature <code>Core</code> version <code>3.0</code> |
817 |
|
<span class=ed>[DOM3]</span>).</p> |
818 |
|
|
819 |
<div class="note memo"> |
<div class="note memo"> |
820 |
<p>This character class contains all characters allowed as the second |
<p>This interface is a separated interface from the |
821 |
character of a string matching to the production rule |
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
822 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Name"><code>Name</code></a> |
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
823 |
of <abbr>XML</abbr> 1.0 |
for the historical reason.</p> |
824 |
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p> |
|
825 |
</div> |
<p class=ed>Should the interface be merged with |
826 |
|
<a href="#DocumentType"><code>DocumentType</code></a>?</p> |
827 |
<p>The character class <dfn id=class-PubidChar><code>PubidChar</code></dfn> |
</div> |
828 |
contains the following characters:</p> |
|
829 |
<ul> |
<p>The |
830 |
<li><code class=char>U+0009</code> <code class=charname>CHARACTER |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
831 |
TABULATION</code></li> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
832 |
<li><code class=char>U+000A</code> <code class=charname>LINE FEED</code></li> |
<pre class=idl><code>interface <dfn id=DocumentTypeDefinition><code>DocumentTypeDefinition</code></dfn> { |
833 |
<li><code class=char>U+000D</code> <code class=charname>CARRIAGE |
readonly attribute NamedNodeMap <a href="#elementTypes">elementTypes</a>; |
834 |
RETURN</code></li> |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
835 |
<li><code class=char>U+0020</code> <code class=charname>SPACE</code></li> |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
836 |
<li><code class=char>U+0021</code> <code class=charname>EXCLAMATION MARK</code> |
|
837 |
(<code class=char>!</code>)</li> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
838 |
<li><code class=char>U+0023</code> <code class=charname>DOLLAR SIGN</code> |
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
839 |
(<code class=char>$</code>)</li> |
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
840 |
<li><code class=char>U+0024</code> <code class=charname>NUMBER SIGN</code> |
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
841 |
(<code class=char>#</code>)</li> |
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
842 |
<li><code class=char>U+0025</code> <code class=charname>PERCENT SIGN</code> |
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
843 |
(<code class=char>%</code>)</li> |
|
844 |
<li><code class=char>U+0027</code> <code class=charname>APOSTROPHE</code> |
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
845 |
(<code class=char>'</code>)</li> |
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
846 |
<li><code class=char>U+0028</code> <code class=charname>LEFT PARENTHESIS</code> |
raises (DOMException); |
847 |
(<code class=char>(</code>)</li> |
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
848 |
<li><code class=char>U+0029</code> <code class=charname>RIGHT |
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
849 |
PARENTHESIS</code> (<code class=char>)</code>)</li> |
raises (DOMException); |
850 |
<li><code class=char>U+002A</code> <code class=charname>ASTERISK</code> |
void <a href="#setNotationNode">setNotationNode</a> |
851 |
(<code class=char>*</code>)</li> |
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
852 |
<li><code class=char>U+002B</code> <code class=charname>PLUS SIGN</code> |
raises (DOMException); |
853 |
(<code class=char>+</code>)</li> |
}</code></pre> |
854 |
<li><code class=char>U+002C</code> <code class=charname>COMMA</code> |
|
855 |
(<code class=char>,</code>)</li> |
<dl> |
856 |
<li><code class=char>U+002D</code> <code class=charname>HYPHEN-MINUS</code> |
<dt><dfn id=elementTypes class=dom-attr><code>elementTypes</code></dfn> of |
857 |
(<code class=char>-</code>)</li> |
type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
858 |
<li><code class=char>U+002E</code> <code class=charname>FULL STOP</code> |
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
859 |
(<code class=char>.</code>)</li> |
contains all the element type definitions belonging to the |
860 |
<li><code class=char>U+002F</code> <code class=charname>SOLIDUS</code> |
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
861 |
(<code class=char>/</code>)</li> |
|
862 |
<li><code class=char>U+0030</code> <code class=charname>DIGIT ZERO</code> |
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
863 |
(<code class=char>0</code>) .. <code class=char>U+0039</code> |
<code>NamedNodeMap</code> object that contains all the |
864 |
<code class=charname>DIGIT NINE</code> (<code class=char>9</code>)</li> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
865 |
<li><code class=char>U+003A</code> <code class=charname>COLON</code> |
nodes belonging to the <code>DocumentType</code> node. The |
866 |
(<code class=char>:</code>)</li> |
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be read$B!>(Bonly |
867 |
<li><code class=char>U+003B</code> <code class=charname>SEMICOLON</code> |
if and only if the node is read$B!>(Bonly. The <code>NamedNodeMap</code> |
868 |
(<code class=char>;</code>)</li> |
object <em class=rfc2119>MUST</em> be <a href="#live">live</a>.</p> |
869 |
<li><code class=char>U+003D</code> <code class=charname>EQUAL SIGN</code> |
|
870 |
(<code class=char>=</code>)</li> |
<p>If the <code>DocumentType</code> node is created during the process |
871 |
<li><code class=char>U+003F</code> <code class=charname>QUESTION MARK</code> |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, the following |
872 |
(<code class=char>?</code>)</li> |
requirements are applied: The <code>NamedNodeMap</code> object in the |
873 |
<li><code class=char>U+0040</code> <code class=charname>COMMERCIAL AT</code> |
<a href="#elementTypes"><code>elementType</code></a> attribute |
874 |
(<code class=char>@</code>)</li> |
<em class=rfc2119>MUST</em> be so transformed that the object contains |
875 |
<li><code class=char>U+0041</code> <code class=charname>LATIN CAPITAL LETTER |
the <code>ElementTypeDefinition</code> nodes for the element types |
876 |
A</code> (<code class=char>A</code>) .. <code class=char>U+005A</code> |
whose name is presented as the <code>Name</code> of the element type or |
877 |
<code class=charname>LATIN CAPITAL LETTER Z</code> |
attribute definition list declarations processed by the <abbr>XML</abbr> |
878 |
(<code class=char>Z</code>)</li> |
processor. If there are more than one element type declarations for an |
879 |
<li><code class=char>U+005F</code> <code class=charname>LOW LINE</code> |
element type, then the declarations other than the first one |
880 |
(<code class=char>_</code>)</li> |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
881 |
<li><code class=char>U+0061</code> <code class=charname>LATIN CAPITAL LETTER |
<code>NamedNodeMap</code> object.</p></dd> |
882 |
A</code> (<code class=char>A</code>) .. <code class=char>U+007A</code> |
<dt><dfn id=generalEntities class=dom-attr><code>generalEntities</code></dfn> |
883 |
<code class=charname>LATIN CAPITAL LETTER Z</code> |
of type <code>NamedNodeMap</code>, read$B!>(Bonly</dt> |
884 |
(<code class=char>Z</code>)</li> |
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
885 |
</ul> |
contains all the general entities belonging to the |
886 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
887 |
|
|
888 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
889 |
|
same value as the <code>entities</code> attribute (defined in the |
890 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface) of the same |
891 |
|
node.</p> |
892 |
|
|
893 |
|
<div class="note memo"> |
894 |
|
<p>This attribute is part of the interface for historical reason.</p> |
895 |
|
</div></dd> |
896 |
|
<!-- |
897 |
|
All entities declared in the document type definition |
898 |
|
contained in or referenced from the document entity |
899 |
|
might not be exposed through this collection, depending |
900 |
|
on the information provided by the XML processor for |
901 |
|
the DOM implementation. In particular, it might not |
902 |
|
contain any entity if entity references are expanded |
903 |
|
at the parse time. An implementation [['''MUST NOT''']] |
904 |
|
expose an [CODE(DOMi)@en[[[Entity]]]] node whose [CODE(DOMa)@en[[[nodeName]]]] |
905 |
|
is equal to the name of one of five predefined general entities in |
906 |
|
XML through the collection as the result of parsing of an XML |
907 |
|
document that has no error. Duplicate entity declarations are also discarded. |
908 |
|
|
909 |
|
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
910 |
|
object that contains all the [CODE(DOMi)@en[[[Entity]]]] nodes |
911 |
|
representing general entities belong to the node. The returned |
912 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if |
913 |
|
the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
914 |
|
and therefore any change of read-only flag on the node is immediately |
915 |
|
reflected by that of the object. |
916 |
|
--> |
917 |
|
<dt><dfn id=notations class=dom-attr><code>notations</code></dfn> of type |
918 |
|
<code>notations</code>, read$B!>(Bonly</code> |
919 |
|
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
920 |
|
contains all the notations belonging to the |
921 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
922 |
|
|
923 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
924 |
|
same value as the <code>notations</code> attribute (defined in the |
925 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface) of the same |
926 |
|
node.</p> |
927 |
|
|
928 |
|
<div class="note memo"> |
929 |
|
<p>This attribute is part of the interface for historical reason.</p> |
930 |
|
<p>Implementations are not required to implement the |
931 |
|
<code>notations</code> attribute twice (for |
932 |
|
<a href="#DocumentType"><code>DocumentType</code></a> and |
933 |
|
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
934 |
|
interfaces); they share exactly same definition.</p> |
935 |
|
</div></dd> |
936 |
|
<!-- |
937 |
|
If the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] node is |
938 |
|
created from an XML document, duplicate notation declarations, if any, in DTD |
939 |
|
[['''MUST NOT''']] result in a node in the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
940 |
|
object and only the first declaration [['''MUST''']] be |
941 |
|
made available as a [CODE(DOMi)@en[[[Notation]]]] node. |
942 |
|
|
943 |
|
;; This definition is based on one for the |
944 |
|
[CODE(DOMa)@en[[[notations]]]] attribute of the |
945 |
|
[CODE(DOMi)@en[[[DocumentType]]]] interface in DOM XML module. |
946 |
|
Since duplication is violation to the Validity Constraint, |
947 |
|
XML parsers might vary on how notations are notified to |
948 |
|
the application. In particular, [CODE(InfoProp)@en[[[notations]]]] |
949 |
|
property of the document information item in XML Information Set |
950 |
|
is so defined that in case ''any'' notation is declared for |
951 |
|
multiple times then the property has no value. |
952 |
|
|
953 |
|
The attribute [['''MUST''']] return the [CODE(DOMi)@en[[[NamedNodeMap]]]] |
954 |
|
object that contains all the [CODE(DOMi)@en[[[Notation]]]] nodes |
955 |
|
representing notations belong to the node. The returned |
956 |
|
[CODE(DOMi)@en[[[NamedNodeMap]]]] object [['''MUST''']] be read-only if and only if |
957 |
|
the node is read-only. Note that the [CODE(DOMi)@en[[[NamedNodeMap]]]] object is live |
958 |
|
and therefore any change of read-only flag on the node is immediately |
959 |
|
reflected by that of the object. |
960 |
|
--> |
961 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
962 |
|
method</dt> |
963 |
|
<dd><p>Returns the |
964 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
965 |
|
with the specified name.</p> |
966 |
|
|
967 |
|
<p>The |
968 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
969 |
|
parameter is the name of the element type.</p> |
970 |
|
|
971 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
972 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
973 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
974 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
975 |
|
<code>NamedNodeMap</code> object in the |
976 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
977 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
978 |
|
<code>null</code>.</p></dd> |
979 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
980 |
|
method</dt> |
981 |
|
<dd><p>Returns the |
982 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
983 |
|
with the specified name.</p> |
984 |
|
|
985 |
|
<p>The |
986 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
987 |
|
parameter is the name of the element type.</p> |
988 |
|
|
989 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
990 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
991 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
992 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
993 |
|
<code>NamedNodeMap</code> object in the |
994 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
995 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
996 |
|
<code>null</code>.</p></dd> |
997 |
|
<dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>, |
998 |
|
method</dt> |
999 |
|
<dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node |
1000 |
|
with the specified name.</p> |
1001 |
|
|
1002 |
|
<p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn> |
1003 |
|
parameter is the name of the general entity.</p> |
1004 |
|
|
1005 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1006 |
|
<a href="#Entity"><code>Entity</code></a> node, |
1007 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
1008 |
|
<a href="#getEntityNode-name"><var>name</var></a>, in the |
1009 |
|
<code>NamedNodeMap</code> object in the |
1010 |
|
<a href="#entities"><code>entities</code></a> attribute of the |
1011 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
1012 |
|
<code>null</code>.</p></dd> |
1013 |
|
<dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>, |
1014 |
|
method</dt> |
1015 |
|
<dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node |
1016 |
|
with the specified name.</p> |
1017 |
|
|
1018 |
|
<p>The |
1019 |
|
<dfn id=getNotationNode-name class=dom-param><var>name</var></dfn> |
1020 |
|
parameter is the name of the notation.</p> |
1021 |
|
|
1022 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1023 |
|
<a href="#Notation"><code>Notation</code></a> node, |
1024 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
1025 |
|
<a href="#getNotationNode-name"><var>name</var></a>, in the |
1026 |
|
<code>NamedNodeMap</code> object in the |
1027 |
|
<a href="#notations"><code>notations</code></a> attribute of the |
1028 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
1029 |
|
<code>null</code>.</p></dd> |
1030 |
|
<dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>, |
1031 |
|
method</dt> |
1032 |
|
<dd class=ed>@@</dd> |
1033 |
|
<dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>, |
1034 |
|
method</dt> |
1035 |
|
<dd class=ed>@@</dd> |
1036 |
|
<dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>, |
1037 |
|
method</dt> |
1038 |
|
<dd class=ed>@@</dd> |
1039 |
|
</dl> |
1040 |
|
|
1041 |
|
<div class=ed> |
1042 |
|
<p>A future version of this interface might define the |
1043 |
|
<code>parameterEntities</code> and getter/setter for parameter entities. |
1044 |
|
</div> |
1045 |
|
|
1046 |
|
</div> |
1047 |
|
|
1048 |
|
<div class=section id=section-elementtypedefinition> |
1049 |
|
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
1050 |
|
|
1051 |
|
<p>The nodes of type |
1052 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
1053 |
|
represents an element type definition. Such a node |
1054 |
|
<em class=rfc2119>MUST</em> implement the |
1055 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1056 |
|
interface, which extends the <a href="#Node"><code>Node</code></a> |
1057 |
|
interface.</p> |
1058 |
|
|
1059 |
|
<p>An element type definition represents a definition of the element type. |
1060 |
|
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
1061 |
|
However, an |
1062 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1063 |
|
does not represent the element type definition in <abbr>DTD</abbr> itself. |
1064 |
|
Even if there are more than one element type declarations for an element type |
1065 |
|
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
1066 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1067 |
|
node for that element type. In addition, if there are attribute definition |
1068 |
|
declarations for an element type, even when there is no element type |
1069 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
1070 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1071 |
|
node for that element type.</p> |
1072 |
|
|
1073 |
|
<p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1074 |
|
node cannot be a child of any node. An |
1075 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1076 |
|
cannot have any child node.</p> |
1077 |
|
|
1078 |
|
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1079 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1080 |
|
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1081 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1082 |
|
|
1083 |
|
readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>; |
1084 |
|
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a> |
1085 |
|
(in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>); |
1086 |
|
void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a> |
1087 |
|
(in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>) |
1088 |
|
raises (DOMException); |
1089 |
|
}</code></pre> |
1090 |
|
|
1091 |
|
<dl> |
1092 |
|
<dt><dfn id=ownerDocumentTypeDefinition class=dom-attr><code>ownerDocumentTypeDefinition</code></dfn> |
1093 |
|
of type <a href="#DocumentType"><code>DocumentType</code></a>, read$B!>(Bonly</dt> |
1094 |
|
<dd><p>The |
1095 |
|
<a href="#ownerDocumentTypeDefinition"><code>ownerDocumentTypeDefinition</code></a> |
1096 |
|
attribute of |
1097 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1098 |
|
<a href="#Entity"><code>Entity</code></a>, and |
1099 |
|
<a href="#Notation"><code>Notation</code></a> interface contains the |
1100 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node to which the node |
1101 |
|
is attached.</p> |
1102 |
|
|
1103 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return a |
1104 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node. It |
1105 |
|
<em class=rfc2119>MUST</em> be such a node that whose |
1106 |
|
<a href="#elementTypes"><code>elementTypes</code></a> (for an |
1107 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1108 |
|
node), <a href="#entities"><code>entities</code></a> (for an |
1109 |
|
<a href="#Entity"><code>Entity</code></a> node), or |
1110 |
|
<a href="#notations"><code>notations</code></a> (for a |
1111 |
|
<a href="#Notation"><code>Notation</code></a> node) attribute contains the |
1112 |
|
<code>NamedNodeMap</code> object that contains the node. If there is no such |
1113 |
|
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
1114 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
1115 |
|
<dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn> |
1116 |
|
of type NamedNodeMap, read$B!>(Bonly</dt> |
1117 |
|
<dd><p>A <a href="#live">live</a> <code>NamedNodeMap</code> object that |
1118 |
|
contains all the attribute definitions belonging to the |
1119 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1120 |
|
node.</p> |
1121 |
|
|
1122 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1123 |
|
<code>NamedNodeMap</code> object that contains all the |
1124 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1125 |
|
belonging to the |
1126 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1127 |
|
The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1128 |
|
read$B!>(Bonly if and only if the node is read$B!>(Bonly. The |
1129 |
|
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1130 |
|
<a href="#live">live</a>.</p> |
1131 |
|
|
1132 |
|
<p>If the |
1133 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1134 |
|
is created during the process to create a <abbr>DOM</abbr> from an |
1135 |
|
<abbr>XML</abbr> document, the following requirements are applied: The |
1136 |
|
<code>NamedNodeMap</code> object in the |
1137 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1138 |
|
attribute <em class=rfc2119>MUST</em> be so transformed that the object |
1139 |
|
contains the |
1140 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1141 |
|
corresponding to the attribute definitions in the attribute definition |
1142 |
|
list declarations processed by the <abbr>XML</abbr> processor and |
1143 |
|
associated to the element type represented by the node. If there are more |
1144 |
|
than one attribute definitions for an attribute, then the definitions other |
1145 |
|
than the first one <em class=rfc2119>MUST</em> be ignored for the purpose |
1146 |
|
of constructing the <code>NamedNodeMap</code> object.</p></dd> |
1147 |
|
<dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>, |
1148 |
|
method</dt> |
1149 |
|
<dd><p>Return the |
1150 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1151 |
|
with the specified name.</p> |
1152 |
|
|
1153 |
|
<p>The |
1154 |
|
<dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn> |
1155 |
|
parameter is the name of the attribute.</p> |
1156 |
|
|
1157 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1158 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
1159 |
|
whose <a href="#nodeName"><code>nodeName</code></a> attribute value is |
1160 |
|
equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>, |
1161 |
|
in the <code>NamedNodeMap</code> in the |
1162 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1163 |
|
attribute of the node. If there is no such node, it |
1164 |
|
<em class=rfc2119>MUST</em> return <code>null</code>.</p></dd> |
1165 |
|
<dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>, |
1166 |
|
method</dt> |
1167 |
|
<dd class=ed>@@</dd> |
1168 |
|
</dl> |
1169 |
|
|
1170 |
|
<div class=ed> |
1171 |
|
<p>A future version of the specification might define a set of attributes |
1172 |
|
and methods for representing and accessing to the content model of the |
1173 |
|
element type.</p> |
1174 |
|
</div> |
1175 |
|
</div> |
1176 |
|
|
1177 |
|
<div class=section id=section-attributedefinition> |
1178 |
|
<h3>The <code>AttributeDefinition</code> Interface</h3> |
1179 |
|
|
1180 |
|
<p>The nodes of type |
1181 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
1182 |
|
represents an attribute definition. Such a node |
1183 |
|
<em class=rfc2119>MUST</em> implement the |
1184 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
1185 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
1186 |
|
|
1187 |
|
<p>An attribute definition represents a definition of the attribute |
1188 |
|
associated to an element type. It is corresponding to the attribute definition |
1189 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
1190 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
1191 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
1192 |
|
there are more than one attribute definitions for an attribute of an element |
1193 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
1194 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
1195 |
|
that attribute.</p> |
1196 |
|
|
1197 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1198 |
|
node cannot be a child of any node. An |
1199 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1200 |
|
can have zero or more child nodes of same kinds as those allowed for |
1201 |
|
<code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p> |
1202 |
|
|
1203 |
|
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1204 |
|
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1205 |
|
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1206 |
|
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
1207 |
|
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
1208 |
|
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
1209 |
|
const unsigned short <a href="#ID_ATTR">ID_ATTR</a> = 2; |
1210 |
|
const unsigned short <a href="#IDREF_ATTR">IDREF_ATTR</a> = 3; |
1211 |
|
const unsigned short <a href="#IDREFS_ATTR">IDREFS_ATTR</a> = 4; |
1212 |
|
const unsigned short <a href="#ENTITY_ATTR">ENTITY_ATTR</a> = 5; |
1213 |
|
const unsigned short <a href="#ENTITIES_ATTR">ENTITIES_ATTR</a> = 6; |
1214 |
|
const unsigned short <a href="#NMTOKEN_ATTR">NMTOKEN_ATTR</a> = 7; |
1215 |
|
const unsigned short <a href="#NMTOKENS_ATTR">NMTOKENS_ATTR</a> = 8; |
1216 |
|
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
1217 |
|
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
1218 |
|
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
1219 |
|
|
1220 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
1221 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
1222 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
1223 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
1224 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
1225 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
1226 |
|
|
1227 |
|
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
1228 |
|
|
1229 |
|
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
1230 |
|
readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>; |
1231 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
1232 |
|
}</code></pre> |
1233 |
|
|
1234 |
|
<dl> |
1235 |
|
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
1236 |
|
of type |
1237 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
1238 |
|
read$B!>(Bonly</dt> |
1239 |
|
<dd><p>The |
1240 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
1241 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1242 |
|
node belongs.</p> |
1243 |
|
|
1244 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
1245 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1246 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
1247 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
1248 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
1249 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1250 |
|
node. If there is no such an |
1251 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
1252 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
1253 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
1254 |
|
<code>unsigned short</code></dt> |
1255 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
1256 |
|
It is expected that this attribute contains a value from the definition group |
1257 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
1258 |
|
|
1259 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1260 |
|
value associated to this attribute.</p> |
1261 |
|
|
1262 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1263 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1264 |
|
exception if the |
1265 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1266 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1267 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1268 |
|
associated to this attribute.</p> |
1269 |
|
|
1270 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
1271 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
1272 |
|
appropriate value from the |
1273 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
1274 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1275 |
|
|
1276 |
|
<!-- DeclaredValueType --> |
1277 |
|
<p>The definition group |
1278 |
|
<dfn id=DeclaredValueType><code>DeclaredValueType</code></dfn> contains |
1279 |
|
integers indicating the declared type of attributes. The definition |
1280 |
|
group contains the following constants:</p> |
1281 |
|
|
1282 |
|
<table> |
1283 |
|
<thead> |
1284 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1285 |
|
</thead> |
1286 |
|
<tbody> |
1287 |
|
<tr> |
1288 |
|
<th scope=row><dfn id=NO_TYPE_ATTR class=dom-const><code>NO_TYPE_ATTR</code> |
1289 |
|
<td><code>0</code><td>No value <span class=ed>[INFOSET]</span>.</tr> |
1290 |
|
<tr> |
1291 |
|
<th scope=row><dfn id=CDATA_ATTR class=dom-const><code>CDATA_ATTR</code> |
1292 |
|
<td><code>1</code><td><code>CDATA</code> <span class=ed>[XML]</span>.</tr> |
1293 |
|
<tr> |
1294 |
|
<th scope=row><dfn id=ID_ATTR class=dom-const><code>ID_ATTR</code> |
1295 |
|
<td><code>2</code><td><code>ID</code> <span class=ed>[XML]</span>.</tr> |
1296 |
|
<tr> |
1297 |
|
<th scope=row><dfn id=IDREF_ATTR class=dom-const><code>IDREF_ATTR</code> |
1298 |
|
<td><code>3</code><td><code>IDREF</code> <span class=ed>[XML]</span>.</tr> |
1299 |
|
<tr> |
1300 |
|
<th scope=row><dfn id=IDREFS_ATTR class=dom-const><code>IDREFS_ATTR</code> |
1301 |
|
<td><code>4</code><td><code>IDREFS</code> <span class=ed>[XML]</span>.</tr> |
1302 |
|
<tr> |
1303 |
|
<th scope=row><dfn id=ENTITY_ATTR class=dom-const><code>ENTITY_ATTR</code> |
1304 |
|
<td><code>5</code><td><code>ENTITY</code> <span class=ed>[XML]</span>.</tr> |
1305 |
|
<tr> |
1306 |
|
<th scope=row><dfn id=ENTITIES_ATTR class=dom-const><code>ENTITIES_ATTR</code> |
1307 |
|
<td><code>6</code><td><code>ENTITIES</code> <span class=ed>[XML]</span>.</tr> |
1308 |
|
<tr> |
1309 |
|
<th scope=row><dfn id=NMTOKEN_ATTR class=dom-const><code>NMTOKEN_ATTR</code> |
1310 |
|
<td><code>7</code><td><code>NMTOKEN</code> <span class=ed>[XML]</span>.</tr> |
1311 |
|
<tr> |
1312 |
|
<th scope=row><dfn id=NMTOKENS_ATTR class=dom-const><code>NMTOKENS_ATTR</code> |
1313 |
|
<td><code>8</code><td><code>NMTOKENS</code> <span class=ed>[XML]</span>.</tr> |
1314 |
|
<tr> |
1315 |
|
<th scope=row><dfn id=NOTATION_ATTR class=dom-const><code>NOTATION_ATTR</code> |
1316 |
|
<td><code>9</code><td><code>NOTATION</code> <span class=ed>[XML]</span>.</tr> |
1317 |
|
<tr> |
1318 |
|
<th scope=row><dfn id=ENUMERATION_ATTR class=dom-const><code>ENUMERATION_ATTR</code> |
1319 |
|
<td><code>10</code><td>Enumeration <span class=ed>[XML]</span>.</tr> |
1320 |
|
<tr> |
1321 |
|
<th scope=row><dfn id=UNKNOWN_ATTR class=dom-const><code>UNKNOWN_ATTR</code> |
1322 |
|
<td><code>11</code><td>Unknown, because no declaration for the attribute |
1323 |
|
has been read but the [all declaration processed] property |
1324 |
|
<span class=ed>[INFOSET]</span> would be false.</tr> |
1325 |
|
</tbody> |
1326 |
|
</table> |
1327 |
|
|
1328 |
|
<p>If no attribute type information is available, or if the source |
1329 |
|
of the information does not distinguish <q>no value</q> and <q>unknown</q> |
1330 |
|
<span class=ed>[INFOSET]</span>, then the value |
1331 |
|
<a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a> |
1332 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1333 |
|
|
1334 |
<div class="note memo"> |
<div class="note memo"> |
1335 |
<p>This character class contains all characters allowed in the production rule |
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1336 |
<a href="http://www.w3.org/TR/2006/REC-xml-20060816/#NT-PubidChar"><code>PubidChar</code></a> |
created by the |
1337 |
of <abbr>XML</abbr> 1.0 |
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1338 |
<cite class="bibref normative">[<a href="#ref-XML10">XML10</a>]</cite>.</p> |
method has its <a href="#declaredType"><code>declaredType</code></a> attribute |
1339 |
|
set to <a href="#NO_TYPE_ATTR"><code>NO_TYPE_ATTR</code></a>.</p> |
1340 |
|
</div> |
1341 |
|
|
1342 |
|
<p>If the source of the information does not distinguish <q>no value</q> |
1343 |
|
and/or <q>unknown</q> <span class=ed>[INFOSET]</span> and |
1344 |
|
<code>CDATA</code> <span class=ed>[XML]</span>, then the value |
1345 |
|
<a href="#CDATA_ATTR"><code>CDATA_ATTR</code></a> <em class=rfc2119>MUST</em> |
1346 |
|
be used.</p> |
1347 |
|
|
1348 |
|
<p>In Perl binding <span class=ed>[PERLBINDING]</span>, the |
1349 |
|
<code>Attr</code> nodes <em class=rfc2119>MUST</em> implement the |
1350 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> |
1351 |
|
definition group.</p> |
1352 |
|
|
1353 |
|
</dd> |
1354 |
|
<dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of |
1355 |
|
type <code>DOMStringList</code>, read$B!>(Bonly</dt> |
1356 |
|
<dd><p>The list of allowed attribute values.</p> |
1357 |
|
|
1358 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1359 |
|
<code>DOMStringList</code> object associated to this attribute. The object |
1360 |
|
<em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of |
1361 |
|
zero or more characters respectively, possibly with duplications. The |
1362 |
|
object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node |
1363 |
|
is read$B!>(Bonly.</p> |
1364 |
|
|
1365 |
|
<p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1366 |
|
node is created during the process to create a <abbr>DOM</abbr> from an |
1367 |
|
<abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain |
1368 |
|
the names or name tokens allowed for the attribute defined by the node. |
1369 |
|
If the document is well$B!>(Bformed, the object will be empty unless |
1370 |
|
the <a href="#declaredType"><code>declaredType</code></a> is |
1371 |
|
<a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1372 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p> |
1373 |
|
|
1374 |
|
<p>If the <a href="#declaredType"><code>declaredType</code></a> is different |
1375 |
|
from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1376 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute |
1377 |
|
<em class=rfc2119>MUST</em> be ignored for the purpose of serializing |
1378 |
|
into (part of) <abbr>XML</abbr> document.</p> |
1379 |
|
|
1380 |
|
<div class="note memo"> |
1381 |
|
<p>When serializing the node it should be noted that the object might |
1382 |
|
be empty, might contain duplications, and might contain strings that are |
1383 |
|
not names or name tokens.</p> |
1384 |
|
</div></dd> |
1385 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1386 |
|
type <code>unsigned short</code></dt> |
1387 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
1388 |
|
attribute contains a value from the definition group |
1389 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
1390 |
|
|
1391 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1392 |
|
the value associated to this attribute.</p> |
1393 |
|
|
1394 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1395 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1396 |
|
exception if the |
1397 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1398 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
1399 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
1400 |
|
associated to this attribute.</p> |
1401 |
|
|
1402 |
|
<p>If the |
1403 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
1404 |
|
created during the process to create a <abbr>DOM</abbr> from an |
1405 |
|
<abbr>XML</abbr> document, an appropriate value from the |
1406 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
1407 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
1408 |
|
|
1409 |
|
<!-- DefaultValueType --> |
1410 |
|
<p>The definition group |
1411 |
|
<dfn id=DefaultValueType><code>DefaultValueType</code></dfn> |
1412 |
|
contains integers indicating the type of the default for the attribute. |
1413 |
|
The definition group contains the following constans:</p> |
1414 |
|
|
1415 |
|
<table> |
1416 |
|
<thead> |
1417 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
1418 |
|
</thead> |
1419 |
|
<tbody> |
1420 |
|
<tr> |
1421 |
|
<th scope=row><dfn id=UNKNOWN_DEFAULT class=dom-const><code>UNKNOWN_DEFAULT</code></dfn> |
1422 |
|
<td><code>0</code><td>Unknown.</tr> |
1423 |
|
<tr> |
1424 |
|
<th scope=row><dfn id=FIXED_DEFAULT class=dom-const><code>FIXED_DEFAULT</code></dfn> |
1425 |
|
<td><code>1</code><td>Provided explicitly and fixed |
1426 |
|
<span class=ed>@@ ref</span> to that value.</tr> |
1427 |
|
<tr> |
1428 |
|
<th scope=row><dfn id=REQUIRED_DEFAULT class=dom-const><code>REQUIRED_DEFAULT</code></dfn> |
1429 |
|
<td><code>2</code><td>No default value and the attribute have to be |
1430 |
|
explicitly specified.</tr> |
1431 |
|
<tr> |
1432 |
|
<th scope=row><dfn id=IMPLIED_DEFAULT class=dom-const><code>IMPLIED_DEFAULT</code></dfn> |
1433 |
|
<td><code>3</code><td>Implied <span class=ed>@@ ref</span>.</tr> |
1434 |
|
<tr> |
1435 |
|
<th scope=row><dfn id=EXPLICIT_DEFAULT class=dom-const><code>EXPLICIT_DEFAULT</code></dfn> |
1436 |
|
<td><code>4</code><td>Provided explicitly.</tr> |
1437 |
|
</tbody> |
1438 |
|
</table> |
1439 |
|
|
1440 |
|
<p>If the source of the default type does not distinguish |
1441 |
|
implied and unknown default types, then the value |
1442 |
|
<a href="#IMPLIED_DEFAULT"><code>IMPLIED_DEFAULT</code></a> |
1443 |
|
<em class=rfc2119>MUST</em> be used.</p> |
1444 |
|
|
1445 |
|
<div class="note memo"> |
1446 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1447 |
|
node created by the |
1448 |
|
<a href="#createAttributeDefinition"><code>createAttributeDefinition</code></a> |
1449 |
|
method has its <a href="#defaultType"><code>defaultType</code></a> |
1450 |
|
attribute set to |
1451 |
|
<a href="#UNKNOWN_DEFAULT"><code>UNKNOWN_DEFAULT</code></a>.</p> |
1452 |
|
</div></dd> |
1453 |
|
</dl> |
1454 |
|
|
1455 |
|
</div> |
1456 |
|
|
1457 |
|
<div class=section id=section-entity> |
1458 |
|
<h3>Modifications to the <code id=Entity>Entity</code> Interface</h3> |
1459 |
|
|
1460 |
|
<p>The implementation of the <a href="#Entity"><code>Entity</code></a> |
1461 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1462 |
|
<pre class=idl><code>// Modifications to the Entity interface |
1463 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1464 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1465 |
|
attribute DOMString <a href="#notationName">notationName</a>; |
1466 |
|
|
1467 |
|
// Additions to the Entity interface |
1468 |
|
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
1469 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1470 |
|
|
1471 |
|
attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>; |
1472 |
|
</code></pre> |
1473 |
|
|
1474 |
|
<p>The <code id=notationName>notationName</code> attribute of the |
1475 |
|
<a href="#Entity"><code>Entity</code></a> interface is no longer |
1476 |
|
read$B!>(Bonly.</p> |
1477 |
|
|
1478 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1479 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1480 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1481 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
1482 |
|
associated to the attribute. No lexical validation is performed. The new |
1483 |
|
value <em class=rfc2119>MAY</em> be <code>null</code>.</p> |
1484 |
|
|
1485 |
|
<dl> |
1486 |
|
<dt><dfn id=hasReplacementTree class=dom-attr><code>hasReplacementTree</code></dfn> |
1487 |
|
of type boolean</dt> |
1488 |
|
<dd><p>Whether the structure of the replacement text of the entity |
1489 |
|
is available via the <code>NodeList</code> object in the |
1490 |
|
<code>childNodes</code> attribute of the entity.</p> |
1491 |
|
|
1492 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1493 |
|
the value associated to this attribute.</p> |
1494 |
|
|
1495 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1496 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1497 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1498 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1499 |
|
value associated to this attribute.</p> |
1500 |
|
|
1501 |
|
<div class="note memo"> |
1502 |
|
<p>The attribute can be set to <code>false</code> even if the |
1503 |
|
<a href="#Entity"><code>Entity</code></a> node has any child node. |
1504 |
|
If the attribute is set to <code>false</code>, then any child node of |
1505 |
|
the <a href="#Entity"><code>Entity</code></a> node ought to be ignored, |
1506 |
|
say, for the purpose of serialization.</p> |
1507 |
|
</div> |
1508 |
|
|
1509 |
|
<p>When an <code>EntityReference</code> node is created by cloning |
1510 |
|
the replacement subtree of the <a href="#Entity"><code>Entity</code></a> |
1511 |
|
node, if the attribute is set to <code>false</code>, then any descendant |
1512 |
|
of the node <em class=rfc2119>MUST</em> be ignored.</p> |
1513 |
|
|
1514 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1515 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1516 |
|
the following requirements are applied: If the entity is an unparsed |
1517 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1518 |
|
<code>false</code>. Otherwise, if the entity is an external entity whose |
1519 |
|
replacement text is not available, or whose replacement text is not converted |
1520 |
|
to a replacement tree, then the attribute <em class=rfc2119>MUST</em> be set |
1521 |
|
to <code>false</code>. Otherwise, the attribute |
1522 |
|
<em class=rfc2119>MUST</em> be set to <code>true</code>.</p> |
1523 |
|
|
1524 |
|
<div class="note memo"> |
1525 |
|
<p>An <a href="#Entity"><code>Entity</code></a> node created by the |
1526 |
|
<a href="#createGeneralEntity"><code>createGeneralEntity</code></a> method |
1527 |
|
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
1528 |
|
attribute set to <code>false</code>.</p> |
1529 |
|
</div></dd> |
1530 |
|
<dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn> |
1531 |
|
of type boolean</dt> |
1532 |
|
<dd><p>Whether the entity is declared by an external entity declaration or |
1533 |
|
not. If the value is <code>true</code>, the entity is declared in an entity |
1534 |
|
declaration in the external subset entity or in an external parameter entity. |
1535 |
|
If the value is <code>false</code>, the entity is declared in an entity |
1536 |
|
declaration in the internal subset, or the node is created in memory.</p> |
1537 |
|
|
1538 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1539 |
|
the value associated to this attribute.</p> |
1540 |
|
|
1541 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1542 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1543 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1544 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1545 |
|
value associated to this attribute.</p> |
1546 |
|
|
1547 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1548 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1549 |
|
the following requirements are applied: If the entity is an unparsed |
1550 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1551 |
|
<code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the |
1552 |
|
attribute <em class=rfc2119>MUST</em> be set to the value of whether the |
1553 |
|
entity is declared by an external markup declaration or not.</p></dd> |
1554 |
|
</dl> |
1555 |
|
</div> |
1556 |
|
|
1557 |
|
<div class=section id=section-notation> |
1558 |
|
<h3>Modifications to the <code id=Notation>Notation</code> Interface</h3> |
1559 |
|
|
1560 |
|
<p>The implementation of the <a href="#Notation"><code>Notation</code></a> |
1561 |
|
interface <em class=rfc2119>MUST</em> be modified as following:</p> |
1562 |
|
<pre class=idl><code>// Modifications to the Notation interface |
1563 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
1564 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
1565 |
|
|
1566 |
|
// Addition to the Notation interface |
1567 |
|
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1568 |
|
</code></pre> |
1569 |
</div> |
</div> |
1570 |
|
|
1571 |
</div> |
</div> |