* The [CODE(DOMi)@en[DocumentXDoctype]] Interface Specification

[1] [[manakai//DOM Extensions]] > New Interfaces >
[[DOM XML Document Type Definition]] module >
The [CODE(DOMi)@en[[[DocumentXDoctype]]]] Interface

[2]
@@ cast

** Constructors

[3] The 
[DFN@en[[CODE(DOMm)@en[[[createDocumentTypeDefinition]]]] method]]
returns a [CODE(DOMi)@en[[[DocumentType]]]] node
or raises a [CODE(DOMi)@en[[[DOMException]]]].
It creates a [CODE(DOMi)@en[[[DocumentType]]]] node 
of the given name, belonging to the document.

[3] The 
[DFN@en[[CODE(DOMm)@en[[[createElementTypeDefinition]]]] method]]
returns an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node
or raises a [CODE(DOMi)@en[[[DOMException]]]].
It creates an [CODE(DOMi)@en[[[ElementTypeDefinition]]]] node 
of the given name, belonging to the document.

[4] The 
[DFN@en[[CODE(DOMm)@en[[[createAttributeDefinition]]]] method]]
returns an [CODE(DOMi)@en[[[AttributeDefinition]]]] node
or raises a [CODE(DOMi)@en[[[DOMException]]]].
It creates an [CODE(DOMi)@en[[[AttributeDefinition]]]] node 
of the given name, belonging to the document.

[10] The 
[DFN@en[[CODE(DOMm)@en[[[createGeneralEntity]]]] method]]
returns an [CODE(DOMi)@en[[[Entity]]]] node
or raises a [CODE(DOMi)@en[[[DOMException]]]].
It creates an [CODE(DOMi)@en[[[Entity]]]] node,
which represents a general entity,
of the given name, belonging to the document.

[12] The
[DFN@en[[CODE(DOMm)@en[[[createNotation]]]] method]]
returns a [CODE(DOMi)@en[[[Notation]]]] node
or raises a [CODE(DOMi)@en[[[DOMException]]]].
It creates a [CODE(DOMi)@en[[[Notation]]]] node
of the given name, belonging to the document.

[5]
These method take a parameter [CODE(DOMp)@en[[[name]]]],
of type [CODE(DOMi)@en[[[DOMString]]]].  It is
the document type name, element type name,
or attribute name of the node to be created.

[6]
The [CODE(DOMm)@en[[[createDocumentTypeDefinition]]]]
method [['''MUST''']] create a [CODE(DOMi)@en[[[DocumentType]]]]
object with the following attribute values:
- [CODE(DOMa)@en[[[attributes]]]],
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[elementTypes]]]],
[CODE(DOMa)@en[[[generalEntities]]]],
[CODE(DOMa)@en[[[notations]]]]: Empty
[CODE(DOMi)@en[[[NamedNodeMap]]]]s.
- [CODE(DOMa)@en[[[childNodes]]]]: An empty
[CODE(DOMi)@en[[[NodeList]]]].
- [CODE(DOMa)@en[[[entities]]]]: The same 
[CODE(DOMi)@en[[[NamedNodeMap]]]] as
[CODE(DOMa)@en[[[generalEntities]]]].
- [CODE(DOMa)@en[[[internalSubset]]]],
[CODE(DOMa)@en[[[publicId]]]], [CODE(DOMa)@en[[[systemId]]]]:
Empty strings.
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].
- [CODE(DOMa)@en[[[ownerDocument]]]]: The 
[CODE(DOMi)@en[[[Document]]]] node on which the method
is invoked.

In addition, it [['''MUST''']] be marked as containing
five general entity declarations for XML predefined
entities, i.e. [CODE(XML)@en[[[amp]]]], [CODE(XML)@en[[[lt]]]],
[CODE(XML)@en[[[gt]]]], [CODE(XML)@en[[[quot]]]], and
[CODE(XML)@en[[[apos]]]].

[8]
The [CODE(DOMm)@en[[[createElementTypeDefinition]]]]
method [['''MUST''']] create an 
[CODE(DOMi)@en[[[ElementTypeDefinition]]]]
object with the following attribute values:
- [CODE(DOMa)@en[[[attributeDefinitions]]]]:
An empty [CODE(DOMi)@en[[[NamedNodeMap]]]].
- [CODE(DOMa)@en[[[attributes]]]],
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[childNodes]]]]: An empty
[CODE(DOMi)@en[[[NodeList]]]].
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].
- [CODE(DOMa)@en[[[ownerDocument]]]]: The 
[CODE(DOMi)@en[[[Document]]]] node on which the method
is invoked.
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:
[CODE(IDL)@en[[[null]]]].

@@ Ensure all attributes are defined

