Copyright ©1999, 2000 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This technical report provides a set of definitions for use in other specifications that need to refer to the information in an XML document.
Though this specification has already had a Last Call review on an earlier version, in light of the review and much discussion, the XML Core Working Group has reworked the specification. The WG has decided (member only) to publish this working draft as representing its latest work and invites public comment on this specification.
Comments on this document are invited and are to be sent to the public mailing list www-xml-infoset-comments@w3.org. An archive is available at http://lists.w3.org/Archives/Public/www-xml-infoset-comments/.
For background on this work, please see the XML Activity Statement. This specification is a product of the XML Core Working Group.
See XML Information Set Requirements for the specific requirements that informed development of this specification.
It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR/ .
1. Introduction
2. Information Items
2.1 The Document Information Item
2.2 Element Information Items
2.3 Attribute Information Items
2.4 Processing instruction Information Items
2.5 Unexpanded Entity Reference Information Items
2.6 Character Information Items
2.7 Comment Information Items
2.8 The Document Type Declaration Information Item
2.9 Internal Entity Information Items
2.10 External Entity Information Items
2.11 Unparsed Entity Information Items
2.12 Notation Information Items
2.13 Entity Start Marker Information Items
2.14 Entity End Marker Information Items
2.15 Namespace Information Items
2.16 CDATA Start Marker Information Items
2.17 CDATA End Marker Information Items
3. Conformance
Appendix A: References
Appendix B: XML 1.0 Reporting Requirements (informative)
Appendix C: Example
Appendix D: What is not in the Information Set
Appendix E: RDF Schema (informative)
This technical report defines an abstract data set called the XML Information Set (Infoset). Its purpose is to provide a consistent set of definitions for use in other specifications that need to refer to the information in a well-formed XML document [XML].
It does not attempt to be exhaustive; the primary criterion for inclusion of an information item or property has been that of expected usefulness in future specifications.
An XML document has an information set if it is well-formed and satisfies the namespace constraints described below. There is no requirement for an XML document to be valid in order to have an information set.
An XML document's information set consists of a number of information items (the information set for any well-formed XML document will contain at least a document information item and several others). An information item is an abstract representation of some part of an XML document: each information item has a set of associated properties. The types of information item are listed in section 2.
The XML Information Set does not require or favor a specific interface or class of interfaces. This specification presents the information set as a modified tree for the sake of clarity and simplicity, but there is no requirement that the XML Information Set be made available through a tree structure; other types of interfaces, including (but not limited to) event-based and query-based interfaces are also capable of providing information conforming to the XML Information Set. As long as the information in the information set is made available to XML applications in one way or another, the requirements of this document are satisfied.
The terms "information set" and "information item" are similar in meaning to the generic terms "tree" and "node", as they are used in computing. However, the latter terms were avoided in this document to reduce possible confusion with other specific data models. Information items do not map one-to-one with the Nodes of the DOM or the "tree" and "nodes" of the XPath data model.
XML 1.0 documents that do not conform to [Namespaces], though technically well-formed, are not considered to have meaningful information sets. That is, this report does not define an information set for documents that have element or attribute names containing colons that are used in other ways than as prescribed by [Namespaces].
Furthermore, this report does not define an information set for documents which use relative URI references in namespace declarations. This is in accordance with the decision of the W3C XML Plenary Interest Group described in [Relative Namespace URI References]. Thus the value of a [namespace name] property is always an absolute URI with an optional fragment identifier.
An information set describes its XML document with entity references already expanded, that is, represented by the information items corresponding to their replacement text. However, there are various circumstances in which a processor may not perform this expansion. An entity may not be declared, or may not be retrievable. A non-validating processor may choose not to read all declarations, and even if it does may not expand all external entities.
Note: We have not yet decided how all these cases should be represented. The definition of unexpanded entity reference is therefore likely to change.
Several information items have a [base URI] property. This is computed according to [XML Base]. Note that retrieval of a resource may involve redirection at the parser level (for example, in an entity resolver) or below; in this case the base URI is the final URI used to retrieve the resource after all redirection.
Note: In this document, the words "must", "should", and "may" assume the meanings specified in RFC 2119 [RFC2119], except that the words do not appear in upper case.
Note: To the best of the editor's knowledge and belief, the information set scheme described in this document satisfies the requirements of the XPointer-Information Set Liaison Statement [XPointer-Liaison].
An information set can contain up to seventeen different types of information items, as explained in the following sections. Every information item has properties. For ease of reference, each property is given a name, indicated [thus] .
XML Definition: document (Section 2, Documents)
XML Syntax: [1] Document (Section 2.1, Well-Formed XML Documents)
There is exactly one document information item in the information set, and all other information items are accessible from the properties of the document information item, either directly or indirectly through the properties of other information items.
The document information item has the following properties:
lt
, gt
,
amp
, apos
, and quot
)
even if they are not declared.
There is also an entity information item for the document entity.XML Definition: element (Section 3, Logical Structures)
XML Syntax: [39] Element (Section 3, Logical Structures)
There is a element information item for each element appearing in the XML document. One of the element information items corresponds to the document element (the root of the element tree), and all other element information items are children of the document element, either directly or indirectly.
An element information item has the following properties:
xmlns
) have a namespace
URI of http://www.w3.org/2000/xmlns/
.xml
which is implicitly bound to the
namespace name http://www.w3.org/XML/1998/namespace
.
It does not contain an item with the prefix xmlns
(used
for declaring prefixes), since
an application can never encounter an element or attribute with that
prefix.
The set will include namespace items corresponding to all of the
members of [namespace attributes], except for any representing
a declaration in the form xmlns=""
, which does not declare a
namespace but rather undeclares the default namespace.XML Definition: attribute (Section 3.1, Start-Tags, End-Tags, and Empty-Element Tags)
XML Syntax: [41] Attribute (Section 3.1, Start-Tags, End-Tags, and Empty-Element Tags)
There is a attribute information item for each attribute (specified or defaulted) for each element in the document, including those which are namespace declarations. The latter however appear as members of an element's [namespace attributes] property rather than its [attributes] property.
Attributes declared in the DTD with a default value of #IMPLIED
and not specified in the element's start tag are not represented by
attribute information items.
Note: The XML Information Set does not include a [children] property for attributes. The childNodes attribute provided by the Document Object Model, Level 1 Core Recommendation [DOM] is not completely and consistently specified; it cannot be the normalized value since it may contain entity references, but if it is the unnormalized value it does not contain the information about character references needed for normalization. Furthermore, DOM implementations vary in their interpretation of the attribute. The XML Core Working Group has decided that it is therefore not useful to specify a corresponding property in the XML Information Set.
An attribute information item has the following properties:
XML Definition: processing instruction (Section 2.6, Processing Instructions)
XML Syntax: [16] PI (Section 2.6, Processing Instructions)
There is one processing instruction information item for every processing instruction in the document. The XML declaration and text declarations for external parsed entities are not considered processing instructions.
A processing instruction information item has the following properties:
xml:base
attribute on elements.
XML Definition: Section 4.4.3, Included If Validating
A unexpanded entity reference information item serves as a place-holder by which an XML processor can indicate that it has not expanded an external parsed entity. There is one such information item for each unexpanded reference to an external general entity within the content of an element. A validating XML processor, or a non-validating processor that reads all external general entities, will never generate unexpanded entity reference information items for a valid document.
An unexpanded entity reference information item has the following properties:
XML Syntax: [2] Char (Section 2.2, Characters)
There is one character information item for each character that appears within the document element, either literally, as a character reference, or within a CDATA section. There is also one character information item for each character that appears in a normalized attribute value.
Note, however, that
a CR (#xD) character that is followed by an LF (#xA) character is not represented
by any information item. Furthermore, a CR character that is not
followed by an LF character is represented by an LF character information
item. These rules do not apply to CR characters created by character references
such as 
or
.
Each character is a logically separate information item, but XML applications are free to chunk characters into larger groups as necessary or desirable.
A character information item has the following properties:
XML Definition: comment (Section 2.5, Comments)
XML Syntax: [15] Comment (Section 2.5, Comments)
A comment information item corresponds to each XML comment in the original document.
A comment information item has the following properties:
XML Definition: document type declaration (section 2.8, Prolog and Document Type Declaration)
XML Syntax: [28] doctypedecl (section 2.8, Prolog and Document Type Declaration)
If the XML document has a document type declaration, then the information set contains a single document type declaration information item. Note that although entities and notations are logically part of the document type declaration, they are provided as properties of the document information item, not the document type declaration information item.
A document type declaration information item has the following properties:
XML Definition: entity (section 4, Physical Structures)
XML Syntax: [70] EntityDecl (section 4.2, Entities)
There is an internal entity information item
for each internal general entity declared in the DTD.
There are always entity information
items for the predefined entities (lt
, gt
,
amp
, apos
, and quot
)
even if they are not declared. If they are declared, their replacement
texts are those declared, otherwise they are the values given by the
example declarations in [XML].
An internal entity information item has the following properties:
XML Definition: entity (section 4, Physical Structures)
XML Syntax: [70] EntityDecl (section 4.2, Entities)
There is an external entity information item for each external general entity declared in the DTD. There is also an external entity information item for the document entity.
An external entity information item has the following properties:
XML Definition: entity (section 4, Physical Structures)
XML Syntax: [70] EntityDecl (section 4.2, Entities)
There is an unparsed entity information item for each unparsed general entity declared in the DTD.
An unparsed entity information item has the following properties:
XML Definition: notation (section 4.7, Notations)
XML Syntax: [82] NotationDecl (section 4.7, Notations)
There is one notation information item for each notation declared in the DTD.
A notation information item has the following properties:
XML Definition: entity reference (section 4.1, Character and Entity References)
XML Syntax: [68] EntityRef (section 4.1, Character and Entity References)
Entity start marker information items are inserted just before the point where information items resulting from the inclusion of a general entity as a consequence of an entity reference begins.
Entity start marker information items are not used in connection with parameter entity references in the DTD.
An entity start marker information item has the following properties:
XML Definition: entity reference (section 4.1, Character and Entity References)
XML Syntax: [68] EntityRef (section 4.1, Character and Entity References)
Entity end marker information items are inserted just after the point where information items resulting from the inclusion of a general entity as a consequence of an entity reference concludes.
Entity end marker information items are not used in connection with parameter entity references in the DTD.
An entity end marker information item has the following properties:
XML Definition: attribute (Section 3.1, Start-Tags, End-Tags, and Empty-Element Tags)
XML Syntax: [41] Attribute (Section 3.1, Start-Tags, End-Tags, and Empty-Element Tags)
There is one namespace information item for each namespace in scope for each element in the document.
A namespace information item has the following properties:
xmlns:
prefix.
If the attribute name is simply xmlns
, this property is an empty
string.XML Definition: CDATA sections (section 2.7, CDATA sections)
XML Syntax: [18] CDSect (section 2.7, CDATA Sections)
Note: The Core WG is considering removing CDATA Start and End information item on the grounds that CDATA sections should not be considered as more than syntactic sugar. Feedback on this issue is invited.
CDATA start marker information items are inserted just before the place where text embedded in a CDATA section begins.
A CDATA start marker information item has the following properties:
XML Definition: CDATA sections (section 2.7, CDATA sections)
XML Syntax: [18] CDSect (section 2.7, CDATA Sections)
CDATA end marker information items are inserted just after the place where text embedded in a CDATA section concludes.
A CDATA end marker information item has the following properties:
Since the purpose of the Information Set is to provide a set of definitions, conformance is a property of specifications that use those definitions, rather than of implementations.
Specification referring to the Infoset must:
http://www.w3.org/TR/REC-xml-names/
.
http://www.isi.edu/in-notes/rfc2119.txt
.http://www.w3.org/TR/REC-xml
.
http://www.w3.org/TR/xmlbase
.
http://www.w3.org/TR/REC-DOM-Level-1/
.
http://www.w3.org/TR/NOTE-xptr-infoset-liaison
.http://www.w3.org/2000/09/xppa
.
Although the XML 1.0 Recommendation [XML] is primarily concerned with XML syntax, it also includes some specific reporting requirements for XML processors.
The reporting requirements include errors, which are outside the scope of this specification, and document information. All of the XML 1.0 requirements for document information reporting have been integrated into the XML Information Set (numbers in parentheses refer to sections of the XML Recommendation):
Consider the following example XML document:
<?xml version="1.0"?> <msg:message doc:date="19990421" xmlns:doc="http://www.doc.example/namespaces/doc" xmlns:msg="http://www.message.example/" >Phone home!</msg:message>
The information set for this XML document contains the following information items:
http://www.message.example/
",
local part "message
",
and prefix "msg
".
http://www.doc.example/namespaces/doc
",
local part "date
",
prefix "doc
",
and normalized value "19990421
".
http://www.w3.org/XML/1998/namespace
,
http://www.doc.example/namespaces/doc
, and
http://www.message.net/
namespaces.
The following information is not represented in the current version of the XML Information Set (this list is not intended to be exhaustive):
<foo/>
and <foo></foo>
.The following RDF Schema provides a formal characterization of the Infoset. In case of disagreement between this schema and the prose in this document, the prose is normative.
<?xml version='1.0' encoding='utf-8' standalone='yes'?> <!-- this can be decoded as US-ASCII or iso-8859-1 as well, since it contains no characters outside the US-ASCII repertoire --> <!-- $Id$ --> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:rdfs='http://www.w3.org/2000/01/rdf-schema#' xmlns='http://www.w3.org/XML/2000/12/infoset-20001211#'> <!--Enumeration classes and their members--> <rdfs:Class ID='AttributeType'/> <AttributeType ID='AttributeType.ID'/> <AttributeType ID='AttributeType.IDREF'/> <AttributeType ID='AttributeType.IDREFS'/> <AttributeType ID='AttributeType.ENTITY'/> <AttributeType ID='AttributeType.ENTITIES'/> <AttributeType ID='AttributeType.NMTOKEN'/> <AttributeType ID='AttributeType.NMTOKENS'/> <AttributeType ID='AttributeType.NOTATION'/> <AttributeType ID='AttributeType.CDATA'/> <AttributeType ID='AttributeType.ENUMERATION'/> <rdfs:Class ID='Boolean'/> <Boolean ID='Boolean.true'/> <Boolean ID='Boolean.false'/> <rdfs:Class ID='Integer' rdfs:subClassOf='http://www.w3.org/2000/01/rdf-schema#Literal'/> <rdfs:Class ID='Standalone'/> <StandaloneType ID='Standalone.yes'/> <StandaloneType ID='Standalone.no'/> <!--Info item classes--> <rdfs:Class ID='InfoItem'/> <rdfs:Class ID='Document' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Element' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Attribute' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='ProcessingInstruction' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Character' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='UnexpandedEntityReference' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Comment' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='DocumentTypeDeclaration' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Entity' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='InternalEntity' rdfs:subClassOf='#Entity'/> <rdfs:Class ID='ExternalEntity' rdfs:subClassOf='#Entity'/> <rdfs:Class ID='UnparsedEntity' rdfs:subClassOf='#Entity'/> <rdfs:Class ID='Notation' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='EntityStartMarker' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='EntityEndMarker' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='Namespace' rdfs:subClassOf='#InfoItem'/>\ <rdfs:Class ID='CDATAStartMarker' rdfs:subClassOf='#InfoItem'/> <rdfs:Class ID='CDATAEndMarker' rdfs:subClassOf='#InfoItem'/> <!--Set containers--> <rdfs:Class ID='InfoItemSet' rdfs:subClassOf='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/> <rdfs:Class ID='AttributeSet' rdfs:subClassOf='#InfoItemSet'/> <rdfs:Class ID='EntitySet' rdfs:subClassOf='#InfoItemSet'/> <rdfs:Class ID='NamespaceSet' rdfs:subClassOf='#InfoItemSet'/> <rdfs:Class ID='NotationSet' rdfs:subClassOf='#InfoItemSet'/> <!--Sequence container--> <rdfs:Class ID='InfoItemSeq' rdfs:subClassOf='http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq'/> <!--Info item properties--> <rdfs:Property ID='attributes'> <rdfs:domain resource='#Element'/> <rdfs:range resource='#AttributeSet'/> </rdfs:Property> <rdfs:Property ID='attributeType'> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='#AttributeType'/> </rdfs:Property> <rdfs:Property ID='baseURI'> <rdfs:domain resource='#Document'/> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#ProcessingInstruction'/> <rdfs:domain resource='#ExternalEntity'/> <rdfs:range resource='http://www.w3.org/TR/1999/PR-rdf-schema-19990303#Literal'/> </rdfs:Property> <rdfs:Property ID='characterCode'> <rdfs:domain resource='#Character'/> <rdfs:range resource='#Integer'/> </rdfs:Property> <rdfs:Property ID='charset'> <rdfs:domain resource='#ExternalEntity'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='children'> <rdfs:domain resource='#Document'/> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#DocumentTypeDeclaration'/> <rdfs:range resource='#InfoItemSeq'/> </rdfs:Property> <rdfs:Property ID='content'> <rdfs:domain resource='#ProcessingInstruction'/> <rdfs:domain resource='#Comment'/> <rdfs:domain resource='#InternalEntity'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='namespaceAttributes'> <rdfs:domain resource='#Element'/> <rdfs:range resource='#AttributeSet'/> </rdfs:Property> <rdfs:Property ID='documentElement'> <rdfs:domain resource='#Document'/> <rdfs:range resource='#Element'/> </rdfs:Property> <rdfs:Property ID='documentEntity'> <rdfs:domain resource='#Document'/> <rdfs:range resource='#ExternalEntity'/> </rdfs:Property> <rdfs:Property ID='elementContentWhitespace'> <rdfs:domain resource='#Character'/> <rdfs:range resource='#Boolean'/> </rdfs:Property> <rdfs:Property ID='entity'> <rdfs:domain resource='#UnexpandedEntityReference'/> <rdfs:domain resource='#EntityStartMarker'/> <rdfs:domain resource='#EntityEndMarker'/> <rdfs:range resource='#Entity'/> </rdfs:Property> <rdfs:Property ID='entities'> <rdfs:domain resource='#Document'/> <rdfs:range resource='#EntitySet'/> </rdfs:Property> <rdfs:Property ID='inScopeNamespaces'> <rdfs:domain resource='#Element'/> <rdfs:range resource='#NamespaceSet'/> </rdfs:Property> <rdfs:Property ID='localName'> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='name'> <rdfs:domain resource='#UnexpandedEntityReference'/> <rdfs:domain resource='#InternalEntity'/> <rdfs:domain resource='#ExternalEntity'/> <rdfs:domain resource='#Notation'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='namespaceName'> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#Attribute'/> <rdfs:domain resource='#Namespace'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='normalizedValue'> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='notation'> <rdfs:domain resource='#UnparsedEntity'/> <rdfs:range resource='#Notation'/> </rdfs:Property> <rdfs:Property ID='notations'> <rdfs:domain resource='#Document'/> <rdfs:range resource='#NotationSet'/> </rdfs:Property> <rdfs:Property ID='ownerElement'> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='#Element'/> </rdfs:Property> <rdfs:Property ID='parent'> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#ProcessingInstruction'/> <rdfs:domain resource='#Character'/> <rdfs:domain resource='#UnexpandedEntityReference'/> <rdfs:domain resource='#Comment'/> <rdfs:domain resource='#DocumentTypeDeclaration'/> <rdfs:domain resource='#EntityStartMarker'/> <rdfs:domain resource='#EntityEndMarker'/> <rdfs:domain resource='#CDATAStartMarker'/> <rdfs:domain resource='#CDATAEndMarker'/> <rdfs:range resource='#InfoItem'/> </rdfs:Property> <rdfs:Property ID='prefix'> <rdfs:domain resource='#Namespace'/> <rdfs:domain resource='#Element'/> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='publicIdentifier'> <rdfs:domain resource='#ExternalEntity'/> <rdfs:domain resource='#UnparsedEntity'/> <rdfs:domain resource='#DocumentTypeDeclaration'/> <rdfs:domain resource='#Notation'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='specified'> <rdfs:domain resource='#Attribute'/> <rdfs:range resource='#Boolean'/> </rdfs:Property> <rdfs:Property ID='standalone'> <rdfs:domain resource='#Document'/> <rdfs:range resource='#Standalone'/> </rdfs:Property> <rdfs:Property ID='systemIdentifier'> <rdfs:domain resource='#ExternalEntity'/> <rdfs:domain resource='#UnparsedEntity'/> <rdfs:domain resource='#DocumentTypeDeclaration'/> <rdfs:domain resource='#Notation'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='target'> <rdfs:domain resource='#ProcessingInstruction'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> <rdfs:Property ID='version'> <rdfs:domain resource='#Document'/> <rdfs:range resource='http://www.w3.org/2000/01/rdf-schema#Literal'/> </rdfs:Property> </rdf:RDF>