This is a W3C Note produced as a deliverable of the XML Fragment WG (members only) according to its charter and the current XML Activity process. A list of current W3C working drafts and notes can be found at http://www.w3.org/TR .
This document is a work in progress representing the current consensus of the W3C XML Fragment Working Group. This version of the XML Fragment Interchange Requirements document has been approved by the XML Fragment working group and the XML Plenary to be posted for review by W3C members and other interested parties. Publication as a Note does not imply endorsement by the W3C membership. Comments should be sent to email@example.com, which is an automatically and publicly archived email list.
This document is being processed according to the following review schedule:
|XML Fragment WG signoff||1998/11/04||done||XML Fragment WG|
|XML Plenary firstname.lastname@example.org,email@example.com|
|Publish as W3C Note||1998/11/23||accepting firstname.lastname@example.org|
|Checkpoint of comments||1999/01/08|
Comments about this document should be submitted to the "contact" listed above for each process.
Copyright ©1998 W3C (MIT, INRIA, Keio) , All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
The XML standard supports logical documents composed of possibly several entities. It may be desirable to view or edit one or more of the entities or parts of entities while having no interest, need, or ability to view or edit the entire document. The problem, then, is how to provide to a recipient of such a fragment the appropriate information about the context that fragment had in the larger document that is not available to the recipient. The XML Fragment WG is chartered with defining a way to send fragments of an XML document--regardless of whether the fragments are predetermined entities or not--without having to send all of the containing document up to the part in question. This document specifies the design principles and requirements for this activity.
The XML standard supports logical documents composed of possibly several entities. It may be desirable to view or edit one or more of the entities or parts of entities while having no interest, need, or ability to view or edit the entire document. The problem, then, is how to provide to a recipient of such a fragment the appropriate information about the context that fragment had in the larger document that is not available to the recipient.
The XML Fragment WG is chartered to work on a mechanism to address these issues. The SGML Open Technical Resolution 9601:1996 on Fragment Interchange provides a basis for this work. This document specifies the design principles and requirements for this activity.
In the case of many XML documents, it is suboptimal to have to receive and parse the entire document when only a fragment of it is desired. If the user asked to look at chapter 20, one shouldn't need to parse 19 whole chapters before getting to the part of interest. The goal of this activity is to define a way senders can send small parts of an XML document without having to send everything up to the part needed. This can be done regardless of whether the parts are entities or not, and the parts can either be viewed immediately or accumulated for later use, assembly, or other processing.
The challenge is that an isolated element from an XML document may not contain quite enough information to be parsed correctly. The goal of this activity is to enable senders to provide the remaining information required so that systems can interchange any XML elements they choose, from books or chapters all the way down to paragraphs, tables, footnotes, book titles, and so on, without having to manage each as a separate entity or having to risk incorrect parsing due to loss of context.
In the design of any language, trade-offs in the solution space are necessary. To aid in making these trade-offs the follow design principles will be used (the order of these principles is not necessarily significant):
Issues involved with the possible "return" of any fragment to its original context and the determination of the possible validity of the "returned" fragment in its original context are beyond the scope of this activity.
This activity will enable interchanging portions of XML documents while retaining the ability to parse them correctly (that is, as they would be parsed in their originating document context), and, as far as practical, to be formatted, edited, and otherwise processed in useful ways.
Conceptually, a sender examines a fragment to be sent and, using the notation to be defined by this activity, constructs a fragment context specification. The object representing the fragment removed from its source document is called the fragment body. The sender sends the fragment context specification and the fragment body to the recipient. The storage object in which the fragment body is transmitted is call the fragment entity. (In some packaging schemes, the fragment context specification may also be embedded in the fragment entity.) The recipient processes the fragment context specification to determine the proper parser state for the context at the beginning of the fragment and uses that information to enable the XML parser to parse the fragment body.
The point of the fragment context information is to provide information that is not available in the fragment body itself but that would be available from the complete XML document. Specifically, any information not available from the XML document as a whole (plus knowledge of the location of the fragment body within the document) is out of scope for inclusion in the fragment context information. Such information may well be useful and important metadata in a variety of applications, but there are (or need to be) other mechnisms for handling this information.
Specifically a successful XML Fragment WG Recommendation will enable the following scenarios:
To accomplish these ends, this activity will define:
The user has an XML document that represents a customer's set of purchases as a bookstore, and the part of that document that represents the purchase of a particular book needs to be represented as a fragment.
The user makes a well-balanced selection in the original document and wants to make the contents of that selection a fragment.
A user has an XML document composed of several entities, and she wants to be able to edit each entity standalone as well as having them referencable from the parent document (i.e., each entity has to be both a valid XML entity and a legal fragment at the same time).
The user has very large XML documents, possibly a gigabyte or more in size, and wishes to be able to view portions of the document without parsing the whole document. In order to do this the user creates an "index" for each document portion (fragment) that they wish to so address. The "index" consists of a fragment context specification in combination with a packaging mechanism designed for quick access to the fragment body.