[9] The [CODE(DOMm)@en[[[createAttributeDefinition]]]]
method [['''MUST''']] create an 
[CODE(DOMi)@en[[[AttributeDefinition]]]]
object with the following attribute values:
- [CODE(DOMa)@en[[[allowedTokens]]]]:
An empty [CODE(DOMi)@en[[[DOMStringList]]]].
- [CODE(DOMa)@en[[[attributes]]]],
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[childNodes]]]]: An empty
[CODE(DOMi)@en[[[NodeList]]]].
- [CODE(DOMa)@en[[[declaredType]]]]:
[CODE(DOMc)@en[[[NO_TYPE_ATTR]]]].
- [CODE(DOMa)@en[[[defaultType]]]]:
[CODE(DOMc)@en[[[UNKNOWN_DEFAULT]]]].
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].
- [CODE(DOMa)@en[[[ownerDocument]]]]: The 
[CODE(DOMi)@en[[[Document]]]] node on which the method
is invoked.
- [CODE(DOMa)@en[[[ownerElementTypeDefinition]]]]:
[CODE(IDL)@en[[[null]]]].

@@ Ensure all attributes are defined

@@ Should we keep these statements?: 
However, if the <cfg::cfg|xml-id> configuration
parameter is set to <DOM::true> and the <P::name>
is <XA::xml:id>, then the [CODE(DOMa)@en[[[declaredType]]]]
attribute is set to
<C::AttributeDefinition.ID_ATTR>.
[CODE(DOMa)@en[[[defaultType]]]]?

[11] The [CODE(DOMm)@en[[[createGeneralEntity]]]]
method [['''MUST''']] create an [CODE(DOMi)@en[[[Entity]]]]
node with the following attribute values:
- [CODE(DOMa)@en[[[attributes]]]],
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[childNodes]]]]: An empty
[CODE(DOMi)@en[[[NodeList]]]].
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:
No explicit value is set.
- [CODE(DOMa)@en[[[manakaiEntityBaseURI]]]]:
No explicit value is set.
- [CODE(DOMa)@en[[[manakaiEntityURI]]]]:
No explicit value is set.
- [CODE(DOMa)@en[[[manakaiHasReplacementTree]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].
- [CODE(DOMa)@en[[[notationName]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[ownerDocument]]]]: The 
[CODE(DOMi)@en[[[Document]]]] node on which the method
is invoked.
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:
[CODE(IDL)@en[[[null]]]].
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].

@@ Ensure all attributes are defined

@@ publicId and systemId should be empty string?

[13] The [CODE(DOMm)@en[[[createNotation]]]]
method [['''MUST''']] create a [CODE(DOMi)@en[[[Notation]]]]
node with the following attribute values:
- [CODE(DOMa)@en[[[attributes]]]],
[CODE(DOMa)@en[[[parentNode]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[childNodes]]]]: An empty
[CODE(DOMi)@en[[[NodeList]]]].
- [CODE(DOMa)@en[[[manakaiDeclarationBaseURI]]]]:
No explicit value is set.
- [CODE(DOMa)@en[[[manakaiReadOnly]]]]:
[CODE(IDL)@en[[[false]]]].
- [CODE(DOMa)@en[[[nodeName]]]]: [CODE(DOMp)@en[[[name]]]].
- [CODE(DOMa)@en[[[ownerDocument]]]]: The 
[CODE(DOMi)@en[[[Document]]]] node on which the method
is invoked.
- [CODE(DOMa)@en[[[ownerDocumentTypeDefinition]]]]:
[CODE(IDL)@en[[[null]]]].
- [CODE(DOMa)@en[[[publicId]]]]: [CODE(DOM)@en[[[null]]]].
- [CODE(DOMa)@en[[[systemId]]]]: [CODE(DOM)@en[[[null]]]].

@@ Ensure all attributes are defined

[7]
These method [['''MUST''']] raise an
[CODE(DOMi)@en[[[INVALID_CHARACTER_ERR]]]]
[CODE(DOMi)@en[[[DOMException]]]] 
if the [CODE(DOMp)@en[[[name]]]] is not a legal
name according to the XML version in use as 
specified in the [CODE(DOMa)@en[[[xmlVersion]]]]
attribute of the [CODE(DOMi)@en[[[Document]]]] node.

;; Non-XML case is intentionally left unspecified for now
since DOM3 does not define it.

;; [CODE(DOMp)@en[[[name]]]] does not have to
be a namespace qualified name.

;; Note also that it is not an error for the 
[CODE(DOMp)@en[[[name]]]] parameter value
to match to the name of one of predefined general
parsed entities in XML or HTML.

;; If the [CODE(DOMa)@en[[[strictErrorChecking]]]] attribute
is set to [CODE(IDL)@en[[[false]]]], then the implementation
is not required to raise this exception.

Otherwise, these method [['''MUST''']] return
the newly created node.

* メモ
