10 |
|
|
11 |
<div class="header"> |
<div class="header"> |
12 |
<h1>DOM Document Type Definition Module</h1> |
<h1>DOM Document Type Definition Module</h1> |
13 |
<h2>Working Draft <time datetime=2007-12-05>5 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> |
141 |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
<h2><abbr>DOM</abbr> Document Type Definition Module</h2> |
142 |
|
|
143 |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
<p>The <abbr>DOM</abbr> Document Type Definition module, version 3.0, |
144 |
consists of three interfaces:</p> |
introduces four interfaces: |
145 |
<ul> |
<a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a>, |
146 |
<li><a href="#DocumentXDoctype"><code>DocumentXDoctype</code></a></li> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a>, |
147 |
<li><a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a></li> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
148 |
<li><a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a></li> |
and <a href="#AttributeDefinition"><code>AttributeDefinition</code></a>. |
149 |
<li><a href="#AttributeDefinition"><code>AttributeDefinition</code></a></li> |
In addition, it modifies existing interfaces |
|
</ul> |
|
|
|
|
|
<p>In addition, it modifies interfaces |
|
150 |
<a href="#Node"><code>Node</code></a>, |
<a href="#Node"><code>Node</code></a>, |
151 |
|
<a href="#Document"><code>Document</code></a>, |
152 |
<a href="#DocumentType"><code>DocumentType</code></a>, |
<a href="#DocumentType"><code>DocumentType</code></a>, |
153 |
<a href="#Entity"><code>Entity</code></a>, |
<a href="#Entity"><code>Entity</code></a>, and |
154 |
<a href="#EntityReference"><code>EntityReference</code></a>, |
<a href="#Notation"><code>Notation</code></a>.</p> |
|
<a href="#Notation"><code>Notation</code></a>, and |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a>.</p> |
|
155 |
|
|
156 |
<div class=section id=features> |
<div class=section id=features> |
157 |
<h3>Feature Name</h3> |
<h3>Feature Name</h3> |
215 |
of the node in the <code>ownerDocument</code> attribute of the node. |
of the node in the <code>ownerDocument</code> attribute of the node. |
216 |
Note that the value might be <code>null</code>.</p> |
Note that the value might be <code>null</code>.</p> |
217 |
</dd> |
</dd> |
218 |
|
<dt><code id=cloneNode>cloneNode</code></dt> |
219 |
|
<dd class=ed>@@</dd> |
220 |
|
<dd class=ed>@@ If Attr and AttributeDefinition is inconsistent, then ...</dd> |
221 |
|
<dt><code id=compareDocumentPosition>compareDocumentPosition</code></dt> |
222 |
|
<dd class=ed>@@</dd> |
223 |
|
<dt><code id=isDefaultNamespace>isDefaultNamespace</code></dt> |
224 |
|
<dd><p>When invoked, the method <em class=rfc2119>MUST</em> return |
225 |
|
<code>false</code>.</p></dd> |
226 |
<dt><code id=isEqualNode>isEqualNode</code></dt> |
<dt><code id=isEqualNode>isEqualNode</code></dt> |
227 |
<dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method, |
<dd><p>For the <a href="#isEqualNode"><code>isEqualNode</code></a> method, |
228 |
following items are added to the list of conditions for equality:</p> |
following items are added to the list of conditions for equality:</p> |
280 |
items that are equal to a string in a list is equal to the number |
items that are equal to a string in a list is equal to the number |
281 |
of the items equal to the string in another list.</p></li> |
of the items equal to the string in another list.</p></li> |
282 |
</ul></dd> |
</ul></dd> |
283 |
|
<dt><code id=lookupNamespaceURI>lookupNamespaceURI</code> and |
284 |
|
<code id=lookupPrefix>lookupPrefix</code></dt> |
285 |
|
<dd><p>When invoked, the methods <em class=rfc2119>MUST</em> return |
286 |
|
<code>null</code>.</p></dd> |
287 |
<dt><code id=nodeName>nodeName</code></dt> |
<dt><code id=nodeName>nodeName</code></dt> |
288 |
<dd> |
<dd> |
289 |
<p>If the node is an |
<p>If the node is an |
331 |
<dd> |
<dd> |
332 |
<p>If the node is an |
<p>If the node is an |
333 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>: |
334 |
On getting, the attributes <em class=rfc2119>MUST</em> return the |
On getting, the attributes <em class=rfc2119>MUST</em> return |
335 |
name of the element type.</p> |
<code>null</code>.</p> |
336 |
|
|
337 |
<div class="note memo"> |
<div class="note memo"> |
338 |
<p>Thus, on setting the attributes does nothing |
<p>Thus, on setting the attributes does nothing |
344 |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span>. |
345 |
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
<span class=ed>@@ I forgot why this requirement is necessary.</span></p> |
346 |
|
|
347 |
<p>If the node is an |
<p>If the node is an |
348 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>:</p> |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a>: |
349 |
|
The attribute <em class=rfc2119>MUST</em> behave as if the node |
350 |
<pre class=ed> |
were <code>Attr</code> <span class=ed>[DOM3]</span>.</p></dd> |
351 |
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute |
<dt><code id=normalize>normalize</code></dt> |
352 |
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
<dd><p>When a <a href="#DocumentType"><code>DocumentType</code></a> is |
353 |
[['''MUST''']] return the normalized default value |
normalized, any nodes in the <code>NamedNodeMap</code> object in the |
354 |
of the attribute. |
<a href="#elementTypes"><code>elementTypes</code></a> attribute |
355 |
|
<em class=rfc2119>MUST</em> be normalized as well.</p> |
356 |
@@ |
|
357 |
|
<p>When an |
358 |
[4] The getter of the [CODE(DOMa)@en[[[textContent]]]] |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
359 |
attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
is normalized, any nodes in the <code>NamedNodeMap</code> object in the |
360 |
object [['''MUST''']] behave as if it were an |
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
361 |
[CODE(DOMi)@en[[[Attr]]]] object. |
attribute <em class=rfc2119>MUST</em> be normalized as well.</p></dd> |
|
|
|
|
The setter of the [CODE(DOMa)@en[[[textContent]]]] attribute |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
[['''MUST''']] behave as if the following algorithm |
|
|
is performed: |
|
|
= If the [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object is read-only, then throw an |
|
|
[CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]]. |
|
|
= Remove any child node the node has. |
|
|
= If the new value is not empty and not [CODE(IDL)@en[[[null]]]], |
|
|
then create a [CODE(DOMi)@en[[[Text]]]] node |
|
|
whose [CODE(DOMa)@en[[[data]]]] is the new value |
|
|
and append it to the [CODE(DOMi)@en[[[AttributeDefinition]]]]. |
|
|
</pre> |
|
|
</dd> |
|
362 |
<dt class=ed>@@ ...</dt> |
<dt class=ed>@@ ...</dt> |
363 |
</dl> |
</dl> |
364 |
|
|
365 |
</div> |
</div> |
366 |
|
|
367 |
|
<div class=section id=section-document> |
368 |
|
<h3>Modifications to the <code id=Document>Document</code> Interface</h3> |
369 |
|
|
370 |
|
<p>If an attempt is made to adopt an |
371 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> or |
372 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
373 |
|
the <code id=adoptNode>adoptNode</code> method <em class=rfc2119>MUST</em> |
374 |
|
raise a <code>NOT_SUPPORTED_ERR</code> exception <span class=ed>@@ |
375 |
|
ref</span>.</p> |
376 |
|
</div> |
377 |
|
|
378 |
<div class=section id=section-documentxdoctype> |
<div class=section id=section-documentxdoctype> |
379 |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
<h3>The <code>DocumentXDoctype</code> Interface</h3> |
380 |
|
|
767 |
the <code>ElementTypeDefinition</code> nodes for the element types |
the <code>ElementTypeDefinition</code> nodes for the element types |
768 |
whose name is presented as the <code>Name</code> of the element type or |
whose name is presented as the <code>Name</code> of the element type or |
769 |
attribute definition list declarations processed by the <abbr>XML</abbr> |
attribute definition list declarations processed by the <abbr>XML</abbr> |
770 |
processor. If there is more than one element type declarations for an |
processor. If there are more than one element type declarations for an |
771 |
element type, then the declarations other than the first one |
element type, then the declarations other than the first one |
772 |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
<em class=rfc2119>MUST</em> be ignored for the purpose of constructing the |
773 |
<code>NamedNodeMap</code> object.</p></dd> |
<code>NamedNodeMap</code> object.</p></dd> |
845 |
and therefore any change of read-only flag on the node is immediately |
and therefore any change of read-only flag on the node is immediately |
846 |
reflected by that of the object. |
reflected by that of the object. |
847 |
--> |
--> |
848 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
849 |
|
method</dt> |
850 |
|
<dd><p>Returns the |
851 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
852 |
|
with the specified name.</p> |
853 |
|
|
854 |
|
<p>The |
855 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
856 |
|
parameter is the name of the element type.</p> |
857 |
|
|
858 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
859 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
860 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
861 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
862 |
|
<code>NamedNodeMap</code> object in the |
863 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
864 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
865 |
|
<code>null</code>.</p></dd> |
866 |
|
<dt><dfn id=getElementTypeDefinitionNode class=dom-method><code>getElementTypeDefinitionNode</code></dfn>, |
867 |
|
method</dt> |
868 |
|
<dd><p>Returns the |
869 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
870 |
|
with the specified name.</p> |
871 |
|
|
872 |
|
<p>The |
873 |
|
<dfn id=getElementTypeDefinitionNode-name class=dom-param><var>name</var></dfn> |
874 |
|
parameter is the name of the element type.</p> |
875 |
|
|
876 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
877 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
878 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
879 |
|
<a href="#getElementTypeDefinitionNode-name"><var>name</var></a>, in the |
880 |
|
<code>NamedNodeMap</code> object in the |
881 |
|
<a href="#elementTypes"><code>elementTypes</code></a> attribute of the |
882 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
883 |
|
<code>null</code>.</p></dd> |
884 |
|
<dt><dfn id=getGeneralEntityNode class=dom-method><code>getGeneralEntityNode</code></dfn>, |
885 |
|
method</dt> |
886 |
|
<dd><p>Returns the <a href="#Entity"><code>Entity</code></a> node |
887 |
|
with the specified name.</p> |
888 |
|
|
889 |
<dt class=ed>@@ other members... |
<p>The <dfn id=getEntityNode-name class=dom-param><var>name</var></dfn> |
890 |
|
parameter is the name of the general entity.</p> |
891 |
|
|
892 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
893 |
|
<a href="#Entity"><code>Entity</code></a> node, |
894 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
895 |
|
<a href="#getEntityNode-name"><var>name</var></a>, in the |
896 |
|
<code>NamedNodeMap</code> object in the |
897 |
|
<a href="#entities"><code>entities</code></a> attribute of the |
898 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
899 |
|
<code>null</code>.</p></dd> |
900 |
|
<dt><dfn id=getNotationNode class=dom-method><code>getNotationNode</code></dfn>, |
901 |
|
method</dt> |
902 |
|
<dd><p>Returns the <a href="#Notation"><code>Notation>/code></a> node |
903 |
|
with the specified name.</p> |
904 |
|
|
905 |
|
<p>The |
906 |
|
<dfn id=getNotationNode-name class=dom-param><var>name</var></dfn> |
907 |
|
parameter is the name of the notation.</p> |
908 |
|
|
909 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
910 |
|
<a href="#Notation"><code>Notation</code></a> node, |
911 |
|
whose <a href="#nodeName"><code>nodeName</code></a> is equal to |
912 |
|
<a href="#getNotationNode-name"><var>name</var></a>, in the |
913 |
|
<code>NamedNodeMap</code> object in the |
914 |
|
<a href="#notations"><code>notations</code></a> attribute of the |
915 |
|
node. If there is no such node, it <em class=rfc2119>MUST</em> return |
916 |
|
<code>null</code>.</p></dd> |
917 |
|
<dt><dfn id=setElementTypeDefinitionNode class=dom-method><code>setElementTypeDefinitionNode</code></dfn>, |
918 |
|
method</dt> |
919 |
|
<dd class=ed>@@</dd> |
920 |
|
<dt><dfn id=setGeneralEntityNode class=dom-method><code>setGeneralEntityNode</code></dfn>, |
921 |
|
method</dt> |
922 |
|
<dd class=ed>@@</dd> |
923 |
|
<dt><dfn id=setNotationNode class=dom-method><code>setNotationNode</code></dfn>, |
924 |
|
method</dt> |
925 |
|
<dd class=ed>@@</dd> |
926 |
</dl> |
</dl> |
927 |
|
|
928 |
<div class=ed> |
<div class=ed> |
937 |
|
|
938 |
<p>The nodes of type |
<p>The nodes of type |
939 |
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
940 |
represents an element type definition. Such a node implements the |
represents an element type definition. Such a node |
941 |
|
<em class=rfc2119>MUST</em> implement the |
942 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
943 |
interface, which extends the <a href="#Node"><code>Node</code></a> |
interface, which extends the <a href="#Node"><code>Node</code></a> |
944 |
interface.</p> |
interface.</p> |
957 |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
958 |
node for that element type.</p> |
node for that element type.</p> |
959 |
|
|
960 |
|
<p>An <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
961 |
|
node cannot be a child of any node. An |
962 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
963 |
|
cannot have any child node.</p> |
964 |
|
|
965 |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
966 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
967 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
968 |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
969 |
|
|
970 |
<span class=ed>@@ more</span> |
readonly attribute NamedNodeMap <a href="#attributeDefinitions">attributeDefinitions</a>; |
971 |
|
<a href="#AttributeDefinition">AttributeDefinition</a> <a href="#getAttributeDefinitionNode">getAttributeDefinitionNode</a> |
972 |
|
(in DOMString <a href="#getAttributeDefinitionNode-name"><var>name</var></a>); |
973 |
|
void <a href="#setAttributeDefinitionNode">setAttributeDefinitionNode</a> |
974 |
|
(in <a href="#AttributeDefinition">AttributeDefinition</a> <a href="#setAttributeDefinitionNode-name"><var>node</var></a>) |
975 |
|
raises (DOMException); |
976 |
}</code></pre> |
}</code></pre> |
977 |
|
|
978 |
<dl> |
<dl> |
999 |
<code>NamedNodeMap</code> object that contains the node. If there is no such |
<code>NamedNodeMap</code> object that contains the node. If there is no such |
1000 |
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
a <a href="#DocumentType"><code>DocumentType</code></a> node, |
1001 |
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p></dd> |
1002 |
|
<dt><dfn id=attributeDefinitions class=dom-attr><code>attributeDefinitions</code></dfn> |
1003 |
|
of type NamedNodeMap, read$B!>(Bonly</dt> |
1004 |
|
<dd><p>A live <code>NamedNodeMap</code> object that contains all the |
1005 |
|
attribute definitions belonging to the |
1006 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
1007 |
|
node.</p> |
1008 |
|
|
1009 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1010 |
|
<code>NamedNodeMap</code> object that contains all the |
1011 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1012 |
|
belonging to the |
1013 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
1014 |
|
The <code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be |
1015 |
|
read$B!>(Bonly if and only if the node is read$B!>(Bonly. The |
1016 |
|
<code>NamedNodeMap</code> object <em class=rfc2119>MUST</em> be live and |
1017 |
|
the same object <em class=rfc2119>MUST</em> be returned for any |
1018 |
|
invocation.</p> |
1019 |
|
|
1020 |
|
<p>If the |
1021 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
1022 |
|
is created during the process to create a <abbr>DOM</abbr> from an |
1023 |
|
<abbr>XML</abbr> document, the following requirements are applied: The |
1024 |
|
<code>NamedNodeMap</code> object in the |
1025 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1026 |
|
attribute <em class=rfc2119>MUST</em> be so transformed that the object |
1027 |
|
contains the |
1028 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1029 |
|
corresponding to the attribute definitions in the attribute definition |
1030 |
|
list declarations processed by the <abbr>XML</abbr> processor and |
1031 |
|
associated to the element type represented by the node. If there are more |
1032 |
|
than one attribute definitions for an attribute, then the definitions other |
1033 |
|
than the first one <em class=rfc2119>MUST</em> be ignored for the purpose |
1034 |
|
of constructing the <code>NamedNodeMap</code> object.</p></dd> |
1035 |
|
<dt><dfn id=getAttributeDefinitionNode class=dom-method><code>getAttributeDefinitionNode</code></dfn>, |
1036 |
|
method</dt> |
1037 |
|
<dd><p>Return the |
1038 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1039 |
|
with the specified name.</p> |
1040 |
|
|
1041 |
|
<p>The |
1042 |
|
<dfn id=getAttributeDefinitionNode-name class=dom-param><var>name</var></dfn> |
1043 |
|
parameter is the name of the attribute.</p> |
1044 |
|
|
1045 |
|
<p>When invoked, the method <em class=rfc2119>MUST</em> return the |
1046 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node, |
1047 |
|
whose <a href="#nodeName"><code>nodeName</code></a> attribute value is |
1048 |
|
equal to <a href="#getAttributeDefinitionNode-name"><var>name</var></a>, |
1049 |
|
in the <code>NamedNodeMap</code> in the |
1050 |
|
<a href="#attributeDefinitions"><code>attributeDefinitions</code></a> |
1051 |
|
attribute of the node. If there is no such node, it |
1052 |
|
<em class=rfc2119>MUST</em> return <code>null</code>.</p></dd> |
1053 |
|
<dt><dfn id=setAttributeDefinitionNode class=dom-method><code>setAttributeDefinitionNode</code></dfn>, |
1054 |
|
method</dt> |
1055 |
|
<dd class=ed>@@</dd> |
1056 |
</dl> |
</dl> |
1057 |
|
|
1058 |
|
<div class=ed> |
1059 |
|
<p>A future version of the specification might define a set of attributes |
1060 |
|
and methods for representing and accessing to the content model of the |
1061 |
|
element type.</p> |
1062 |
|
</div> |
1063 |
</div> |
</div> |
1064 |
|
|
1065 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
1067 |
|
|
1068 |
<p>The nodes of type |
<p>The nodes of type |
1069 |
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
1070 |
represents an attribute definition. Such a node implements the |
represents an attribute definition. Such a node |
1071 |
|
<em class=rfc2119>MUST</em> implement the |
1072 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
1073 |
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
1074 |
|
|
1082 |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
1083 |
that attribute.</p> |
that attribute.</p> |
1084 |
|
|
1085 |
|
<p>An <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1086 |
|
node cannot be a child of any node. An |
1087 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
1088 |
|
can have zero or more child nodes of same kinds as those allowed for |
1089 |
|
<code>Attr</code> nodes <span class=ed>[DOM3]</span>.</p> |
1090 |
|
|
1091 |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1092 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
1093 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
1115 |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
1116 |
|
|
1117 |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
1118 |
|
readonly attribute DOMStringList <a href="#allowedTokens">allowedTokens</a>; |
1119 |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
|
|
|
|
<span class=ed>...</span> |
|
1120 |
}</code></pre> |
}</code></pre> |
1121 |
|
|
1122 |
<dl> |
<dl> |
1239 |
definition group.</p> |
definition group.</p> |
1240 |
|
|
1241 |
</dd> |
</dd> |
1242 |
|
<dt><dfn id=allowedTokens class=dom-attr><code>allowedTokens</code></dfn> of |
1243 |
|
type <code>DOMStringList</code>, read$B!>(Bonly</dt> |
1244 |
|
<dd><p>The list of allowed attribute values.</p> |
1245 |
|
|
1246 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
1247 |
|
<code>DOMStringList</code> object associated to this attribute. The object |
1248 |
|
<em class=rfc2119>MAY</em> contain zero or more ordered strings, consist of |
1249 |
|
zero or more characters respectively, possibly with duplications. The |
1250 |
|
object <em class=rfc2119>MUST</em> be read$B!>(Bonly if and only if the node |
1251 |
|
is read$B!>(Bonly.</p> |
1252 |
|
|
1253 |
|
<p>If the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
1254 |
|
node is created during the process to create a <abbr>DOM</abbr> from an |
1255 |
|
<abbr>XML</abbr> document, the object <em class=rfc2119>MUST</em> contain |
1256 |
|
the names or name tokens allowed for the attribute defined by the node. |
1257 |
|
If the document is well$B!>(Bformed, the object will be empty unless |
1258 |
|
the <a href="#declaredType"><code>declaredType</code></a> is |
1259 |
|
<a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1260 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>.</p> |
1261 |
|
|
1262 |
|
<p>If the <a href="#declaredType"><code>declaredType</code></a> is different |
1263 |
|
from <a href="#ENUMERATION_ATTR"><code>ENUMERATION_ATTR</code></a> or |
1264 |
|
<a href="#NOTATION_ATTR"><code>NOTATION_ATTR</code></a>, this attribute |
1265 |
|
<em class=rfc2119>MUST</em> be ignored for the purpose of serializing |
1266 |
|
into (part of) <abbr>XML</abbr> document.</p> |
1267 |
|
|
1268 |
|
<div class="note memo"> |
1269 |
|
<p>When serializing the node it should be noted that the object might |
1270 |
|
be empty, might contain duplications, and might contain strings that are |
1271 |
|
not names or name tokens.</p> |
1272 |
|
</div></dd> |
1273 |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
1274 |
type <code>unsigned short</code></dt> |
type <code>unsigned short</code></dt> |
1275 |
<dd><p>The type of the default for the attribute. It is expected that this |
<dd><p>The type of the default for the attribute. It is expected that this |
1355 |
// Additions to the Entity interface |
// Additions to the Entity interface |
1356 |
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
attribute DOMString <a href="#hasReplacementTree">hasReplacementTree</a>; |
1357 |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
readonly attribute <a href="#DocumentType">DocumentType</a> <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
1358 |
|
|
1359 |
|
attribute boolean <a href="#isExternallyDeclared">isExternallyDeclared</a>; |
1360 |
</code></pre> |
</code></pre> |
1361 |
|
|
1362 |
<p>The <code id=notationName>notationName</code> attribute of the |
<p>The <code id=notationName>notationName</code> attribute of the |
1415 |
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
has its <a href="#hasReplacementTree"><code>hasReplacementTree</code></a> |
1416 |
attribute set to <code>false</code>.</p> |
attribute set to <code>false</code>.</p> |
1417 |
</div></dd> |
</div></dd> |
1418 |
|
<dt><dfn id=isExternallyDeclared class=dom-attr><code>isExternallyDeclared</code></dfn> |
1419 |
|
of type boolean</dt> |
1420 |
|
<dd><p>Whether the entity is declared by an external entity declaration or |
1421 |
|
not. If the value is <code>true</code>, the entity is declared in an entity |
1422 |
|
declaration in the external subset entity or in an external parameter entity. |
1423 |
|
If the value is <code>false</code>, the entity is declared in an entity |
1424 |
|
declaration in the internal subset, or the node is created in memory.</p> |
1425 |
|
|
1426 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
1427 |
|
the value associated to this attribute.</p> |
1428 |
|
|
1429 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
1430 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
1431 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
1432 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the |
1433 |
|
value associated to this attribute.</p> |
1434 |
|
|
1435 |
|
<p>If the <a href="#Entity"><code>Entity</code></a> node is created during |
1436 |
|
the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, |
1437 |
|
the following requirements are applied: If the entity is an unparsed |
1438 |
|
entity, then the attribute <em class=rfc2119>MUST</em> be set to |
1439 |
|
<code>false</code>. Otherwise, i.e. the entity is a parsed entity, then the |
1440 |
|
attribute <em class=rfc2119>MUST</em> be set to the value of whether the |
1441 |
|
entity is declared by an external markup declaration or not.</p></dd> |
1442 |
</dl> |
</dl> |
1443 |
</div> |
</div> |
1444 |
|
|
1456 |
</code></pre> |
</code></pre> |
1457 |
</div> |
</div> |
1458 |
|
|
|
<div class=section id=section-processinginstruction> |
|
|
<h3>Modifications to the |
|
|
<code id=ProcessingInstruction>ProcessingInstruction</code> Interface</h3> |
|
|
|
|
|
<div class=ed>...</div> |
|
|
</div> |
|
|
|
|
1459 |
</div> |
</div> |
1460 |
|
|
1461 |
<div id="references" class="section reference"> |
<div id="references" class="section reference"> |