W3C

XML processor profiles

W3C Working Draft 12 April 2011

This version:
http://www.w3.org/TR/2011/WD-xml-proc-profiles-20110412/
Latest version:
http://www.w3.org/TR/xml-proc-profiles/
Previous versions:
http://www.w3.org/TR/2010/WD-xml-proc-profiles-20101130/ http://www.w3.org/TR/2010/WD-xml-proc-profiles-20101021/ http://www.w3.org/TR/2010/WD-xml-proc-profiles-20100518/
Editors:
Henry S. Thompson, University of Edinburgh <ht@inf.ed.ac.uk>
Norman Walsh, MarkLogic Corporation <norman.walsh@marklogic.com>

This document is also available in these non-normative formats: XML and Showing diffs from previous LCWD.


Abstract

This specification defines several XML processor profiles, each of which fully determines a data model for any given XML document. It is intended as a resource for other specifications, which can by a single normative reference establish precisely what input processing they require.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This is a public Working Draft for review by W3C members and other interested parties. This document is a product of the XML Processing Model Working Group which is part of the W3C XML Activity. The English version of this specification is the only normative version. However, for translations of this document, see http://www.w3.org/2003/03/Translations/byTechnology?technology=xproc.

This is a Last Call Working Draft for review by W3C members and other interested parties. It contains one significant addition to previous drafts: reporting requirements for each profile, specified in terms of a tabulation and categorization of information supplied by XML processors to applications. Once again it is the Working Group's intention, since this specification is not implementable as such, that no Candidate Recommendation version will be published, and that the next step for this specification will be to Proposed Recommendation—interested parties please take note and comment accordingly.

The effective deadline for comments is 16 May 2011. Please send comments on this draft to the public mailing list public-xml-processing-model-comments@w3.org (public archives are available).

As this specification is intended for use by other specifications which themselves define one or more XML languages, the Working Group particularly welcomes input for other Working Groups who are responsible for such specifications.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents

1 Background
    1.1 Terminology
2 XML processor profiles
    2.1 The minimum XML processor profile
    2.2 The basic XML processor profile
    2.3 The modest XML processor profile
    2.4 The recommended XML processor profile
3 Classes of Information
4 Invariants
    4.1 Data model invariants within a given profile
    4.2 Data model variation between profiles
        4.2.1 Between minimum and richer profiles
        4.2.2 Between basic and richer profiles
        4.2.3 Between modest and recommended profiles
5 Other profiles (non-normative)
6 Conformance

Appendix

A References
    A.1 Normative References
    A.2 Non-normative References


1 Background

The XML specification [Extensible Markup Language (XML) 1.0 (Fifth Edition)] defines an XML processor as "a software module. . .used to read XML documents and provide access to their content and structure. . .on behalf of another module, called the application." XML applications are often defined by building on top of the [XML Information Set] vocabulary or XML data models such as [XML Path Language (XPath) Version 1.0] or [XQuery 1.0 and XPath 2.0 Data Model (XDM)], understood as the output of an XML processor. Such definitions have suffered to some extent from an uncertainty inherent in using that kind of foundation, in that the mapping XML processors perform from XML documents to data model is not rigid. Some of this stems from the XML specification itself, which is not always explicit about what information must be passed from processor to application, and which also leaves open the possiblity of reading and interpreting external entities, or not. Another kind of uncertainty stems from the growth of the XML family of specifications: if the input document includes uses of XInclude, for instance.

This specification addresses this issue by defining several XML processor profiles, each of which fully determines a data model for any given XML document. It is intended as a resource for other specifications, which can by a single normative reference establish precisely what input processing they require.

The profiles defined here are appropriate for processing both XML 1.0 [Extensible Markup Language (XML) 1.0 (Fifth Edition)] and XML 1.1 [Extensible Markup Language (XML) 1.1 (Second Edition)] documents. References to XML or XML Namespaces below should be understood as references to 1.0 or 1.1 as required by the relevant document or application.

1.1 Terminology

[Definition: The key words must, must not, required, shall, shall not, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC 2119].]

The term base URI is used in this specification as it is defined in [RFC 3986].

2 XML processor profiles

All of the profiles describe the steps necessary to construct a data model from a well-formed and namespace well-formed XML document. This specification does not consider documents that are not namespace well-formed. Documents which are not well-formed are not XML.

Each profile is defined in terms of comformance requirements with respect to various XML-family specifications, and in terms of requirements on the information it provides to applications. Information provision requirements are specified by reference to classes of information items and properties, as further defined in 3 Classes of Information.

2.1 The minimum XML processor profile

The minimum approach to the construction of a data model requires the following:

  1. Processing of the document as required of conformant non-validating XML processors without reading any external markup declarations;

  2. Maintenance of the base URI of each element in conformance with [XML Base];

  3. Faithful provision of the information in the document corresponding to information items and properties in classes A, B', P and X;

2.2 The basic XML processor profile

