| 125 |
interface.</p> |
interface.</p> |
| 126 |
|
|
| 127 |
<p class=ed>@@ ref to DOM Binding Spec</p> |
<p class=ed>@@ ref to DOM Binding Spec</p> |
| 128 |
|
|
| 129 |
|
<p>If the <code>strictErrorChecking</code> attribute of the |
| 130 |
|
<code>Document</code> node is <code>false</code>, the methods are |
| 131 |
|
not required to raise exceptions <span class=ed>[DOM3]</span>.</p> |
| 132 |
</div> |
</div> |
| 133 |
|
|
| 134 |
<div class=section id=dom-dtdef> |
<div class=section id=dom-dtdef> |
| 143 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
| 144 |
</ul> |
</ul> |
| 145 |
|
|
| 146 |
<p>In addition, it adds methods, attributes, and/or constants to interfaces |
<p>In addition, it modifies interfaces |
| 147 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
| 148 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
| 149 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Entity"><code>Entity</code></a>, |
| 150 |
<a href="#EntityReference"><code>EntityReference</code></a>, and |
<a href="#EntityReference"><code>EntityReference</code></a>, |
| 151 |
<a href="#Notation"><code>Notation</code></a>. |
<a href="#Notation"><code>Notation</code></a>, and |
| 152 |
It modifies semantics of some of methods and attributes in |
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>.</p> |
|
<a href="#Node"><code>Node</code></a> and |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
|
|
interfaces, for the support of new interfaces.</p> |
|
| 153 |
|
|
| 154 |
<div class=section id=features> |
<div class=section id=features> |
| 155 |
<h3>Feature Name</h3> |
<h3>Feature Name</h3> |
| 174 |
aforementioned cases.</p> |
aforementioned cases.</p> |
| 175 |
</div> |
</div> |
| 176 |
|
|
| 177 |
|
<div class=section id=section-node> |
| 178 |
|
<h3>Modifications to the <code id=Node>Node</code> Interface</h3> |
| 179 |
|
|
| 180 |
|
<pre class=idl><code>// Additions to the Node interface |
| 181 |
|
|
| 182 |
|
// Additions to the NodeType definition group |
| 183 |
|
const unsigned short <a href="#ELEMENT_TYPE_DEFINITION_NODE">ELEMENT_TYPE_DEFINITION_NODE</a> = 81001; |
| 184 |
|
const unsigned short <a href="#ATTRIBUTE_DEFINITION_NODE">ATTRIBUTE_DEFINITION_NODE</a> = 81002; |
| 185 |
|
</pre> |
| 186 |
|
|
| 187 |
|
<p>This specification adds two new types (subinterfaces) of |
| 188 |
|
<a href="#Node"><code>Node</code></a>: element type definition (node type |
| 189 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a>, |
| 190 |
|
interface |
| 191 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) and |
| 192 |
|
attribute definition (node type |
| 193 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a>, |
| 194 |
|
interface |
| 195 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>). For |
| 196 |
|
these kinds of nodes, methods and attributes in the |
| 197 |
|
<a href="#Node"><code>Node</code></a> interface must behave as following:</p> |
| 198 |
|
|
| 199 |
|
<dl> |
| 200 |
|
<dt><code id=nodeType>nodeType</code></dt> |
| 201 |
|
<dd> |
| 202 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
| 203 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
| 204 |
|
(if the node is an |
| 205 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>) or |
| 206 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
| 207 |
|
(if the node is an |
| 208 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>).</p> |
| 209 |
|
|
| 210 |
|
<!-- NodeType --> |
| 211 |
|
<p>Two constants are added to the <code id=NodeType>NodeType</code> |
| 212 |
|
definition group of the <a href="#Node"><code>Node</code></a> interface as |
| 213 |
|
following:</p> |
| 214 |
|
<table> |
| 215 |
|
<thead> |
| 216 |
|
<tr><th scope=col>Name<th scope=col>Value<th scope=col>Description</tr> |
| 217 |
|
</thead> |
| 218 |
|
<tbody> |
| 219 |
|
<tr> |
| 220 |
|
<th scope=row><dfn id=ELEMENT_TYPE_DEFINITION_NODE class=dom-const><code>ELEMENT_TYPE_DEFINITION_NODE</code></dfn> |
| 221 |
|
<td><code>81001</code><td>The node is an |
| 222 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>.</tr> |
| 223 |
|
<tr> |
| 224 |
|
<th scope=row><dfn id=ATTRIBUTE_DEFINITION_NODE class=dom-const><code>ATTRIBUTE_DEFINITION_NODE</code></dfn> |
| 225 |
|
<td><code>81002</code><td>The node is an |
| 226 |
|
<a href="#ElementTypeDefinition"><code>AttributeDefinition</code></a>.</tr> |
| 227 |
|
</tbody> |
| 228 |
|
</table> |
| 229 |
|
</dd> |
| 230 |
|
<dt class=ed>@@ ...</dt> |
| 231 |
|
</dl> |
| 232 |
|
|
| 233 |
|
</div> |
| 234 |
|
|
| 235 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
| 236 |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
| 237 |
|
|
| 239 |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
DocumentType <a href="#createDocumentTypeDefinition">createDocumentTypeDefinition</a> |
| 240 |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createDocumentTypeDefinition-name"><var>name</var></a>) |
| 241 |
raises (DOMException); |
raises (DOMException); |
| 242 |
ElementTypeDefinition <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#createElementTypeDefinition">createElementTypeDefinition</a> |
| 243 |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createElementTypeDefinition-name"><var>name</var></a>) |
| 244 |
raises (DOMException); |
raises (DOMException); |
| 245 |
AttributeDefinition <a href="#createAttributeDefinition">createAttributeDefinition</a> |
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#createAttributeDefinition">createAttributeDefinition</a> |
| 246 |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
(in DOMString <a href="#createAttributeDefinition-name"><var>name</var></a>) |
| 247 |
raises (DOMException); |
raises (DOMException); |
| 248 |
Entity <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
<a href="#Entity">Entity</a> <a href="#createGeneralEntity">createGeneralEntityDefinition</a> |
| 249 |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
(in DOMString <a href="#createGeneralEntity-name"><var>name</var></a>) |
| 250 |
raises (DOMException); |
raises (DOMException); |
| 251 |
Notation <a href="#createNotation">createNotation</a> |
<a href="#Notation">Notation</a> <a href="#createNotation">createNotation</a> |
| 252 |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
(in DOMString <a href="#createNotation-name"><var>name</var></a>) |
| 253 |
raises (DOMException); |
raises (DOMException); |
| 254 |
}</code></pre> |
}</code></pre> |
| 459 |
define it for <code>Document</code> methods.</p> |
define it for <code>Document</code> methods.</p> |
| 460 |
|
|
| 461 |
<p><var>name</var> does not have to be a namespace qualified name.</p> |
<p><var>name</var> does not have to be a namespace qualified name.</p> |
|
|
|
|
<p>If the <code>strictErrorChecking</code> attribute of the |
|
|
<code>Document</code> node is <code>false</code>, the methods are |
|
|
not required to raise the exception <span class=ed>[DOM3]</span>.</p> |
|
| 462 |
</div> |
</div> |
| 463 |
|
|
| 464 |
</div> |
</div> |
| 471 |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
readonly attribute NamedNodeMap <a href="#generalEntities">generalEntities</a>; |
| 472 |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
readonly attribute NamedNodeMap <a href="#notations">notations</a>; |
| 473 |
|
|
| 474 |
<span class=ed>more members come here...</span> |
<a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#getElementTypeDefinitionNode">getElementTypeDefinitionNode</a> |
| 475 |
|
(in DOMString <a href="#getElementTypeDefinitionNode-name"><var>name</var></a>); |
| 476 |
|
<a href="#Entity">Entity</a> <a href="#getGeneralEntityNode">getGeneralEntityNode</a> |
| 477 |
|
(in DOMString <a href="#getGeneralEntityNode-name"><var>name</var></a>); |
| 478 |
|
<a href="#Notation">Notation</a> <a href="#getNotationNode">getNotationNode</a> |
| 479 |
|
(in DOMString <a href="#getNotationNode-name"><var>name</var></a>); |
| 480 |
|
|
| 481 |
|
void <a href="#setElementTypeDefinitionNode">setElementTypeDefinitionNode</a> |
| 482 |
|
(in DOMString <a href="#setElementTypeDefinitionNode-node"><var>node</var></a>) |
| 483 |
|
raises (DOMException); |
| 484 |
|
void <a href="#setGeneralEntityNode">setGeneralEntityNode</a> |
| 485 |
|
(in DOMString <a href="#setGeneralEntityNode-node"><var>node</var></a>) |
| 486 |
|
raises (DOMException); |
| 487 |
|
void <a href="#setNotationNode">setNotationNode</a> |
| 488 |
|
(in DOMString <a href="#setNotationNode-node"><var>node</var></a>) |
| 489 |
|
raises (DOMException); |
| 490 |
}</code></pre> |
}</code></pre> |
| 491 |
|
|
| 492 |
<pre class=ed> |
<pre class=ed> |
| 862 |
<em class=rfc2119>MUST</em> set the specified value as the value |
<em class=rfc2119>MUST</em> set the specified value as the value |
| 863 |
associated to this attribute.</p> |
associated to this attribute.</p> |
| 864 |
|
|
| 865 |
<p>If the <code>AttributeDefinition</code> node is created during the process |
<p>If the |
| 866 |
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node is |
| 867 |
appropriate value from the |
created during the process to create a <abbr>DOM</abbr> from an |
| 868 |
|
<abbr>XML</abbr> document, an appropriate value from the |
| 869 |
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
<a href="#DefaultValueType"><code>DefaultValueType</code></a> definition |
| 870 |
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
group <em class=rfc2119>MUST</em> be set to the attribute.</p> |
| 871 |
|
|
| 917 |
|
|
| 918 |
</div> |
</div> |
| 919 |
|
|
| 920 |
|
<div class=section id=section-documenttype> |
| 921 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
| 922 |
|
Interface</h3> |
| 923 |
|
|
| 924 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
| 925 |
|
<em class=rfc2119>MAY</em> contain zero or more |
| 926 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
| 927 |
|
nodes in the <code>NodeList</code> object contained in the |
| 928 |
|
<code>childNodes</code> attribute of the |
| 929 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
| 930 |
|
|
| 931 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
| 932 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
| 933 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
| 934 |
|
object <em class=rfc2119>MUST</em> contains the |
| 935 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
| 936 |
|
nodes representing the processing instructions in the document type |
| 937 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
| 938 |
|
the <abbr>XML</abbr> processor. If the |
| 939 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
| 940 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
| 941 |
|
also be marked as read$B!>(Bonly.</p> |
| 942 |
|
|
| 943 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
| 944 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
| 945 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
| 946 |
|
of the node <em class=rfc2119>MUST</em> contain the |
| 947 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
| 948 |
|
created from the processing instruction information items in the list in the |
| 949 |
|
[children] property of the document type declaration item in the same |
| 950 |
|
order.</p> |
| 951 |
|
|
| 952 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
| 953 |
|
a document type declaration information item, the list in the [children] |
| 954 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
| 955 |
|
information items created from the |
| 956 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
| 957 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
| 958 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
| 959 |
|
|
| 960 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
| 961 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
| 962 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
| 963 |
|
|
| 964 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
| 965 |
|
</code></pre> |
| 966 |
|
|
| 967 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
| 968 |
|
<code id=systemId>systemId</code> attribute of |
| 969 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
| 970 |
|
<a href="#Entity"><code>Entity</code></a>, and |
| 971 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
| 972 |
|
read$B!>(Bonly.</p> |
| 973 |
|
|
| 974 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
| 975 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
| 976 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
| 977 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
| 978 |
|
associated to the attribute. No normalization, relative reference resolution, |
| 979 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
| 980 |
|
value is <code>null</code>, ...</span></p> |
| 981 |
|
|
| 982 |
|
<div class="note memo"> |
| 983 |
|
<p>Setting an invalid identifier might make the node unserializable. |
| 984 |
|
Setting a public identifier while leaveing system identifier unspecified |
| 985 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
| 986 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
| 987 |
|
</div> |
| 988 |
|
|
| 989 |
|
<div class=ed> |
| 990 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
| 991 |
|
</div> |
| 992 |
|
|
| 993 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
| 994 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
| 995 |
|
read$B!>(Bonly.</p> |
| 996 |
|
|
| 997 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
| 998 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
| 999 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
| 1000 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
| 1001 |
|
associated to the attribute. No normalization, or lexical validation is |
| 1002 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
| 1003 |
|
...</span></p> |
| 1004 |
|
|
| 1005 |
|
</div> |
| 1006 |
|
|
| 1007 |
</div> |
</div> |
| 1008 |
|
|
| 1009 |
|
|