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-01>1 December 2007</time></h2> |
<h2>Working Draft <time datetime=2007-12-03>3 December 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
542 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
543 |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
544 |
|
|
545 |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=ElementTypeDefinition><code>ElementTypeDefinition</code></dfn> : <a href="#Node">Node</a> { |
546 |
|
readonly attribute <a href="#ownerDocumentTypeDefinition">ownerDocumentTypeDefinition</a>; |
547 |
|
|
548 |
|
<span class=ed>@@ more</span> |
549 |
}</code></pre> |
}</code></pre> |
550 |
|
|
551 |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
<pre class=ed>** Modifications to [CODE(DOMi)@en[[[Node]]]] members |
588 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
589 |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
590 |
|
|
591 |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> { |
<pre class=idl><code>interface <dfn id=AttributeDefinition><code>AttributeDefinition</code></dfn> : <a href="#Node">Node</a> { |
592 |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
<span class=comment>// <a href="#DeclaredValueType">DeclaredValueType</a></span> |
593 |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
const unsigned short <a href="#NO_TYPE_ATTR">NO_TYPE_ATTR</a> = 0; |
594 |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
const unsigned short <a href="#CDATA_ATTR">CDATA_ATTR</a> = 1; |
603 |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
604 |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
605 |
|
|
606 |
|
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
607 |
|
|
608 |
|
readonly attribute unsigned short <a href="#declaredType">declaredType</a>; |
609 |
|
readonly attribute unsigned short <a href="#defaultType">defaultType</a>; |
610 |
|
|
611 |
<span class=ed>...</span> |
<span class=ed>...</span> |
612 |
}</code></pre> |
}</code></pre> |
613 |
|
|
753 |
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
object by [CODE(DOMm)@en[[[createAttributeDefinition]]]] |
754 |
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
method has [CODE(DOMa)@en[[[declaredType]]]] attribute |
755 |
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
set to [CODE(DOMc)@en[[[NO_TYPE_ATTR]]]]. |
756 |
|
</pre> |
757 |
|
|
758 |
** Tree-relationship Attributes |
<dl> |
759 |
|
<dt><dfn id=ownerElementTypeDefinition class=dom-attr><code>ownerElementTypeDefinition</code></dfn> |
760 |
|
of type |
761 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a>, |
762 |
|
read$B!>(Bonly</dt> |
763 |
|
<dd><p>The |
764 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> to |
765 |
|
which the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
766 |
|
node belongs.</p> |
767 |
|
|
768 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return an |
769 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node. |
770 |
|
It <em class=rfc2119>MUST</em> be such a node that whose |
771 |
|
<a href="#attributeDefinitons"><code>attributeDefinitions</code></a> |
772 |
|
attribute contains the <code>NamedNodeMap</code> object that contains |
773 |
|
the <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
774 |
|
node. If there is no such an |
775 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node, |
776 |
|
then <code>null</code> <em class=rfc2119>MUST</em> be returned.</p> |
777 |
|
<dt><dfn id=declaredType class=dom-attr><code>declaredType</code></dfn> of type |
778 |
|
<code>unsigned short</code></dt> |
779 |
|
<dd><p>The declared type <span class=ed>@@ ref</span> of the attribute. |
780 |
|
It is expected that this attribute contains a value from the definition group |
781 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a>.</p> |
782 |
|
|
783 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return the |
784 |
|
value associated to this attribute.</p> |
785 |
|
|
786 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
787 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
788 |
|
exception if the |
789 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
790 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
791 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
792 |
|
associated to this attribute.</p> |
793 |
|
|
794 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
795 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
796 |
|
appropriate value from the |
797 |
|
<a href="#DeclaredValueType"><code>DeclaredValueType</code></a> constant |
798 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p></dd> |
799 |
|
<dt><dfn id=defaultType class=dom-attr><code>defaultType</code></dfn> of |
800 |
|
type <code>unsigned short</code></dt> |
801 |
|
<dd><p>The type of the default for the attribute. It is expected that this |
802 |
|
attribute contains a value from the definition group |
803 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a>.</p> |
804 |
|
|
805 |
|
<p>On getting, the attribute <em class=rfc2119>MUST</em> return |
806 |
|
the value associated to this attribute.</p> |
807 |
|
|
808 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
809 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
810 |
|
exception if the |
811 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node |
812 |
|
is read$B!>(Bonly <span class=ed>@@ ref</span>. Otherwise, it |
813 |
|
<em class=rfc2119>MUST</em> set the specified value as the value |
814 |
|
associated to this attribute.</p> |
815 |
|
|
816 |
|
<p>If the <code>AttributeDefinition</code> node is created during the process |
817 |
|
to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> document, an |
818 |
|
appropriate value from the |
819 |
|
<a href="#DefaultValueType"><code>DefaultValueType</code></a> constant |
820 |
|
group <em class=rfc2119>MUST</em> be set to the attribute.</p></dd> |
821 |
|
</dl> |
822 |
|
|
|
[10] |
|
|
The |
|
|
[DFN@en[[CODE(DOMa)@en[[[ownerElementTypeDefinition]]]] attribute]] |
|
|
of the [CODE(DOMi)@en[[[AttributeDefinition]]]] interface |
|
|
is read-only and of type |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]. |
|
|
It is the [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node |
|
|
which the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
belong to. |
|
|
|
|
|
If the [CODE(DOMi)@en[[[AttributeDefinition]]]] node |
|
|
is included in the [CODE(DOMa)@en[[[attributeDefinitions]]]] |
|
|
list of an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node, |
|
|
then the attribute [['''MUST''']] return the |
|
|
[CODE(DOMi)@en[[[ElementTypeDefinition]]]] node. |
|
|
Otherwise, it [['''MUST''']] return [CODE(DOM)@en[[[null]]]]. |
|
|
|
|
|
;; This attribute is analogue to the |
|
|
[CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]] attribute |
|
|
for [CODE(DOMi)@en[[[ElementTypeDefinition]]]], |
|
|
[CODE(DOMi)@en[[[Entity]]]], and [CODE(DOMi)@en[[[Notation]]]] |
|
|
nodes, or the [CODE(DOMa)@en[[[ownerElement]]]] |
|
|
attribute for [CODE(DOMi)@en[[[Attr]]]] nodes. |
|
|
|
|
|
** Attributes |
|
|
|
|
|
[5] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[declaredType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DeclaredValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DeclaredValueType]]]] |
|
|
definition group. |
|
|
|
|
|
[8] |
|
|
The [DFN@en[[CODE(DOMa)@en[[[defaultType]]]] attribute]] |
|
|
of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object |
|
|
represents the type of the attribute default value. |
|
|
|
|
|
This attribute is read-write. |
|
|
The type of the attribute is |
|
|
[CODE(IDL)@en[[[unsigned]] [[short]]]]. It is expected |
|
|
that this attribute has a value from the definition group |
|
|
[CODE(DOM)@en[[[DefaultValueType]]]]. |
|
|
|
|
|
The getter [['''MUST''']] return a value associated |
|
|
to this attribute. |
|
|
|
|
|
The setter [['''MUST''']] |
|
|
throw a [CODE(DOMc)@en[[[NO_MODIFICATION_ALLOWED_ERR]]]] |
|
|
[CODE(DOMi)@en[[[DOMException]]]] if the |
|
|
[CODE(DOMi)@en[[[AttributeDefinition]]]] object is read-only. |
|
|
Otherwise, the setter [['''MUST''']] set the specified |
|
|
value as the value associated to this attribute. |
|
|
|
|
|
If a parser create an [CODE(DOMi)@en[[[AttributeDefinition]]]] |
|
|
object, then it [['''MUST''']] set a value |
|
|
from the [CODE(DOM)@en[[[DefaultValueType]]]] |
|
|
definition group.</pre> |
|
823 |
</div> |
</div> |
824 |
|
|
825 |
</div> |
</div> |