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-03>3 December 2007</time></h2> |
<h2>Working Draft <time datetime=2007-12-04>4 December 2007</time></h2> |
14 |
|
|
15 |
<dl class="versions-uri"> |
<dl class="versions-uri"> |
16 |
<dt>This Version</dt> |
<dt>This Version</dt> |
129 |
<p>If the <code>strictErrorChecking</code> attribute of the |
<p>If the <code>strictErrorChecking</code> attribute of the |
130 |
<code>Document</code> node is <code>false</code>, the methods are |
<code>Document</code> node is <code>false</code>, the methods are |
131 |
not required to raise exceptions <span class=ed>[DOM3]</span>.</p> |
not required to raise exceptions <span class=ed>[DOM3]</span>.</p> |
132 |
|
|
133 |
|
<div class=ed> |
134 |
|
<p>Conformant product classes: implementation, XML parser (XML document -> |
135 |
|
DOM converter), XML serializer (DOM -> XML document covnerter). |
136 |
|
XML Infoset -> DOM converter, and DOM -> XML Infoset converter.</p> |
137 |
|
</div> |
138 |
</div> |
</div> |
139 |
|
|
140 |
<div class=section id=dom-dtdef> |
<div class=section id=dom-dtdef> |
546 |
|
|
547 |
</div> |
</div> |
548 |
|
|
549 |
|
|
550 |
|
<div class=section id=section-documenttype> |
551 |
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
552 |
|
Interface</h3> |
553 |
|
|
554 |
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
555 |
|
<em class=rfc2119>MAY</em> contain zero or more |
556 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
557 |
|
nodes in the <code>NodeList</code> object contained in the |
558 |
|
<code>childNodes</code> attribute of the |
559 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
560 |
|
|
561 |
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
562 |
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
563 |
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
564 |
|
object <em class=rfc2119>MUST</em> contains the |
565 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
566 |
|
nodes representing the processing instructions in the document type |
567 |
|
definition of the document processed <span class=ed>@@ ref</span> by |
568 |
|
the <abbr>XML</abbr> processor. If the |
569 |
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
570 |
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
571 |
|
also be marked as read$B!>(Bonly.</p> |
572 |
|
|
573 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
574 |
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
575 |
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
576 |
|
of the node <em class=rfc2119>MUST</em> contain the |
577 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
578 |
|
created from the processing instruction information items in the list in the |
579 |
|
[children] property of the document type declaration item in the same |
580 |
|
order.</p> |
581 |
|
|
582 |
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
583 |
|
a document type declaration information item, the list in the [children] |
584 |
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
585 |
|
information items created from the |
586 |
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
587 |
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
588 |
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
589 |
|
|
590 |
|
<p>The implementation of the |
591 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
592 |
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
593 |
|
<pre class=idl><code>// Modifications to the DocumentType interface |
594 |
|
attribute DOMString <a href="#publicId">publicId</a>; |
595 |
|
attribute DOMString <a href="#systemId">systemId</a>; |
596 |
|
|
597 |
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
598 |
|
</code></pre> |
599 |
|
|
600 |
|
<p>The <code id=publicId>publicId</code> attribute and the |
601 |
|
<code id=systemId>systemId</code> attribute of |
602 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
603 |
|
<a href="#Entity"><code>Entity</code></a>, and |
604 |
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
605 |
|
read$B!>(Bonly.</p> |
606 |
|
|
607 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
608 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
609 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
610 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
611 |
|
associated to the attribute. No normalization, relative reference resolution, |
612 |
|
or lexical validation is performed. <span class=ed>@@ If the new |
613 |
|
value is <code>null</code>, ...</span></p> |
614 |
|
|
615 |
|
<div class="note memo"> |
616 |
|
<p>Setting an invalid identifier might make the node unserializable. |
617 |
|
Setting a public identifier while leaveing system identifier unspecified |
618 |
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
619 |
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
620 |
|
</div> |
621 |
|
|
622 |
|
<div class=ed> |
623 |
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
624 |
|
</div> |
625 |
|
|
626 |
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
627 |
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
628 |
|
read$B!>(Bonly.</p> |
629 |
|
|
630 |
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
631 |
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
632 |
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
633 |
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
634 |
|
associated to the attribute. No normalization, or lexical validation is |
635 |
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
636 |
|
...</span></p> |
637 |
|
|
638 |
|
</div> |
639 |
|
|
640 |
<div class=section id=section-documenttypedefinition> |
<div class=section id=section-documenttypedefinition> |
641 |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
<h3>The <code>DocumentTypeDefinition</code> Interface</h3> |
642 |
|
|
643 |
|
<div class="note memo"> |
644 |
|
<p>This interface is a separated interface from the |
645 |
|
<a href="#DocumentType"><code>DocumentType</code></a>, not a set of extensions |
646 |
|
to the <a href="#DocumentType"><code>DocumentType</code></a>, |
647 |
|
for the historical reason.</p> |
648 |
|
</div> |
649 |
|
|
650 |
<p>The |
<p>The |
651 |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
<a href="#DocumentTypeDefinition"><code>DocumentTypeDefinition</code></a> |
652 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
797 |
<div class=section id=section-elementtypedefinition> |
<div class=section id=section-elementtypedefinition> |
798 |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
<h3>The <code>ElementTypeDefinition</code> Interface</h3> |
799 |
|
|
800 |
|
<p>The nodes of type |
801 |
|
<a href="#ELEMENT_TYPE_DEFINITION_NODE"><code>ELEMENT_TYPE_DEFINITION_NODE</code></a> |
802 |
|
represents an element type definition. Such a node implements the |
803 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
804 |
|
interface, which extends the <a href="#Node"><code>Node</code></a> |
805 |
|
interface.</p> |
806 |
|
|
807 |
|
<p>An element type definition represents a definition of the element type. |
808 |
|
It is corresponding to the element type declaration in <abbr>DTD</abbr>. |
809 |
|
However, an |
810 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> node |
811 |
|
does not represent the element type definition in <abbr>DTD</abbr> itself. |
812 |
|
Even if there are more than one element type declarations for an element type |
813 |
|
in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
814 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
815 |
|
node for that element type. In addition, if there are attribute definition |
816 |
|
declarations for an element type, even when there is no element type |
817 |
|
declaration for that element type, the <abbr>DOM</abbr> will contain an |
818 |
|
<a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
819 |
|
node for that element type.</p> |
820 |
|
|
821 |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
<p>The <a href="#ElementTypeDefinition"><code>ElementTypeDefinition</code></a> |
822 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
823 |
<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> { |
835 |
<div class=section id=section-attributedefinition> |
<div class=section id=section-attributedefinition> |
836 |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
<h3>The <code>AttributeDefinition</code> Interface</h3> |
837 |
|
|
838 |
|
<p>The nodes of type |
839 |
|
<a href="#ATTRIBUTE_DEFINITION_NODE"><code>ATTRIBUTE_DEFINITION_NODE</code></a> |
840 |
|
represents an attribute definition. Such a node implements the |
841 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> interface, |
842 |
|
which extends the <a href="#Node"><code>Node</code></a> interface.</p> |
843 |
|
|
844 |
|
<p>An attribute definition represents a definition of the attribute |
845 |
|
associated to an element type. It is corresponding to the attribute definition |
846 |
|
in the attribute list declaration in <abbr>DTD</abbr>. However, an |
847 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node does |
848 |
|
not represent the attribute definition in <abbr>DTD</abbr> itself. Even if |
849 |
|
there are more than one attribute definitions for an attribute of an element |
850 |
|
type in <abbr>DTD</abbr>, the result <abbr>DOM</abbr> will contain only an |
851 |
|
<a href="#AttributeDefinition"><code>AttributeDefinition</code></a> node for |
852 |
|
that attribute.</p> |
853 |
|
|
854 |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
<p>The <a href="#AttributeDefinition"><code>AttributeDefinition</code></a> |
855 |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
interface <em class=rfc2119>MUST</em> be implemented as following:</p> |
856 |
<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> { |
867 |
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
const unsigned short <a href="#NOTATION_ATTR">NOTATION_ATTR</a> = 9; |
868 |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
const unsigned short <a href="#ENUMERATION_ATTR">ENUMERATION_ATTR</a> = 10; |
869 |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
const unsigned short <a href="#UNKNOWN_ATTR">UNKNOWN_ATTR</a> = 11; |
870 |
|
|
871 |
|
<span class=comment>// <a href="#DefaultValueType">DefaultValueType</a></span> |
872 |
|
const unsigned short <a href="#UNKNOWN_DEFAULT">UNKNOWN_DEFAULT</a> = 0; |
873 |
|
const unsigned short <a href="#FIXED_DEFAULT">FIXED_DEFAULT</a> = 1; |
874 |
|
const unsigned short <a href="#REQUIRED_DEFAULT">REQUIRED_DEFAULT</a> = 2; |
875 |
|
const unsigned short <a href="#IMPLIED_DEFAULT">IMPLIED_DEFAULT</a> = 3; |
876 |
|
const unsigned short <a href="#EXPLICIT_DEFAULT">EXPLICIT_DEFAULT</a> = 4; |
877 |
|
|
878 |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
readonly attribute <a href="#ElementTypeDefinition">ElementTypeDefinition</a> <a href="#ownerElementTypeDefinition">ownerElementTypeDefinition</a>; |
879 |
|
|
1075 |
|
|
1076 |
</div> |
</div> |
1077 |
|
|
|
<div class=section id=section-documenttype> |
|
|
<h3>Modifications to the <code id=DocumentType>DocumentType</code> |
|
|
Interface</h3> |
|
|
|
|
|
<p>A <a href="#DocumentType"><code>DocumentType</code></a> interface |
|
|
<em class=rfc2119>MAY</em> contain zero or more |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
|
|
nodes in the <code>NodeList</code> object contained in the |
|
|
<code>childNodes</code> attribute of the |
|
|
<a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
|
|
|
|
|
<p>If the <a href="#DocumentType"><code>DocumentType</code></a> node is created |
|
|
during the process to create a <abbr>DOM</abbr> from an <abbr>XML</abbr> |
|
|
document, the <code>NodeList</code> object in the <code>childNodes</code> |
|
|
object <em class=rfc2119>MUST</em> contains the |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> |
|
|
nodes representing the processing instructions in the document type |
|
|
definition of the document processed <span class=ed>@@ ref</span> by |
|
|
the <abbr>XML</abbr> processor. If the |
|
|
<a href="#DocumentType"><code>DocumentType</code></a> node is marked |
|
|
as read$B!>(Bonly, then all the child nodes <em class=rfc2119>MUST</em> |
|
|
also be marked as read$B!>(Bonly.</p> |
|
|
|
|
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is created |
|
|
from a document type declaration information item <span class=ed>@@ ref</span>, |
|
|
the <code>NodeList</code> object in the <code>childNodes</code> attribute |
|
|
of the node <em class=rfc2119>MUST</em> contain the |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
|
|
created from the processing instruction information items in the list in the |
|
|
[children] property of the document type declaration item in the same |
|
|
order.</p> |
|
|
|
|
|
<p>If a <a href="#DocumentType"><code>DocumentType</code></a> node is mapped to |
|
|
a document type declaration information item, the list in the [children] |
|
|
property <em class=rfc2119>MUST</em> contain the processng instruction |
|
|
information items created from the |
|
|
<a href="#ProcessingInstruction"><code>ProcessingInstruction</code></a> nodes |
|
|
in the <code>NodeList</code> object in the <code>childNodes</code> attribute |
|
|
of the <a href="#DocumentType"><code>DocumentType</code></a> node.</p> |
|
|
|
|
|
<p>The implementation of the |
|
|
<a href="#DocumentType"><code>DocumentType</code></a> interface |
|
|
<em class=rfc2119>MUST</em> be modified as following:</p> |
|
|
<pre class=idl><code>// Modifications to the DocumentType interface |
|
|
attribute DOMString <a href="#publicId">publicId</a>; |
|
|
attribute DOMString <a href="#systemId">systemId</a>; |
|
|
|
|
|
attribute DOMString <a href="#internalSubset">internalSubset</a>; |
|
|
</code></pre> |
|
|
|
|
|
<p>The <code id=publicId>publicId</code> attribute and the |
|
|
<code id=systemId>systemId</code> attribute of |
|
|
<a href="#DocumentType"><code>DocumentType</code></a>, |
|
|
<a href="#Entity"><code>Entity</code></a>, and |
|
|
<a href="#Notation"><code>Notation</code></a> interfaces are no longer |
|
|
read$B!>(Bonly.</p> |
|
|
|
|
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
|
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
|
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
|
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
|
|
associated to the attribute. No normalization, relative reference resolution, |
|
|
or lexical validation is performed. <span class=ed>@@ If the new |
|
|
value is <code>null</code>, ...</span></p> |
|
|
|
|
|
<div class="note memo"> |
|
|
<p>Setting an invalid identifier might make the node unserializable. |
|
|
Setting a public identifier while leaveing system identifier unspecified |
|
|
would also make the <a href="#DocumentType"><code>DocumentType</code></a> |
|
|
or <a href="#Entity"><code>Entity</code></a> node unserializable.</p> |
|
|
</div> |
|
|
|
|
|
<div class=ed> |
|
|
<p>ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.</p> |
|
|
</div> |
|
|
|
|
|
<p>The <code id=internalSubset>internalSubset</code> attribute of the |
|
|
<a href="#DocumentType"><code>DocumentType</code></a> interface is no longer |
|
|
read$B!>(Bonly.</p> |
|
|
|
|
|
<p>On setting, the attribute <em class=rfc2119>MUST</em> raise a |
|
|
<code>NO_MODIFICATION_ALLOWED_ERR</code> <span class=ed>@@ ref</span> |
|
|
exception if the node is read$B!>(Bonly <span class=ed>@@ ref</span>. |
|
|
Otherwise, it <em class=rfc2119>MUST</em> set the specified value as the value |
|
|
associated to the attribute. No normalization, or lexical validation is |
|
|
performed. <span class=ed>@@ If the new value is <code>null</code>, |
|
|
...</span></p> |
|
|
|
|
|
</div> |
|
|
|
|
1078 |
</div> |
</div> |
1079 |
|
|
1080 |
|
|