<http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work>
<http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef>
<http://suika.fam.cx/www/markup/xml/domdtdef/domdtdef-work>
<http://suika.fam.cx/gate/cvs/markup/xml/domdtdef/domdtdef-work.en.html>
<w@suika.fam.cx>
© Wakaba.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License,
Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front‐Cover Texts, and no Back‐Cover
Texts. A copy of the license is
available at <http://www.gnu.org/copyleft/fdl.html>
.
This section describes the status of this document at the time of its publication. Other documents might supersede this document.
This document is a working draft, produced as part of the
manakai
project. It might be updated, replaced, or obsoleted by
other documents at any time. It is inappropriate to
cite this document as other than work in progress
.
Comments on this document are welcome and may be sent to the author.
Translations of thie document might be available. The English version of the document is the only normative version.
This section is non‐normative.
This is a work-in-progress specification for DOM Document Type Definition module, as implemented by manakai and partially documented in the SuikaWiki.
The DOM Document Type Definition module is a set of DOM interfaces, including both new interfaces and modifications to existing DOM interfaces, over which DOM applications are able to access to the definitions of the document type.
Interfaces defined in this specification are partially modeled from early drafts of DOM level 1 @@ ref, DOM Abstract Schema level 3 @@ ref, and XML Schema API, but are not compatible with any of them as a whole.
The key words MUST
,
MUST NOT
,
SHOULD
,
SHOULD NOT
, and
MAY
in this
document are to be interpreted as described in
RFC
2119
[KEYWORDS].
All examples and notes in this specification are non‐normative, as are all sections explicitly marked non‐normative. Everything else in this specification is normative.
Algorithm is normative but non-normative. In addition, the order in which errors are raised is undefined.
A object is an object implementing A interface.
@@ ref to DOM Binding Spec
If the strictErrorChecking
attribute of the
Document
node is false
, the methods are
not required to raise exceptions [DOM3].
Conformant product classes: implementation, XML parser (XML document -> DOM converter), XML serializer (DOM -> XML document covnerter). XML Infoset -> DOM converter, and DOM -> XML Infoset converter.
The DOM Document Type Definition module, version 3.0,
introduces four interfaces:
DocumentXDoctype
,
DocumentTypeDefinition
,
ElementTypeDefinition
,
and AttributeDefinition
.
In addition, it modifies existing interfaces
Node
,
Document
,
DocumentType
,
Entity
, and
Notation
.
In a DOM implementation that supports the version 3.0 of
the DOM Document Type Definition module, the
hasFeature
method of a DOMImplementation
object
MUST return true
when the parameters are
set to
http://suika.fam.cx/www/2006/feature/XDoctype
and 3.0
respectively.
In such an implementation, the getFeature
method of a
Document
object MUST return the (at least
conceptually) same object implementing the
DocumentXDoctype
interface when
the parameters are set to
http://suika.fam.cx/www/2006/feature/XDoctype
and 3.0
respectively.
Likewise, any method that takes one or more feature names with or without
version number, including the methods hasFeature
and
getFeature
, MUST behave in a manner
consistent with the aforementioned cases.
Node
InterfaceThe implementation of the
Node
interface
MUST be modified as following:
// Additions to the Node interface
// Additions to the NodeType definition group
const unsigned short ELEMENT_TYPE_DEFINITION_NODE = 81001;
const unsigned short ATTRIBUTE_DEFINITION_NODE = 81002;
This specification adds two new types (subinterfaces) of
Node
: element type definition (node type
ELEMENT_TYPE_DEFINITION_NODE
,
interface
ElementTypeDefinition
) and
attribute definition (node type
ATTRIBUTE_DEFINITION_NODE
,
interface
AttributeDefinition
). For
these kinds of nodes, methods and attributes in the
Node
interface must behave as following:
attributes
On getting, the attribute MUST return
null
.
baseURI
On getting, the attribute MUST return the
value of the baseURI
attribute
of the node in the ownerDocument
attribute of the node.
Note that the value might be null
.
cloneNode
compareDocumentPosition
isDefaultNamespace
When invoked, the method MUST return
false
.
isEqualNode
For the isEqualNode
method,
following items are added to the list of conditions for equality:
If the nodes are DocumentType
and at least one of them has the support for the feature
http://suika.fam.cx/www/2006/feature/XDoctype
:
http://suika.fam.cx/www/2006/feature/XDoctype
and the length
attribute of the NamedNodeMap
object in the elementTypes
attribute of it is equal to 0
, orhttp://suika.fam.cx/www/2006/feature/XDoctype
and the values of the
elementTypes
attributes are
equal (equality of the
elementTypes
attribute is same
as that for the attributes
attribute).If the nodes are
ElementTypeDefinition
,
the values of the
attributeDefinitions
attributes are equal (equality of the
attributeDefinitions
attribute is same as that for the attributes
attribute).
If the nodes are
AttributeDefinition
,
the values of the declaredType
and
the defaultType
attributes are
equal respectively.
If the nodes are
AttributeDefinition
,
the values of the DOMStringList
objects in the
allowedTokens
attributes
are equal, i.e. their length
attribute values are equal and
each string exists in a list is contained in another list (their indeces
may be different), with an additional constraint that the number of the
items that are equal to a string in a list is equal to the number
of the items equal to the string in another list.
lookupNamespaceURI
and
lookupPrefix
When invoked, the methods MUST return
null
.
nodeName
If the node is an
ElementTypeDefinition
:
On getting, the attribute MUST return the
name of the element type definition represented by the node.
If the node is an
AttributeDefinition
:
On getting, the attribute MUST return the
name of the attribute definition represented by the node.
nodeType
On getting, the attribute MUST return
ELEMENT_TYPE_DEFINITION_NODE
(if the node is an
ElementTypeDefinition
) or
ATTRIBUTE_DEFINITION_NODE
(if the node is an
AttributeDefinition
).
Two constants are added to the NodeType
definition group of the Node
interface as
following:
Name | Value | Description |
---|---|---|
ELEMENT_TYPE_DEFINITION_NODE
| 81001 | The node is an
ElementTypeDefinition . |
ATTRIBUTE_DEFINITION_NODE
| 81002 | The node is an
AttributeDefinition . |
nodeValue
and
textContent
If the node is an
ElementTypeDefinition
:
On getting, the attributes MUST return the
name of the element type.
Thus, on setting the attributes does nothing [DOM3].
On setting, the textContent
attribute MUST NOT raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref.
@@ I forgot why this requirement is necessary.
If the node is an
AttributeDefinition
:
The getter of the [CODE(DOMa)@en[[[nodeValue]]]] attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object [['''MUST''']] return the normalized default value of the attribute. @@ [4] The getter of the [CODE(DOMa)@en[[[textContent]]]] attribute of an [CODE(DOMi)@en[[[AttributeDefinition]]]] object [['''MUST''']] behave as if it were an [CODE(DOMi)@en[[[Attr]]]] object. 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]]]].
normalize
When a DocumentType
is
normalized, any nodes in the NamedNodeMap
object in the
elementTypes
attribute
MUST be normalized as well.
When an
ElementTypeDefinition
node
is normalized, any nodes in the NamedNodeMap
object in the
attributeDefinitions
attribute MUST be normalized as well.
Document
InterfaceIf an attempt is made to adopt an
ElementTypeDefinition
or
AttributeDefinition
node,
the adoptNode
method MUST
raise a NOT_SUPPORTED_ERR
exception @@
ref.
DocumentXDoctype
InterfaceThe DocumentXDoctype
interface
MUST be implemented as following:
interface DocumentXDoctype
{
DocumentType createDocumentTypeDefinition
(in DOMString name)
raises (DOMException);
ElementTypeDefinition createElementTypeDefinition
(in DOMString name)
raises (DOMException);
AttributeDefinition createAttributeDefinition
(in DOMString name)
raises (DOMException);
Entity createGeneralEntityDefinition
(in DOMString name)
raises (DOMException);
Notation createNotation
(in DOMString name)
raises (DOMException);
}
createDocumentTypeDefinition
,
methodThis method creates a DocumentType
node with the specified
name, belonging to the document.
The name parameter is the name of the document type.
When invoked, the method MUST create and
return a DocumentType
node with the following attributes:
attributes
, parentNode
null
.elementTypes
, generalEntities
, and
notations
NamedNodeMap
objects.entities
generalEntities
attribute.childNodes
NodeList
object.internalSubset
, publicId
, and
systemId
manakaiReadOnly
[manakai]false
.nodeName
ownerDocument
Document
over which the method is invoked.In addition, the method MUST be marked as
containing five general entity declarations: amp
,
lt
, gt
, quot
, and
apos
.
createElementTypeDefinition
,
methodThis method creates a ElementTypeDefinition
node with the
specified name, belonging to the document.
The name parameter is the name of the element type defined by the element type definition.
When invoked, the method MUST create and
return an
ElementTypeDefinition
node with the following attributes:
attributeDefinitions
NamedNodeMap
object.attributes
, parentNode
null
.childNodes
NodeList
object.manakaiReadOnly
[manakai]false
.nodeName
ownerDocument
Document
node over which the method is invoked.ownerDocumentTypeDefinition
null
.createAttributeDefinition
,
methodThis method creates a AttributeDefinition
node with the
specified name, belonging to the document.
The name parameter is the name of the attribute defined by the attribute definition.
When invoked, the method MUST create and
return an
AttributeDefinition
node with the following attributes:
allowedTokens
DOMStringList
object.attributes
,
ownerElementTypeDefinition
,
and parentNode
null
.childNodes
NodeList
object.declaredType
NO_TYPE_ATTR
.defaultType
UNKNOWN_DEFAULT
.manakaiReadOnly
[manakai]false
.nodeName
ownerDocument
Document
node over which the method is invoked.@@ Should we keep these statements?:
However, if the <cfg::cfg|xml-id> configuration
parameter is set to true
and the name
is xml:id
, then the [CODE(DOMa)@en[[[declaredType]]]]
attribute is set to ID_ATTR
.
[CODE(DOMa)@en[[[defaultType]]]]?
createGeneralEntity
,
methodThis method creates a Entity
node
with the specified name, which represents a general entity, belonging to
the document.
The name parameter is the name of the general entity.
When invoked, the method MUST create and return
an Entity
node with the following
attributes:
attributes
, notationName
,
ownerDocumentTypeDefinition
,
and parentNode
null
.childNodes
NodeList
object.manakaiDeclarationBaseURI
,
manakaiEntityBaseURI
, and
manakaiEntityURI
@@ refhasReplacementTree
and
manakaiReadOnly
[manakai]false
.nodeName
ownerDocument
Document
node over which the method is invoked.publicId
, and systemId
null
.createNotation
,
methodThis method creates a Notation
node with the
specified name, belonging to the document.
The name parameter is the name of the notation.
When invoked, the method MUST create and return
a Notation
node with the following attributes:
attributes
,
ownerDocumentTypeDefinition
,
and parentNode
null
.childNodes
NodeList
object.manakaiDeclarationBaseURI
manakaiReadOnly
[manakai]false
.nodeName
ownerDocument
Document
node over which the method is invoked.publicId
and systemId
null
.These methods MUST raise an
INVALID_CHARACTER_ERR
exception @@ ref
if name is not a legal Name
according to
the XML version in use, as specified in the
xmlVersion
attribute of the Document
node.
Non‐XML case is intentionally left unspecified for now,
since DOM3 specification @@ ref does not
define it for Document
methods.
name does not have to be a namespace qualified name.
DocumentType
InterfaceA DocumentType
interface
MAY contain zero or more
ProcessingInstruction
nodes in the NodeList
object contained in the
childNodes
attribute of the
DocumentType
node.
If the DocumentType
node is created
during the process to create a DOM from an XML
document, the NodeList
object in the childNodes
object MUST contains the
ProcessingInstruction
nodes representing the processing instructions in the document type
definition of the document processed @@ ref by
the XML processor. If the
DocumentType
node is marked
as read‐only, then all the child nodes MUST
also be marked as read‐only.
If a DocumentType
node is created
from a document type declaration information item @@ ref,
the NodeList
object in the childNodes
attribute
of the node MUST contain the
ProcessingInstruction
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.
If a DocumentType
node is mapped to
a document type declaration information item, the list in the [children]
property MUST contain the processng instruction
information items created from the
ProcessingInstruction
nodes
in the NodeList
object in the childNodes
attribute
of the DocumentType
node.
The implementation of the
DocumentType
interface
MUST be modified as following:
// Modifications to the DocumentType interface
attribute DOMString publicId;
attribute DOMString systemId;
attribute DOMString internalSubset;
The publicId
attribute and the
systemId
attribute of
DocumentType
,
Entity
, and
Notation
interfaces are no longer
read‐only.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the node is read‐only @@ ref.
Otherwise, it MUST set the specified value as the value
associated to the attribute. No normalization, relative reference resolution,
or lexical validation is performed. @@ If the new
value is null
, ...
Setting an invalid identifier might make the node unserializable.
Setting a public identifier while leaveing system identifier unspecified
would also make the DocumentType
or Entity
node unserializable.
ISSUE: In HTML5, Firefox 1.5, and Opera 9, not specifying public or system identifier results in empty strings.
The internalSubset
attribute of the
DocumentType
interface is no longer
read‐only.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the node is read‐only @@ ref.
Otherwise, it MUST set the specified value as the value
associated to the attribute. No normalization, or lexical validation is
performed. @@ If the new value is null
,
...
DocumentTypeDefinition
InterfaceThis interface is a separated interface from the
DocumentType
, not a set of extensions
to the DocumentType
,
for the historical reason.
The
DocumentTypeDefinition
interface MUST be implemented as following:
interface DocumentTypeDefinition
{
readonly attribute NamedNodeMap elementTypes;
readonly attribute NamedNodeMap generalEntities;
readonly attribute NamedNodeMap notations;
ElementTypeDefinition getElementTypeDefinitionNode
(in DOMString name);
Entity getGeneralEntityNode
(in DOMString name);
Notation getNotationNode
(in DOMString name);
void setElementTypeDefinitionNode
(in DOMString node)
raises (DOMException);
void setGeneralEntityNode
(in DOMString node)
raises (DOMException);
void setNotationNode
(in DOMString node)
raises (DOMException);
}
[1] In an implementation that supports the [CODE(URI)@en[[[http://suika.fam.cx/www/2006/feature/XDoctype]]]] feature, a [CODE(DOMi)@en[[[DocumentType]]]] node must implement the [CODE(DOMi)@en[[[DocumentTypeDefinition]]]] interface. See [[DOM XML Document Type Definition]>>3] for details.
elementTypes
of
type NamedNodeMap
, read‐onlyA live NamedNodeMap
object that contains all the element
type definitions belonging to the DocumentType
node.
On getting, the attribute MUST return the
NamedNodeMap
object that contains all the
ElementTypeDefinition
nodes belonging to the DocumentType
node. The
NamedNodeMap
object MUST be read‐only
if and only if the node is read‐only. The NamedNodeMap
object MUST be live and the same object
MUST be returned for any invocation.
If the DocumentType
node is created during the process
to create a DOM from an XML document, the following
requirements are applied: The NamedNodeMap
object in the
elementType
attribute
MUST be so transformed that the object contains
the ElementTypeDefinition
nodes for the element types
whose name is presented as the Name
of the element type or
attribute definition list declarations processed by the XML
processor. If there is more than one element type declarations for an
element type, then the declarations other than the first one
MUST be ignored for the purpose of constructing the
NamedNodeMap
object.
generalEntities
of type NamedNodeMap
, read‐onlyA live NamedNodeMap
object that contains all the general
entities belonging to the DocumentType
node.
On getting, the attribute MUST return the
same value as the entities
attribute (defined in the
DocumentType
interface) of the same node.
This attribute is part of the interface for historical reason.
notations
of type
notations
, read‐only
A live NamedNodeMap
object that contains all the
notations belonging to the DocumentType
node.
On getting, the attribute MUST return the
same value as the notations
attribute (defined in the
DocumentType
interface) of the same node.
This attribute is part of the interface for historical reason.
Implementations are not required to implement the
notations
attribute twice (for DocumentType
and DocumentTypeDefinition
interfaces); they share exactly
same definition.
getElementTypeDefinitionNode
,
methodReturns the
ElementTypeDefinition
node
with the specified name.
The name parameter is the name of the element type.
When invoked, the method MUST return the
ElementTypeDefinition
node,
whose nodeName
is equal to
name, in the
NamedNodeMap
object in the
elementTypes
attribute of the
node. If there is no such node, it MUST return
null
.
getElementTypeDefinitionNode
,
methodReturns the
ElementTypeDefinition
node
with the specified name.
The name parameter is the name of the element type.
When invoked, the method MUST return the
ElementTypeDefinition
node,
whose nodeName
is equal to
name, in the
NamedNodeMap
object in the
elementTypes
attribute of the
node. If there is no such node, it MUST return
null
.
getGeneralEntityNode
,
methodReturns the Entity
node
with the specified name.
The name parameter is the name of the general entity.
When invoked, the method MUST return the
Entity
node,
whose nodeName
is equal to
name, in the
NamedNodeMap
object in the
entities
attribute of the
node. If there is no such node, it MUST return
null
.
getNotationNode
,
methodReturns the Notation>/code>
node
with the specified name.
The name parameter is the name of the notation.
When invoked, the method MUST return the
Notation
node,
whose nodeName
is equal to
name, in the
NamedNodeMap
object in the
notations
attribute of the
node. If there is no such node, it MUST return
null
.
setElementTypeDefinitionNode
,
methodsetGeneralEntityNode
,
methodsetNotationNode
,
methodA future version of this interface might define the
parameterEntities
and getter/setter for parameter entities.
ElementTypeDefinition
InterfaceThe nodes of type
ELEMENT_TYPE_DEFINITION_NODE
represents an element type definition. Such a node implements the
ElementTypeDefinition
interface, which extends the Node
interface.
An element type definition represents a definition of the element type.
It is corresponding to the element type declaration in DTD.
However, an
ElementTypeDefinition
node
does not represent the element type definition in DTD itself.
Even if there are more than one element type declarations for an element type
in DTD, the result DOM will contain only an
ElementTypeDefinition
node for that element type. In addition, if there are attribute definition
declarations for an element type, even when there is no element type
declaration for that element type, the DOM will contain an
ElementTypeDefinition
node for that element type.
The ElementTypeDefinition
interface MUST be implemented as following:
interface ElementTypeDefinition
: Node {
readonly attribute DocumentType ownerDocumentTypeDefinition;
@@ more
}
ownerDocumentTypeDefinition
of type DocumentType
, read‐onlyThe
ownerDocumentTypeDefinition
attribute of
ElementTypeDefinition
,
Entity
, and
Notation
interface contains the
DocumentType
node to which the node
is attached.
On getting, the attribute MUST return a
DocumentType
node. It
MUST be such a node that whose
elementTypes
(for an
ElementTypeDefinition
node), entities
(for an
Entity
node), or
notations
(for a
Notation
node) attribute contains the
NamedNodeMap
object that contains the node. If there is no such
a DocumentType
node,
then null
MUST be returned.
A future version of the specification might define a set of attributes and methods for representing and accessing to the content model of the element type.
AttributeDefinition
InterfaceThe nodes of type
ATTRIBUTE_DEFINITION_NODE
represents an attribute definition. Such a node implements the
AttributeDefinition
interface,
which extends the Node
interface.
An attribute definition represents a definition of the attribute
associated to an element type. It is corresponding to the attribute definition
in the attribute list declaration in DTD. However, an
AttributeDefinition
node does
not represent the attribute definition in DTD itself. Even if
there are more than one attribute definitions for an attribute of an element
type in DTD, the result DOM will contain only an
AttributeDefinition
node for
that attribute.
The AttributeDefinition
interface MUST be implemented as following:
interface AttributeDefinition
: Node {
// DeclaredValueType
const unsigned short NO_TYPE_ATTR = 0;
const unsigned short CDATA_ATTR = 1;
const unsigned short ID_ATTR = 2;
const unsigned short IDREF_ATTR = 3;
const unsigned short IDREFS_ATTR = 4;
const unsigned short ENTITY_ATTR = 5;
const unsigned short ENTITIES_ATTR = 6;
const unsigned short NMTOKEN_ATTR = 7;
const unsigned short NMTOKENS_ATTR = 8;
const unsigned short NOTATION_ATTR = 9;
const unsigned short ENUMERATION_ATTR = 10;
const unsigned short UNKNOWN_ATTR = 11;
// DefaultValueType
const unsigned short UNKNOWN_DEFAULT = 0;
const unsigned short FIXED_DEFAULT = 1;
const unsigned short REQUIRED_DEFAULT = 2;
const unsigned short IMPLIED_DEFAULT = 3;
const unsigned short EXPLICIT_DEFAULT = 4;
readonly attribute ElementTypeDefinition ownerElementTypeDefinition;
readonly attribute unsigned short declaredType;
readonly attribute unsigned short defaultType;
...
}
ownerElementTypeDefinition
of type
ElementTypeDefinition
,
read‐onlyThe
ElementTypeDefinition
to
which the AttributeDefinition
node belongs.
On getting, the attribute MUST return an
ElementTypeDefinition
node.
It MUST be such a node that whose
attributeDefinitions
attribute contains the NamedNodeMap
object that contains
the AttributeDefinition
node. If there is no such an
ElementTypeDefinition
node,
then null
MUST be returned.
declaredType
of type
unsigned short
The declared type @@ ref of the attribute.
It is expected that this attribute contains a value from the definition group
DeclaredValueType
.
On getting, the attribute MUST return the value associated to this attribute.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the
AttributeDefinition
node
is read‐only @@ ref. Otherwise, it
MUST set the specified value as the value
associated to this attribute.
If the AttributeDefinition
node is created during the process
to create a DOM from an XML document, an
appropriate value from the
DeclaredValueType
constant
group MUST be set to the attribute.
The definition group
DeclaredValueType
contains
integers indicating the declared type of attributes. The definition
group contains the following constants:
Name | Value | Description |
---|---|---|
NO_TYPE_ATTR
0 No value [INFOSET]. | | |
CDATA_ATTR
1 CDATA [XML]. | ||
ID_ATTR
2 ID [XML]. | ||
IDREF_ATTR
3 IDREF [XML]. | ||
IDREFS_ATTR
4 IDREFS [XML]. | ||
ENTITY_ATTR
5 ENTITY [XML]. | ||
ENTITIES_ATTR
6 ENTITIES [XML]. | ||
NMTOKEN_ATTR
7 NMTOKEN [XML]. | ||
NMTOKENS_ATTR
8 NMTOKENS [XML]. | ||
NOTATION_ATTR
9 NOTATION [XML]. | ||
ENUMERATION_ATTR
10 Enumeration [XML]. | | |
UNKNOWN_ATTR
11 Unknown, because no declaration for the attribute
has been read but the [all declaration processed] property
[INFOSET] would be false. | |
If no attribute type information is available, or if the source
of the information does not distinguish no value
and unknown
[INFOSET], then the value
NO_TYPE_ATTR
MUST be used.
An AttributeDefinition
node
created by the
createAttributeDefinition
method has its declaredType
attribute
set to NO_TYPE_ATTR
.
If the source of the information does not distinguish no value
and/or unknown
[INFOSET] and
CDATA
[XML], then the value
CDATA_ATTR
MUST
be used.
In Perl binding [PERLBINDING], the
Attr
nodes MUST implement the
DeclaredValueType
definition group.
defaultType
of
type unsigned short
The type of the default for the attribute. It is expected that this
attribute contains a value from the definition group
DefaultValueType
.
On getting, the attribute MUST return the value associated to this attribute.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the
AttributeDefinition
node
is read‐only @@ ref. Otherwise, it
MUST set the specified value as the value
associated to this attribute.
If the
AttributeDefinition
node is
created during the process to create a DOM from an
XML document, an appropriate value from the
DefaultValueType
definition
group MUST be set to the attribute.
The definition group
DefaultValueType
contains integers indicating the type of the default for the attribute.
The definition group contains the following constans:
Name | Value | Description |
---|---|---|
UNKNOWN_DEFAULT
| 0 | Unknown. |
FIXED_DEFAULT
| 1 | Provided explicitly and fixed @@ ref to that value. |
REQUIRED_DEFAULT
| 2 | No default value and the attribute have to be explicitly specified. |
IMPLIED_DEFAULT
| 3 | Implied @@ ref. |
EXPLICIT_DEFAULT
| 4 | Provided explicitly. |
If the source of the default type does not distinguish
implied and unknown default types, then the value
IMPLIED_DEFAULT
MUST be used.
An AttributeDefinition
node created by the
createAttributeDefinition
method has its defaultType
attribute set to
UNKNOWN_DEFAULT
.
Entity
InterfaceThe implementation of the Entity
interface MUST be modified as following:
// Modifications to the Entity interface
attribute DOMString publicId;
attribute DOMString systemId;
attribute DOMString notationName;
// Additions to the Entity interface
attribute DOMString hasReplacementTree;
readonly attribute DocumentType ownerDocumentTypeDefinition;
attribute boolean isExternallyDeclared;
The notationName
attribute of the
Entity
interface is no longer
read‐only.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the node is read‐only @@ ref.
Otherwise, it MUST set the specified value as the value
associated to the attribute. No lexical validation is performed. The new
value MAY be null
.
hasReplacementTree
of type booleanWhether the structure of the replacement text of the entity
is available via the NodeList
object in the
childNodes
attribute of the entity.
On getting, the attribute MUST return the value associated to this attribute.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the node is read‐only @@ ref.
Otherwise, it MUST set the specified value as the
value associated to this attribute.
The attribute can be set to false
even if the
Entity
node has any child node.
If the attribute is set to false
, then any child node of
the Entity
node ought to be ignored,
say, for the purpose of serialization.
When an EntityReference
node is created by cloning
the replacement subtree of the Entity
node, if the attribute is set to false
, then any descendant
of the node MUST be ignored.
If the Entity
node is created during
the process to create a DOM from an XML document,
the following requirements are applied: If the entity is an unparsed
entity, then the attribute MUST be set to
false
. Otherwise, if the entity is an external entity whose
replacement text is not available, or whose replacement text is not converted
to a replacement tree, then the attribute MUST be set
to false
. Otherwise, the attribute
MUST be set to true
.
An Entity
node created by the
createGeneralEntity
method
has its hasReplacementTree
attribute set to false
.
isExternallyDeclared
of type booleanWhether the entity is declared by an external entity declaration or
not. If the value is true
, the entity is declared in an entity
declaration in the external subset entity or in an external parameter entity.
If the value is false
, the entity is declared in an entity
declaration in the internal subset, or the node is created in memory.
On getting, the attribute MUST return the value associated to this attribute.
On setting, the attribute MUST raise a
NO_MODIFICATION_ALLOWED_ERR
@@ ref
exception if the node is read‐only @@ ref.
Otherwise, it MUST set the specified value as the
value associated to this attribute.
If the Entity
node is created during
the process to create a DOM from an XML document,
the following requirements are applied: If the entity is an unparsed
entity, then the attribute MUST be set to
false
. Otherwise, i.e. the entity is a parsed entity, then the
attribute MUST be set to the value of whether the
entity is declared by an external markup declaration or not.
Notation
InterfaceThe implementation of the Notation
interface MUST be modified as following:
// Modifications to the Notation interface
attribute DOMString publicId;
attribute DOMString systemId;
// Addition to the Notation interface
readonly attribute DocumentType ownerDocumentTypeDefinition;
<http://www.w3.org/TR/xml>
.
This version of the specification is referenced.<http://www.w3.org/TR/CSS21>
.<http://dev.w3.org/csswg/cssom/Overview.html>
.<http://dev.w3.org/2006/webapi/selectors-api/Overview.html>
.
The latest published version of the specification is available at
<http://www.w3.org/TR/selectors-api/>
.<http://www.w3.org/TR/xbl/>
.