Revision [117]

This is an old revision of XDMSerialize made by DavidLee on 2011-01-07 07:34:50.

XDM Text Serialization

A proposal for text serialization of XDM for purposes of data interchange and interoperability.


The XQuery 1.0 and XPath 2.0 Data Model (XDM) references a Serialization format for XDM. This format is "lossy" and does not reconstruct into the original XDM. In particular, for purposes of data interchange, the losses are severe; sequences are "normalized" into a single rooted XML tree, adjacent atomic values are concatenated and type information is discarded.
This proposal is to define a standard format for serializing XDM data for purposes of data interchange and interoperability preserving more of the XDM information.


The intent of this specification is to provide a standard format for interchange of data between XML tools which produce and consume XDM data. Examples of XML tools which produce or consume XDM data include XPath (2.0), XSLT , XQuery, but also include other tools such as XProc, xmlsh and countless custom written programs using the XDM data model.

In current implementations there is no standard model for XDM data either within the same environment and language, or across languages and environements. For example, suppose an XQuery operation produces a sequence and it is desired to provide that sequence as a parameter to XSLT transformation, there is no standardized way to exchange the data. In practice in order to accomplish this, either the same vendor tools must be used within the same language and process, or the results must be serialized in a proprietary format and reconstituted in the target using the same proprietary format. Even with the same vendors implementations interchange is not always easy due to differences in internal data formats , languages, or transferring data across process or machine boundaries.

The existing text serialization for XDM proposal XDM is inadequate for data interchange.

These and other limitations make the existing XDM serialization proposal unsuitable for data interchange.
This proposal provides for a standard serialization format so that XDM data can be interchanged across tools, vendors, languages, environments and machines while maintaining most of the original XDM information.


For the purposes of this document the following definitions apply


This proposal expresses multiple goals, not all of which may be possible to achieve. The use cases describe concrete examples of many of the goals, while this summary provides the intent.

Some purposes for which this standard could be used include

XDM Information Preserved and Lost

Preserving all of the information in the XDM is very difficult, and likely why a serialization model for XDM has not been specified. This proposal recognizes that not all XDM information is equally important. In the context of the Use Cases, and with the goals of reasonable implementation with existing vendor libraries this proposal aims at preserving some XDM information at the expense of others.

XDM Information preserved

The XDM Model defines values as a sequence of zero or more items. Each item is one of the following types

Each type has a value. Atomic types have string values, and node types have XML values.

An XDM serialization format should preserve the following attributes

XDM Information NOT preserved

Use Cases

Use cases are concrete examples that demonstrate the goals.

Serialization Format

Serialization Format Properties

The Goals and Use Cases provide rationale for which the desired properties of a serialization format can be derived.

Abstract Form

The Serialization Format Properties suggest a possible Abstract Form comprised of a sequence of zero 0r more of the following markup.

The empty sequence being represented by an empty stream.

Where "ITEM" is the serialized form of a single XDM Item, and "END_MARKER" is a character sequence which is not allowed within the serialized form of "ITEM". The END_MARKER is an item terminator not a separator.
"WHITESPACE" is zero or more whitespace characters ( space, newline, tab , carriage-return).

This allows concatenation of zero or more XDM Streams to be an XDM Stream without having to insert data Use Case 8.

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki