This appendix contains the mappings between the XML Information Set
[XML Information set] model and the Document Object Model.
Starting from a Document
node, each information
item is mapped to its respective Node
, and each
Node
is mapped to its respective information
item. As used in the Infoset specification, the Infoset
property names are shown in square brackets, [thus].
Unless specified, the Infoset to DOM node mapping makes no
distinction between unknown and no value since both will be exposed
as null
.
An document information item maps to a
Document
node. The attributes of the corresponding
Document
node are constructed as follows:
Attribute | Value |
---|---|
Node.nodeName |
"#document" |
Node.nodeValue |
null |
Node.nodeType |
Node.DOCUMENT_NODE |
Node.parentNode |
null |
Node.childNodes |
A NodeList containing the information items
in the [children] property
|
Node.firstChild |
The first node contained in Node.childNodes |
Node.lastChild |
The last node contained in Node.childNodes |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument |
null |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI |
same as Document.documentURI |
Node.textContent |
null |
Document.doctype | The document type information item |
Document.implementation |
The DOMImplementation object used to create
this node |
Document.documentElement | The [document element] property |
Document.actualEncoding | the actual encoding of the document if available |
Document.xmlEncoding | The [character encoding scheme] property |
Document.xmlStandalone | The [standalone] property |
Document.xmlVersion | The [version] property |
Document.strictErrorChecking |
true |
Document.documentURI | The [base URI] property |
Document.config |
A DOMConfiguration object whose parameters
are set to their default values |
Note:
The [all declarations processed] property is not exposed through
the Document
node.
A Document
node maps to an document
information item. Document
nodes with no
namespace URI (Node.namespaceURI
equals to
null
) cannot be represented using the Infoset. The
properties of the corresponding document information
item are constructed as follows:
Property | Value |
---|---|
[children] |
Node.childNodes |
[document element] |
Document.documentElement |
[notations] |
DocumentType.notations |
[unparsed entities] |
The information items from
DocumentType.entities , whose
Node.childNodes is an empty list |
[base URI] |
Document.documentURI |
[character encoding scheme] |
Document.xmlEncoding |
[standalone] |
Document.xmlStandalone |
[version] |
Document.xmlVersion |
[all declarations processed] | The value is implementation dependent |
An element information item maps to a
Element
node. The attributes of the corresponding
Element
node are constructed as follows:
Attribute | Value |
---|---|
Node.nodeName |
same as Element.tagName |
Node.nodeValue |
null |
Node.nodeType |
Node.ELEMENT_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
A NodeList containing the information items
in the [children] property
|
Node.firstChild |
The first node contained in Node.childNodes |
Node.lastChild |
The last node contained in Node.childNodes |
Node.previousSibling | The information item preceding the current one on the [children] property contained in the [parent] property |
Node.nextSibling | The information item following the current one on the [children] property contained in the [parent] property |
Node.attributes | The information items contained in the [attributes] and [namespace attributes] properties |
Node.ownerDocument | The document information item |
Node.namespaceURI | The [namespace name] property |
Node.prefix | The [prefix] property |
Node.localName | The [local name] property |
Node.baseURI | The [base URI] property |
Node.textContent |
Concatenation of the Node.textContent
attribute value of every child node, excluding
COMMENT_NODE and
PROCESSING_INSTRUCTION_NODE nodes. This is
the empty string if the node has no children. |
Element.tagName | If the [prefix] property has no value, this contains the [local name] property. Otherwise, this contains the concatenation of the [prefix] property, the colon ':' character, and the [local name] property. |
Element.schemaTypeInfo |
A TypeInfo object whose
TypeInfo.typeNamespace and
TypeInfo.typeName are inferred from the
schema in use if available.
|
Note:
The [in-scope namespaces] property is not exposed through the
Element
node.
An Element
node maps to an element
information item. Element
nodes with no
namespace URI (Node.namespaceURI
equals to
null
) cannot be represented using the
Infoset. Because the Infoset only represents unexpanded entity
references, non-empty EntityReference
nodes
contained in Node.childNodes
need to be replaced by
their content. DOM applications could use the
Document.normalizeDocument()
method for that effect
with the "entities"
parameter set to false
. The properties of the
corresponding element information item are
constructed as follows:
Property | Value |
---|---|
[namespace name] |
Node.namespaceURI |
[local name] |
Node.localName |
[prefix] |
Node.prefix |
[children] |
Node.childNodes , whose
expanded entity references (EntityReference
nodes with children) have been replaced with
their content. |
[attributes] |
The nodes contained in Node.attributes ,
whose Node.namespaceURI value is different
from "http://www.w3.org/2000/xmlns/" |
[namespace attributes] |
The nodes contained in Node.attributes ,
whose Node.namespaceURI value is
"http://www.w3.org/2000/xmlns/" |
[in-scope namespaces] |
The namespace information items computed using the
[namespace attributes] properties of this node and
its ancestors. If the [DOM Level 3 XPath] module is supported, the namespace
information items can also be computed from the
XPathNamespace nodes.
|
[base URI] |
Node.baseURI |
[parent] |
Node.parentNode |
An attribute information item map to
a Attr
node. The attributes of the corresponding
Attr
node are constructed as follows:
Attribute/Method | Value |
---|---|
Node.nodeName |
same as Attr.name |
Node.nodeValue |
same as Attr.value |
Node.nodeType |
Node.ATTRIBUTE_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
A NodeList containing one Text
node whose text content is the same as
Attr.value .
|
Node.firstChild |
The Text node contained in Node.childNodes |
Node.lastChild |
The Text node contained in Node.childNodes |
Node.previousSibling |
The Text node contained in Node.childNodes |
Node.nextSibling |
The Text node contained in Node.childNodes |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI | The [namespace name] property |
Node.prefix | The [prefix] property |
Node.localName | The [local name] property |
Node.baseURI | The [base URI] property of the parent element if any |
Node.textContent |
the value of Node.textContent of the
Text child.
same as Node.nodeValue (since this
attribute node only contains one Text node) |
Attr.name | If the [prefix] property has no value, this contains the [local name] property. Otherwise, this contains the concatenation of the [prefix] property, the colon ':' character, and the [local name] property. |
Attr.specified | The [specified] property |
Attr.value | The [normalized value] property |
Attr.ownerElement | The [owner element] property |
Attr.schemaTypeInfo |
A TypeInfo object whose
TypeInfo.typeNamespace is null
and TypeInfo.typeName is the [attribute type]
property
|
Attr.isId() |
if the [attribute type] property is ID, this method return
true
|
An Attr
node maps to an attribute information
item. Attr
nodes with no namespace URI
(Node.namespaceURI
equals to null
)
cannot be represented using the Infoset. The properties of the
corresponding attribute information item are
constructed as follows:
Property | Value |
---|---|
[namespace name] |
Node.namespaceURI |
[local name] |
Node.localName |
[prefix] |
Node.prefix |
[normalized value] |
Attr.value |
[specified] |
Attr.specified |
[attribute type] |
Using the TypeInfo object referenced from
Attr.schemaTypeInfo , the value of
TypeInfo.typeName if
TypeInfo.typeNamespace is
null .
|
[references] |
if the computed [attribute type] property is IDREF,
IDREFS, ENTITY, ENTITIES, or NOTATION, the value of this
property is an ordered list of the element, unparsed
entity, or notation information items referred to in the
attribute value, in the order that they appear there. The
ordered list is computed using
Document.getElementById ,
DocumentType.entities , and
DocumentType.notations .
|
[owner element] |
Attr.ownerElement |
A processing instruction information item map to a
ProcessingInstruction
node. The attributes of the
corresponding ProcessingInstruction
node are
constructed as follows:
Attribute | Value |
---|---|
Node.nodeName |
same as ProcessingInstruction.target |
Node.nodeValue |
same as ProcessingInstruction.data |
Node.nodeType |
Node.PROCESSING_INSTRUCTION_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI |
The [base URI] property of the parent element if
any. The [base URI] property of the processing instruction
information item is not exposed through the
ProcessingInstruction node. |
Node.textContent |
same as Node.nodeValue |
ProcessingInstruction.target | The [target] property |
ProcessingInstruction.data | The [content] property |
A ProcessingInstruction
node maps to an
processing instruction information item. The
properties of the corresponding processing instruction
information item are constructed as follows:
Property | Value |
---|---|
[target] |
ProcessingInstruction.target |
[content] |
ProcessingInstruction.data |
[base URI] |
Node.baseURI |
[notation] |
The Notation node named by the target and if
available from DocumentType.notations
|
[parent] |
Node.parentNode |
An unexpanded entity reference information item
maps to a EntityReference
node. The attributes of
the corresponding EntityReference
node are
constructed as follows:
Attribute | Value |
---|---|
Node.nodeName | The [name] property |
Node.nodeValue |
null |
Node.nodeType |
Node.ENTITY_REFERENCE_NODE |
Node.parentNode | the [parent] property |
Node.childNodes |
Empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI | The [declaration base URI] property |
Node.textContent |
null (the node has no children) |
Note:
The [system identifier] and [public identifier] properties are
not exposed through the EntityReference
node.
An EntityReference
node maps to an unexpanded
entity reference information
item. EntityReference
nodes with children
(Node.childNodes
contains a non-empty list) cannot
be represented using the Infoset. The properties of the
corresponding unexpanded entity reference information
item are constructed as follows:
Property | Value |
---|---|
[name] |
Node.nodeName |
[system identifier] |
The Entity.systemId value of the
Entity node available from
DocumentType.entities if available |
[public identifier] |
The Entity.publicId value of the
Entity node available from
DocumentType.entities if available |
[declaration base URI] |
Node.baseURI |
[parent] |
Node.parentNode |
Consecutive character information items map to a
Text
node. The attributes of the corresponding
Text
node are constructed as follows:
Attribute/Method | Value |
---|---|
Node.nodeName |
"#text" |
Node.nodeValue |
same as CharacterData.data |
Node.nodeType |
Node.TEXT_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI | The [base URI] property of the parent element if any |
Node.textContent |
same as Node.nodeValue |
CharacterData.data |
A DOMString including all ISO character code
contained in the character information items
|
CharacterData.length | The number of 16-bit units needed to encode all ISO character code contained in the character information items using the UTF-16 encoding. |
Text.isWhitespaceInElementContent() | The [element content whitespace] property |
Text.wholeText |
same as CharacterData.data |
Note: By construction, the values of the [parent] and [element content whitespace] properties are necessarily the sames for all consecutive character information items.
The text content of a Text
or a
CDATASections
node maps to a sequence of
character information items. The number of items is
less or equal to CharacterData.length
. Text nodes
contained in Attr
nodes are mapped to the Infoset
using the Attr.value
attribute. Text nodes
contained in Document
nodes cannot be represented
using the Infoset. The properties of the corresponding
character information items are constructed as
follows:
Property | Value |
---|---|
[character code] |
The ISO character code produced using one or two
16-bit units from CharacterData.data |
[element content whitespace] |
The return value of the
Text.isWhitespaceInElementContent() method |
[parent] |
Node.parentNode |
A comment information item maps to a
Comment
node. The attributes of the corresponding
Comment
node are constructed as follows:
Attribute | Value |
---|---|
Node.nodeName |
"#comment" |
Node.nodeValue |
same as CharacterData.data |
Node.nodeType |
Node.COMMENT_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI | The [base URI] property of the parent element or parent document if any |
Node.textContent |
same as Node.nodeValue |
CharacterData.data | The [content] property encoded using the UTF-16 encoding. |
CharacterData.length | The number of 16-bit units needed to encode all ISO character code contained in the [content] property using the UTF-16 encoding. |
A Comment
maps to a comment information
item. The properties of the corresponding comment
information item are constructed as follows:
Property | Value |
---|---|
[content] |
CharacterData.data |
[parent] |
Node.parentNode |
A document type declaration information item maps
to a DocumentType
node. The attributes of the
corresponding DocumentType
node are constructed as
follows:
Attribute | Value |
---|---|
Node.nodeName |
same as DocumentType.name |
Node.nodeValue |
null |
Node.nodeType |
Node.DOCUMENT_TYPE_NODE |
Node.parentNode | The [parent] property |
Node.childNodes |
empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI |
null |
Node.textContent |
null |
DocumentType.name | The name of the document element. |
DocumentType.entities | The [unparsed entities] property available from the document information item. |
DocumentType.notations | The [notations] property available from the document information item. |
DocumentType.publicId | The [public identifier] property |
DocumentType.systemId | The [system identifier] property |
DocumentType.internalSubset | The value is implementation dependent |
Note:
The [children] property is not exposed through the
DocumentType
node.
A DocumentType
maps to a document type
declaration information item. The properties of the
corresponding document type declaration information
item are constructed as follows:
Property | Value |
---|---|
[system identifier] |
DocumentType.systemId |
[public identifier] |
DocumentType.publicId |
[children] | The value of this property is implementation dependent |
[parent] |
Node.parentNode |
An unparsed entity information item maps to
a Entity
node. The attributes of the corresponding
Entity
node are constructed as follows:
Attribute | Value |
---|---|
Node.nodeName | The [name] property |
Node.nodeValue |
null |
Node.nodeType |
Node.ENTITY_NODE |
Node.parentNode |
null |
Node.childNodes |
Empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI | The [declaration base URI] property |
Node.textContent |
"" (the node has no children) |
Entity.publicId | The [public identifier] property |
Entity.systemId | The [system identifier] property |
Entity.notationName | The [notation name] property |
Entity.actualEncoding |
null |
Entity.xmlEncoding |
null |
Entity.xmlVersion |
null |
An Entity
node maps to an unparsed entity
information item. Entity
nodes with children
(Node.childNodes
contains a non-empty list) cannot
be represented using the Infoset. The properties of the
corresponding unparsed entity information item are
constructed as follows:
Property | Value |
---|---|
[name] |
Node.nodeName |
[system identifier] |
Entity.systemId |
[public identifier] |
Entity.publicId |
[declaration base URI] |
Node.baseURI |
[notation name] |
Entity.notationName |
[notation] |
The Notation node referenced from
DocumentType.notations whose name is the
[notation name] property |
A notation information item maps to a
Notation
node. The attributes of the corresponding
Notation
node are constructed as follows:
Attribute | Value |
---|---|
Node.nodeName | The [name] property |
Node.nodeValue |
null |
Node.nodeType |
Node.NOTATION_NODE |
Node.parentNode |
null |
Node.childNodes |
Empty NodeList |
Node.firstChild |
null |
Node.lastChild |
null |
Node.previousSibling |
null |
Node.nextSibling |
null |
Node.attributes |
null |
Node.ownerDocument | The document information item |
Node.namespaceURI |
null |
Node.prefix |
null |
Node.localName |
null |
Node.baseURI | The [declaration base URI] property |
Node.textContent |
null |
Notation.publicId | The [public identifier] property |
Notation.systemId | The [system identifier] property |
A Notation
maps to a notation information
item. The properties of the corresponding notation
information item are constructed as follows:
Property | Value |
---|---|
[name] |
Node.nodeName |
[system identifier] |
Notation.systemId |
[public identifier] |
Notation.publicId |
[parent] |
Node.parentNode |