The basic approach to the construction of a data model requires the following:

  1. Processing of the document as required of conformant non-validating XML processors without reading any external markup declarations;

  2. Maintenance of the base URI of each element in conformance with [XML Base];

  3. Identification of all xml:id attributes as IDs as required by [xml:id Version 1.0]

  4. Faithful provision of the information in the document corresponding to information items and properties in classes A, B', P and X;

2.3 The modest XML processor profile

The modest approach to the construction of a data model requires the following:

  1. Processing of the document as required of conformant non-validating XML processors while reading and processing all external markup declarations;

  2. Maintenance of the base URI of each element in conformance with [XML Base];

  3. Identification of all xml:id attributes as IDs as required by [xml:id Version 1.0]

  4. Faithful provision of the information in the document corresponding to information items and properties in classes A, B and X;

2.4 The recommended XML processor profile

The recommended approach to the construction of a data model requires the following:

  1. Processing of the document as required of conformant non-validating XML processors while reading and processing all external markup declarations;

  2. Maintenance of the base URI of each element in conformance with [XML Base];

  3. Identification of all xml:id attributes as IDs as required by [xml:id Version 1.0]

  4. Replacement of all include elements in the XInclude namespace, and namespace, xml:base and xml:lang fixup of the result, as required for conformance to [XML Inclusions (XInclude) Version 1.0 (Second Edition)];

  5. Faithful provision of the information in the document corresponding to information items and properties in classes A, B and X.

The following [XProc: An XML Pipeline Language] pipeline implements the 2.4 The recommended XML processor profile when executed by a conformant XProc processor which

  • Processes its input as required by point (1) above;

  • Recognizes and preserves the ID type of all xml:id attributes in conformance with [xml:id Version 1.0].

3 Classes of Information

For the profile definitions above and the invariants below, we categorize the information expressed in XML documents into a number of (overlapping) classes. What follows is a complete tabulation of all the information items and their properties from [XML Information Set], annotated with one or more class labels.

Class AClass A

Items and properties which must be provided by all profiles.

Class BClass B

Items and properties which must be provided by 2.3 The modest XML processor profile and 2.4 The recommended XML processor profile

Class B'Class B'

Items and properties which must be provided by 2.1 The minimum XML processor profile and 2.2 The basic XML processor profile

Class PClass P

Items and properties which depend on declarations. For 2.1 The minimum XML processor profile and 2.2 The basic XML processor profile, they will not be provided if the relevant declaration is in an unprocessed external entity, or is after the first reference to an external entity which is not processed.

Class VClass V

Items and properties which will be present for validating processors, but for which support by non-validating processors is implementation-defined. Non-validating processors should document whether they provide this information to applications or not.

Class XClass X

Items and properties for which support is implementation-defined. Processors should document whether they provide this information to applications or not.

Note:

It is the information itself which is being labelled, not the particular packaging of it implied by the items and properties used in [XML Information Set]. For example, a data model that exposes the information packaged as Character Information Items in [XML Information Set] as an array of strings is in that regard satisfying requirement (3) of 2.1 The minimum XML processor profile.

Document Information ItemDocument Information Item
the item itselfA
[children]X
[document element]A
[notations]B, P
[unparsed entities]B, P
[base URI]A
[character encoding scheme]A
[standalone]A
[version]A
[all declarations processed]A
Element Information ItemElement Information Item
the item itselfA
[namespace name]A
[local name]A
[prefix]A
[children]A
[attributes]A
[namespace attributes]A
[in-scope namespaces]A
[base URI]A
[parent]A
Attribute Information ItemAttribute Information Item
the item itselfA
[namespace name]A
[local name]A
[prefix]A
[normalized value]B, P
[specified]A
[attribute type]B, P
[references] to Element Information Items, i.e. for attributes of types IDREF and IDREFSB, P
[references] to Notation and Unparsed Entity Information Items, i.e. for attributes of types ENTITY, ENTITIES and NOTATIONX
[owner element]A
Processing Instruction Information ItemProcessing Instruction Information Item
the item itselfA
[target]A
[content]A
[base URI]A
[notation]X
[parent]A
Unexpanded Entity Reference Information ItemUnexpanded Entity Reference Information Item

Note:

This type of information item will not occur at all if standalone="yes"

the item itselfB'
all propertiesB'
Character Information ItemCharacter Information Item
the item itselfA
[character code]A
[element content whitespace]V
[parent]A
Comment Information ItemComment Information Item
the item itselfA
[content]A
[parent]A
Document Type Declaration Information ItemDocument Type Declaration Information Item
the item itselfX
all propertiesX
Unparsed Entity Information ItemUnparsed Entity Information Item
the item itselfB, P
all propertiesB, P
Notation Information ItemNotation Information Item
the item itselfB, P
all propertiesB, P
Namespace Information ItemNamespace Information Item
the item itselfA
[prefix]A
[namespace name]A

4 Invariants

Data models constructed in conformance with one of the profiles defined above will be guaranteed to share certain properties. The following sub-sections describe this in terms of invariants with respect to the information available in the data model.

4.2 Data model variation between profiles

