DocumentTypeDefinition Interfacemanakai//DOM Extensions > DOM XML Document Type Definition
module > New Interfaces > The DocumentTypeDefinition
Interface
[1] In an implementation that supports the
http://suika.fam.cx/www/2006/feature/XDoctype
feature, a DocumentType node
must implement the DocumentTypeDefinition
interface. See DOM XML Document Type Definition (>>3) for
details.
[2] The elementTypes attribute
of the DocumentTypeDefinition interface
is a live NamedNodeMap object that
contains all element types belongs to the DocumentTypeDefinition
node. The type of the attribute is NamedNodeMap.
The attribute is read-only.
What are contained in this collection depends on how
the DocumentTypeDefinition node was created. If the
node was created as the result of parsing of an XML document,
it MUST contain all element types whose element type and / or
attribute definition list declaration are encountered by and provided for the DOM
implementation from the XML processor. Note that the XML processor might not
provide a part of or entire such information depending on the configuration.
If more than one declarations for an element type or an attribute is available
at the time of the definition node construction, then declarations other than
the first ones MUST be discarded.
The attribute MUST return the NamedNodeMap
object that contains all the ElementTypeDefinition nodes
belong to the node. The returned NamedNodeMap object
MUST be read-only if and only if the node is read-only.
Note that the NamedNodeMap object is live
and therefore any change of read-only flag on the node is immediately
reflected by that of the object.
[3] The generalEntities attribute
of the DocumentTypeDefinition interface
is a live NamedNodeMap object that contains all the
general entities belong to the DocumentTypeDefinition node.
The type of the attribute is NamedNodeMap.
The attribute is read-only.
All entities declared in the document type definition
contained in or referenced from the document entity
might not be exposed through this collection, depending
on the information provided by the XML processor for
the DOM implementation. In particular, it might not
contain any entity if entity references are expanded
at the parse time. An implementation MUST NOT
expose an Entity node whose nodeName
is equal to the name of one of five predefined general entities in
XML through the collection as the result of parsing of an XML
document that has no error. Duplicate entity declarations are also discarded.
The attribute MUST return the NamedNodeMap
object that contains all the Entity nodes
representing general entities belong to the node. The returned
NamedNodeMap object MUST be read-only if and only if
the node is read-only. Note that the NamedNodeMap object is live
and therefore any change of read-only flag on the node is immediately
reflected by that of the object.
The attribute MUST return the same value as the
entites attribute of the
DocumentType interface on the same node.
[4] The notations attribute
of the DocumentTypeDefinition interface
is a live NamedNodeMap object that contains
all the notations belong to the DocumentTypeDefinition
node. The type of the attribute is NamedNodeMap.
The attribute is read-only.
If the DocumentTypeDefinition node is
created from an XML document, duplicate notation declarations, if any, in DTD
MUST NOT result in a node in the NamedNodeMap
object and only the first declaration MUST be
made available as a Notation node.
The attribute MUST return the NamedNodeMap
object that contains all the Notation nodes
representing notations belong to the node. The returned
NamedNodeMap object MUST be read-only if and only if
the node is read-only. Note that the NamedNodeMap object is live
and therefore any change of read-only flag on the node is immediately
reflected by that of the object.
A DOM implementation is not required to implement the
notations attribute twice
for the DocumentType and
the DocumentTypeDefinition interfaces;
the latter is defined to contain the same value as the former.
[5] A future version of the interface might define the
parameterEntities attribute and
getter/setter for parameter entities.
[6] This interface is implemented by manakai; see <http://suika.fam.cx/gate/cvs/messaging/manakai/lib/Message/DOM/DocumentType.pm> for its source code.
notationsattribute of theDocumentTypeinterface in DOM XML module. Since duplication is violation to the Validity Constraint, XML parsers might vary on how notations are notified to the application. In particular,notationsproperty of the document information item in XML Information Set is so defined that in case any notation is declared for multiple times then the property has no value.