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