When two data models are constructed in conformance with the two different profiles from a given namespace-well-formed XML document, the information contained therein will in some cases (depending on the specifics of the document in question) differ with repect to the following information items and properties (leaving aside the items and properties classified as implementation-defined above):

5 Other profiles (non-normative)

The profiles defined here, particularly the 2.4 The recommended XML processor profile, can be used as a starting point for the definition of further profiles. For example, the media type registrations for stylesheet languages applicable to XML such as application/xslt+xml or text/css might define a profile specifying appropriate <?xml-stylesheet type="[their media type]" . . .?> processing in addition to the processing required by 2.4 The recommended XML processor profile.

6 Conformance

Conformance is a matter for any specification which references this one to mandate, expressed in terms such as "Conforming implementations must construct input data models from XML documents as required by the recommended XML processor profile."

A References

A.1 Normative References

XML Information Set
XML Information Set, World Wide Web Consortium. Most recent edition (the second) is dated 04 Feb 2004, John Cowan and Richard Tobin, Editors. The latest version is available at http://www.w3.org/TR/xml-infoset/.
RFC 2119
RFC 2119: Key words for use in RFCs to Indicate Requirement Levels. Internet Engineering Task Force, 1997.
RFC 3986
RFC 3986: Uniform Resource Identifier (URI): Generic Syntax. Internet Engineering Task Force, 2005.
XProc: An XML Pipeline Language
XProc: An XML Pipeline Language, Norman Walsh, Alex Milowski, and Henry S. Thompson, Editors. World Wide Web Consortium, 9 March 2010. This version is http://www.w3.org/TR/2010/REC-xproc-20100309/. The latest version is available at http://www.w3.org/TR/xproc/.
xml:id Version 1.0
xml:id Version 1.0, Norman Walsh, Daniel Veillard, and Jonathan Marsh, Editors. World Wide Web Consortium, 09 Sep 2005. This version is http://www.w3.org/TR/2005/REC-xml-id-20050909/. The latest version is available at http://www.w3.org/TR/xml-id/.
XML Inclusions (XInclude) Version 1.0 (Second Edition)
XML Inclusions (XInclude) Version 1.0 (Second Edition), David Orchard, Jonathan Marsh, and Daniel Veillard, Editors. World Wide Web Consortium, 15 Nov 2006. This version is http://www.w3.org/TR/2006/REC-xinclude-20061115/. The latest version is available at http://www.w3.org/TR/xinclude/.
Extensible Markup Language (XML) 1.0 (Fifth Edition)
Extensible Markup Language (XML) 1.0 (Fifth Edition), Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, et. al., Editors. World Wide Web Consortium, 28 Nov 2008. This version is http://www.w3.org/TR/2008/REC-xml-20081126/. The latest version is available at http://www.w3.org/TR/xml/.
Extensible Markup Language (XML) 1.1 (Second Edition)
Extensible Markup Language (XML) 1.1 (Second Edition), Tim Bray, John Cowan, Jean Paoli, et. al., Editors. World Wide Web Consortium, 16 Aug 2006. This version is http://www.w3.org/TR/2006/REC-xml11-20060816/. The latest version is available at http://www.w3.org/TR/xml11/.
Namespaces in XML 1.0 (Third Edition)
Namespaces in XML 1.0 (Third Edition), Tim Bray, Dave Hollander, Richard Tobin, and Andrew Layman, Editors. World Wide Web Consortium, 16 Aug 2006. This version is http://www.w3.org/TR/2006/REC-xml-names-20060816/. The latest version is available at http://www.w3.org/TR/xml-names/.
Namespaces in XML 1.1 (Second Edition)
Namespaces in XML 1.1 (Second Edition), Tim Bray, Dave Hollander, Andrew Layman, and Richard Tobin, Editors. World Wide Web Consortium, 16 Aug 2006. This version is http://www.w3.org/TR/2006/REC-xml-names11-20060816/. The latest version is available at http://www.w3.org/TR/xml-names11/.
XML Base
XML Base (Second Edition), Jonathan Marsh, Editor. World Wide Web Consortium, 28 January 2009. This version is http://www.w3.org/TR/2001/REC-xmlbase-20090128/. The latest version is available at http://www.w3.org/TR/xmlbase/.

A.2 Non-normative References

XML Path Language (XPath) Version 1.0
XML Path Language (XPath) Version 1.0, James Clark and Steven DeRose, Editors. World Wide Web Consortium, 16 Nov 1999. This version is http://www.w3.org/TR/1999/REC-xpath-19991116/. The latest version is available at http://www.w3.org/TR/xpath/.
XQuery 1.0 and XPath 2.0 Data Model (XDM)
XQuery 1.0 and XPath 2.0 Data Model (XDM), Ashok Malhotra, Jonathan Marsh, Norman Walsh, et. al., Editors. World Wide Web Consortium, 21 Nov 2006. This version is http://www.w3.org/TR/2006/PR-xpath-datamodel-20061121/. The latest version is available at http://www.w3.org/TR/xpath-datamodel/.