<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE spec PUBLIC "-//W3C//DTD Specification::19990205//EN" "http://www.w3.org/XML/1998/06/xmlspec-19990205.dtd" [
<!--ArborText, Inc., 1988-1998, v.4002-->
<!ENTITY version "2.2">
<!ENTITY monthname "June">
<!ENTITY month "06">
<!ENTITY day "30">
<!ENTITY url-prefix "&url-xmlgroup;/&year;/&month;">
<!ENTITY designation "&root-designation;-&isodate;">
<!ENTITY url-TR "http://www.w3.org/TR">
<!ENTITY pack-ns-uri "http://www.w3.org/XML/Package/1.0">
<!ENTITY frag-ns-uri "http://www.w3.org/XML/Fragment/1.0">
<!ENTITY url-xmlgroup "http://www.w3.org/">
<!ENTITY year "1999">
<!ENTITY isodate "&year;&month;&day;">
<!ENTITY root-designation "WD-xml-fragment">
<!ENTITY XMLRec "http://www.w3.org/TR/REC-xml">
]>
<spec>
<header>
<title>XML Fragment Interchange</title>
<version>WD Version &version;</version>
<w3c-designation>&designation;</w3c-designation>
<w3c-doctype>W3C Working Draft</w3c-doctype>
<pubdate><day>&day;</day><month>&monthname;</month><year>&year;</year></pubdate>
<publoc><loc href="&url-prefix;/&designation;.htm">&url-prefix;/&designation;.html</loc>
<loc href="&url-prefix;/&designation;.xml">&url-prefix;/&designation;.xml</loc>
</publoc>
<prevlocs><loc href="http://www.w3.org/TR/1999/&root-designation;-19990412.htm">http://www.w3.org/TR/1999/&root-designation;-19990412.htm</loc>
<loc href="http://www.w3.org/TR/1999/&root-designation;-19990412.xml">http://www.w3.org/TR/1999/&root-designation;-19990412.xml</loc>
<loc href="http://www.w3.org/TR/1999/&root-designation;-19990303.htm">http://www.w3.org/TR/1999/&root-designation;-19990303.htm</loc>
<loc href="http://www.w3.org/TR/1999/&root-designation;-19990303.xml">http://www.w3.org/TR/1999/&root-designation;-19990303.xml</loc>
</prevlocs>
<latestloc><loc href="&url-TR;/&root-designation;">&url-TR;/&root-designation;</loc>
</latestloc>
<authlist>
<author><name>Paul Grosso</name><affiliation>Arbortext</affiliation><email
href="mailto:pgrosso@arbortext.com">pgrosso@arbortext.com</email></author>
<author><name>Daniel Veillard</name><affiliation>W3C</affiliation><email href="mailto:veillard@w3.org">veillard@w3.org</email>
</author>
</authlist>
<status id="status">
<p>The <xtermref href="http://www.w3.org/XML/Activity.html#fragment-wg">XML
Fragment Working Group</xtermref>, with this &year; &monthname; &day; Working
Draft considers its charter discharged. This is the XML Fragment WG's W3C
Working Draft as revised to reflect comments received during <emph>Last Call</emph>
review. This draft is technically ready to go to Proposed Recommendation,
but the WG decided to hold at this stage to await some implementation experience
and to allow possibly related work in other WGs to progress further before
submitting this draft for PR.</p>
<p>The W3C Membership and other interested parties are invited to review the
specification and report implementation experience. Please send comments to <xtermref
href="mailto:www-xml-fragment-comments@w3.org">www-xml-fragment-comments@w3.org</xtermref>
(<xtermref href="http://lists.w3.org/Archives/Public/www-xml-fragment-comments/">archive</xtermref>).
For background on this work, please see the <xtermref href="http://www.w3.org/XML/Activity.html#fragment-wg">XML
Activity Statement</xtermref>.</p>
<p>In the current document, records of major WG decisions and special review
requests are so marked and appear in red. Before this specification is submitted
as a PR, all such sections will be deleted and will therefore not appear in
the final Recommendation.</p>
<p>No substantive changes are expected in this document; however, as a draft
document, it may be updated, replaced, or obsoleted by other documents at
any time. It is inappropriate to use W3C Working Drafts as reference material
or to cite them as other than <quote>work in progress</quote>. A list of current
W3C working drafts can be found at <loc href="http://www.w3.org/TR">http://www.w3.org/TR</loc>.</p>
<p><xtermref href="http://www.w3.org/Consortium/Legal/ipr-notice.html#Copyright">Copyright</xtermref>
©1998, 1999 <xtermref href="http://www.w3.org">W3C</xtermref> (<xtermref href="http://www.lcs.mit.edu">MIT</xtermref>, <xtermref
href="http://www.inria.fr/">INRIA</xtermref>, <xtermref href="http://www.keio.ac.jp/">Keio</xtermref>),
All Rights Reserved. W3C <xtermref href="http://www.w3.org/Consortium/Legal/ipr-notice.html#LegalDisclaimer">liability,</xtermref> <xtermref
href="http://www.w3.org/Consortium/Legal/ipr-notice.html#W3CTrademarks">trademark</xtermref>, <xtermref
href="http://www.w3.org/Consortium/Legal/copyright-documents.html">document
use</xtermref> and <xtermref href="http://www.w3.org/Consortium/Legal/copyright-software.html">software
licensing</xtermref> rules apply.</p>
</status>
<abstract>
<p>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&mdash;regardless
of whether the fragments are predetermined entities or not&mdash;without having
to send all of the containing document up to the part in question. This document
defines Version 1.0 of the [eventual] W3C Recommendation that addresses this
issue.</p>
</abstract>
<langusage>
<language id="EN">English</language>
</langusage>
<revisiondesc>
<slist>
<sitem>1998/12/04: Initial partial draft sketched up by Paul Grosso</sitem>
<sitem>1998/12/15: Minor edits per WG discussion by Paul Grosso</sitem>
<sitem>1998/01/15: Major edits per WG discussion by Paul Grosso including
draft packaging</sitem>
<sitem>1998/01/30: Minor edits by Paul Grosso (Jan 20)</sitem>
<sitem>1998/02/10: Addition of conformance text and examples by Daniel Veillard
and Paul Grosso</sitem>
<sitem>1998/02/17: replaced entity example with CGM one, Paul Grosso</sitem>
<sitem>1998/02/23: minor edit to Docbook URL by Paul Grosso</sitem>
<sitem>1998/03/03: minor edits to produce the WD version by Paul Grosso</sitem>
<sitem>1998/03/23: major edits to make packaging non-normative and define
linkage from fcs to fragbody by Paul Grosso</sitem>
<sitem>1998/03/29: minor edits especially to non-normative packaging and examples
by  Daniel Veillard and Paul Grosso</sitem>
<sitem>1998/03/31: minor editorial edits to produce the last call WD version
by Paul Grosso</sitem>
<sitem>1998/06/21: minor editorial edits to produce the post last call WD
version by Paul Grosso</sitem>
</slist>
</revisiondesc>
</header>
<front>
<div1>
<head>Table of Contents</head>
<ulist>
<item><p><titleref href="#overview">1. Overview</titleref></p></item>
<item><p><titleref href="#scope">2. Scope</titleref></p></item>
<item><p><titleref href="#terminology">3. Terminology</titleref></p></item>
<item><p><titleref href="#fci">4. Fragment context information set</titleref></p>
</item>
<item><p><titleref href="#fcs">5. Fragment context specification notation</titleref></p>
<ulist>
<item><p><titleref href="#fcs-overview">5.1. Overview of the fcs</titleref></p>
</item>
<item><p><titleref href="#fcs-formalnotn">5.2. Formal notation description</titleref></p>
</item>
<item><p><titleref href="#fcs-semantics">5.3. Semantics of a fragment context
specification</titleref></p></item>
<item><p><titleref href="#fcs-example">5.4. An fcs example</titleref></p>
</item>
</ulist>
</item>
<item><p><titleref href="#conformance">6. Conformance</titleref></p></item>
</ulist>
<ulist>
<item><p><titleref href="#references">A. References</titleref></p>
<ulist>
<item><p><titleref href="#refs-norm">A.1. Normative References</titleref></p>
</item>
<item><p><titleref href="#refs-other">A.2. Other References</titleref></p>
</item>
</ulist>
</item>
<item><p><titleref href="#packaging">B. Packaging and interchanging fragments
(non-normative)</titleref></p></item>
<item><p><titleref href="#examples">C. Examples (non-normative)</titleref></p>
</item>
<item><p><titleref href="#design-principles">D. Design Principles (non-normative)</titleref></p>
</item>
<item><p><titleref href="#acknow">E. Acknowledgments (non-normative)</titleref></p>
</item>
<item><p><titleref href="#changes">F. Changes from Previous Public Working
Draft (non-normative)</titleref></p></item>
</ulist>
</div1>
</front><body>
<div1>
<head id="overview">Overview</head>
<p>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.</p>
<p>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 to enable processing of small parts of an XML document without having
to process everything up to the part in question. 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.</p>
<p>Conceptually, the holder of the complete source document considers a fragment
of that document and, using the notation to be defined by this activity, constructs
a <term>fragment context specification</term>. The object representing the
fragment removed from its source document is called the <term>fragment body</term>.
The fragment context specification and the fragment body are transmitted to
the recipient. The storage object in which the fragment body is transmitted
is call the <term>fragment entity</term>. (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
terms &ldquo;sender,&rdquo; &ldquo;recipient,&rdquo; &ldquo;transmit,&rdquo;
are used throughout this document to describe the process of fragment interchange.
It should be noted, however, that there are many feasible and useful scenarios
for fragment interchange, and in some cases, the &ldquo;sender&rdquo; and
&ldquo;recipient&rdquo; may be on the same machine, node, system, or network,
and may even be the same tool in different guises.)</p>
<p>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.</p>
<p>To accomplish these ends, this Recommendation defines:</p>
<ulist>
<item><p>exact constraints on what portions of an XML document may constitute
fragments to be supported by this Recommendation;</p></item>
<item><p>the set of information needed to allow for successful parsing as
well as for viewing or editing of a fragment in a useful and important set
of cases;</p></item>
<item><p>the notation (i.e., language) in which this information (the fragment
context specification) will be described;</p></item>
<item><p>some mechanisms for associating this information with a fragment.</p>
</item>
</ulist>
</div1>
<div1>
<head id="scope">Scope</head>
<p>This Recommendation enables 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.</p>
<p>The goal of this activity is to define a way to send fragments of an XML
document&mdash;regardless of whether the fragments are predetermined entities
or not&mdash;without having to send all of the containing document up to the
part in question. The delivered parts can either be viewed or edited immediately
or accumulated for later use, assembly, or other processing; what the receiving
application does with the information&mdash;and issues involved with the possible
&ldquo;return&rdquo; of such a fragment to the original sender&mdash;is beyond
the scope of this activity. While implementations of this Recommendation may
serve as part of a larger system that allows for &ldquo;fragment reuse,&rdquo;
the many important issues about reuse of XML text and &ldquo;concurrent multiple
author environments&rdquo; are beyond the scope of this Recommendation.</p>
<p>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 (which may include an external subset) 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 mechanisms for handling this information.</p>
<p>This Recommendation considers fragments of XML as defined by <bibref ref="XML"/>
and <bibref ref="Namespaces"/>. It is explicitly noted that this version of
this Recommendation does not take into account work such as that taking place
in the XML Schema Working Group; insofar as such work by other currently active
working groups places new requirements on a fragment interchange solution,
those requirements would be input to a new version of the fragment interchange
specification that may become a chartered activity at a later date.</p>
<p>It is also explicitly noted that this Recommendation does not consider
interchange of information that is not well-formed XML; in particular, issues
specific to the interchange of fragments of SGML (including HTML)&mdash;other
than such SGML that is, in fact, also well-formed XML&mdash;are not within
scope of this Recommendation.</p>
</div1>
<div1>
<head id="terminology">Terminology</head>
<p>This list is sorted &ldquo;logically&rdquo; as opposed to alphabetically.
In an entry, phrases in parentheses are &ldquo;optional&rdquo; modifiers;
whether they are used explicitly or not, we are still talking about the same
thing for the purposed of this Recommendation.</p>
<glist>
<gitem><label>(well-formed) XML document</label>
<def>
<p>defined in <bibref ref="XML"/>, <xtermref href="&XMLRec;#sec-well-formed">Well-formed
XML documents</xtermref></p>
</def></gitem>
<gitem><label>(well-formed) (external) (parsed) entity</label>
<def>
<p>defined in <bibref ref="XML"/>, <xtermref href="&XMLRec;#NT-extParsedEnt">production
[78] extParsedEnt</xtermref></p>
</def></gitem>
<gitem><label>(well-)balanced</label>
<def>
<p>A region (consecutive sequence of characters) of an XML document is said
to be (well-)balanced if it matches <xtermref href="&XMLRec;#NT-content">production
[43] content</xtermref> of <bibref ref="XML"/>. Informally this means that,
if the region includes any part of the markup of any construct, it contains
all of the markup of that construct (e.g., in the case of elements, all of
both the start and end tag).</p>
</def></gitem>
<gitem><label>fragment</label>
<def>
<p>A general term to refer to part of an XML document, plus possibly some
extra information, that may be useful to use and interchange in the absence
of the rest of the XML document. See the rest of the fragment-related terms
when a more precise definition is required.</p>
</def></gitem>
<gitem><label>fragment interchange</label>
<def>
<p>The process of receiving and/or parsing of a fragment by a fragment-aware
application.</p>
</def></gitem>
<gitem><label>fragment body</label>
<def>
<p>A well-balanced region of an XML document being considered as (logically
and/or physically) separate from the rest of the document for the purposes
of defining it as a fragment. Also, that part of a fragment entity that consists
solely of the well-balanced region from the complete XML document. When it
is important to indicate that a reference is specifically to the version of
the fragment body still physically part of the originating (parent) document,
this document will use the term &ldquo;fragment body <emph>in situ</emph>.&rdquo;</p>
</def></gitem>
<gitem><label>context information</label>
<def>
<p>The abstract set of information&mdash;divorced from any particular language/syntax/notation&mdash;that
constitutes the &ldquo;parser state&rdquo; at the point when a parser processing
the complete XML document encounters (but has not yet processed) the first
character of (what would be) the fragment body.</p>
</def></gitem>
<gitem><label>(fragment) context (information)</label>
<def>
<p>(sometimes abbreviated fci) The subset of the context information that
we decide will be expressible in any fragment context specification language.
Also the abstract set of information represented by a particular fragment
context specification.</p>
</def></gitem>
<gitem><label>fragment context specification</label>
<def>
<p>(sometimes abbreviated fcs) A valid string in the language (notation) that
this Recommendation defines that describes a set of fragment context information.
Also the particular string in a fragment entity or fragment package that describes
the fragment's context information.</p>
</def></gitem>
<gitem><label>package [verb]</label>
<def>
<p>To associate in some specified way a fragment body with a fragment context
specification. This may include some way of combining both into a single XML-encoded
object; combining both in some multipart MIME or archiving encoding; or linking
the two via some sort of referencing, co-referencing, or third-party referencing
scheme.</p>
</def></gitem>
<gitem><label>fragment entity</label>
<def>
<p>The storage object in which the fragment body is stored and/or transmitted
during the process of fragment interchange.</p>
</def></gitem>
<gitem><label>(fragment) package [noun]</label>
<def>
<p>The object actually transmitted during the process of fragment interchange.
Though one might expect this is the same thing as a fragment entity, the terms
may or may not be synonyms in all cases; one could define a packaging mechanism
whereby the fragment context specification is transmitted without the fragment
body but somehow refers to the fragment body (which presumably gets retrieved
later) in which case the fragment package is the fragment context specification,
and the fragment entity either gets retrieved later or doesn't exist at all
(e.g., the fragment context specification contains a URI reference [<bibref
ref="rfc2396"/>] that defines the fragment body as part of the complete document).</p>
</def></gitem>
<gitem><label id="fcs-doc">fragment context specification document</label>
<def>
<p>As defined in this Recommendation, a valid fragment context specification
(fcs) is a well-formed XML document. Therefore, when considered as a document,
an fcs is sometimes referred to as a fragment context specification document
(or fcs document). A fragment context specification document may also be a
fragment package (i.e., it may be the actual object transmitted to effect
fragment interchange).</p>
</def></gitem>
<gitem><label>send/receive (and sender/recipient)</label>
<def>
<p>In the context of this Recommendation, words such as send/receive (and
sender/recipient) are used to described the general process of fragment interchange.
There are many feasible and useful scenarios for fragment interchange, and
in some cases, the &ldquo;sender&rdquo; and &ldquo;recipient&rdquo; may be
on the same machine, node, system, or network, and may even be the same tool
in different guises. The only constant assumption is that the sender has access
to and knowledge of the entire (parental) document from which the fragment
comes, and the recipient is in possession only of the fragment package (though
nothing in this Recommendation precludes the possibility of the recipient
using the information in the fragment package, if available, to attempt to
fetch more information from the sender).</p>
</def></gitem>
</glist>
</div1>
<div1>
<head id="fci">Fragment context information set</head>
<p>In this section, numbers in brackets refer to productions in <bibref ref="XML"/>.
The following information shall constitute the complete fragment context information
(fci) set:</p>
<olist>
<item><p>A reference to the external subset (extSubset [30]), by specifying
an ExternalID [75] for it.</p></item>
<item><p>Internal subset information using some or all of the following:<olist>
<item><p>A reference to an &ldquo;externalized copy&rdquo; of the internal
subset (presumably generated by placing the internal declarations into a storage
object such as extSubset [30]), presumably by specifying an ExternalID [75]
for it.</p></item>
<item><p>Some or all of markupdecl [29] and/or PEReference [69] allowed in
an XML document's internal subset; note that PEReference implies expansion
of what could be more external entities; also note that markupdecl includes
comments, processing instructions, and declarations for elements, attribute
lists, entities, and notations.</p></item>
</olist></p></item>
<item><p>Ancestor information for the fragment body.</p></item>
<item><p>Sibling information for the fragment body.</p></item>
<item><p>Sibling information for any of the ancestors.</p></item>
<item><p>Element content (aka descendant) information for any of the ancestors
or siblings.</p></item>
<item><p>Attribute information (attribute name and value) for:<olist>
<item><p>any of the ancestors;</p></item>
<item><p>any of the siblings of the fragment body;</p></item>
<item><p>any of the siblings of any of the ancestors;</p></item>
<item><p>any of the descendants of any of the ancestors or siblings.</p></item>
</olist></p></item>
<item><p>A reference to the original/parental document by specifying an ExternalID
[75] for it.</p></item>
<item><p>A reference to the fragment body within the original/parental document
by specifying an ExternalID [75].</p></item>
</olist>
<p>From the above list, the following items affect proper (validating) parsing
of the fragment:</p>
<ulist>
<item><p>External subset</p></item>
<item><p>Internal subset</p></item>
<item><p>(Preceding) Siblings of the fragment body</p></item>
</ulist>
<p>The following items, while they cannot affect proper parsing, are usually
considered part of the basic, structural XML parse tree:</p>
<ulist>
<item><p>Ancestors</p></item>
<item><p>(Preceding) Siblings of ancestors</p></item>
<item><p>Following siblings of the fragment body and its ancestors</p></item>
<item><p>Ancestor and sibling descendants</p></item>
<item><p>Attributes</p></item>
</ulist>
<p>The following items, while not usually considered part of the basic, structural
XML parse tree, are clearly definable pieces of information known or computable
by any XML processor that is processing the parent document:</p>
<ulist>
<item><p>XML declaration information of the parent document. Note that we
have defined a fragment package to be an XML document. That is, the fragment
package would contain its own XMLDecl-like information as necessary, so the
fci itself need not include that information.</p></item>
<item><p>A reference to the parent document.</p></item>
<item><p>A reference to the fragment body <emph>in situ</emph>.</p></item>
</ulist>
<ednote><name>WG consensus decision</name><date>1998/12/09</date><edtext>The
WG decided that information such as copyright information and a pointer to
the parent document's stylesheet was general metadata that shouldn't be included
within the FCI set.</edtext></ednote>
<ednote><name>WG consensus decision</name><date>1998/12/09</date><edtext>The
WG decided not to allow for a "commenting" feature within the FCS as it was
felt this was too subject to potential misuse.</edtext></ednote>
<ednote><name>WG consensus decision</name><date>1999/01/06</date><edtext>The
WG decided not to allow for an extension mechanism within the FCS since our
packaging mechanism can be extended to allow the inclusion of other metadata,
but the specification of that is outside the scope of this Recommendation.</edtext>
</ednote>
<ednote><name>WG consensus decision</name><date>1999/01/06</date><edtext>Especially
because the XML 1.0 syntax for declarations is difficult to embed within an
XML instance, the WG decided not to allow for inline inclusion of internal
subset information within the FCS; internal subset information can only be
included in the FCS via a reference to an &ldquo;externalized copy&rdquo;
of the internal subset. Inline internal subset information may be more feasible
after the XML Schema WG defines instance syntax for declarations, but this
would not make it into version 1.0 of this Fragment Interchange Recommendation.</edtext>
</ednote>
</div1>
<div1>
<head id="fcs">Fragment context specification notation</head>
<div2 id="fcs-notn-overview">
<head id="fcs-overview">Overview of the fcs</head>
<p>The previous section defined the logical set of information possible in
a fragment context. This section describes the notation in which to express
a specific fragment context specification. All information would be optional;
how much gets included in any particular fragment context specification is
up to the sender and recipient, and how this gets determined is outside of
the scope of this Recommendation.</p>
<note>
<p>While what gets included in any particular fragment context specification
is outside of the scope of this Recommendation, some knowledge of the target
application can help determine an appropriate level for the fcs. For example,
if the target application is a user agent that will use Cascading Style Sheets
(CSS) to display the fragment, the following information is necessary and
sufficient given the current level of CSS selector capability: previous siblings
of the fragment body, all ancestors of the fragment body, previous siblings
of each of those ancestors, and all attributes on all those siblings and ancestors.</p>
</note>
<note>
<p>A given fragment context specification need not necessarily provide the
ability to specify the complete set of fragment context information described
in the previous section. In particular, because the XML 1.0 syntax for declarations
is difficult to embed within an XML instance, the specific fragment context
specification notation defined by this Recommendation does not allow for inline
inclusion of internal subset information within the FCS. Internal subset information
can only be included in the FCS via a reference to an &ldquo;externalized
copy&rdquo; of the internal subset. Inline internal subset information may
be more feasible once an instance syntax for declarations is defined, and
such may be considered in future versions of the Fragment Interchange specification.</p>
</note>
<p>The syntax used is XML itself. In particular, a fragment context specification
(fcs) is written as a single root XML element allowing up to five attributes
and containing a subtree of other elements (possibly with attributes). The
root element (and the element serving as the placeholder for the fragment
body) comes from <termref def="frag-ns-uri">Fragment Interchange namespace</termref>,
a specific namespace defined by this Recommendation; the contained subtree
of elements comes from the namespace(s) of the document from which this fragment
comes. For the purposes of exposition in this section, we assume namespace
declarations such as the following are in force:</p>
<eg>  xmlns:f="&frag-ns-uri;"
  xmlns="http://www.oasis-open.org/docbook/DocbookSchema"</eg>
<p>That is, within this example, <code>f</code> is the local prefix referring
to the <termref def="frag-ns-uri">Fragment Interchange namespace</termref>
defined by this Recommendation for fragment-interchange related components,
and the default namespace is that in effect in the parent document at the
beginning of the fragment body <emph>in situ</emph>.</p>
<p>The element type for the single root element for the fcs shall be <code>f:fcs</code>
(where <code>f</code> is whatever namespace prefix is mapped to the <termref
def="frag-ns-uri">Fragment Interchange namespace</termref>). It allows up
to five attributes, each of whose value shall be a URI reference [<bibref
ref="rfc2396"/>]. The attribute names and the meaning of their values are
as follows:</p>
<glist>
<gitem><label>extref</label>
<def>
<p>a URI reference to the external subset</p>
</def></gitem>
<gitem><label>intref</label>
<def>
<p>a URI reference to the internal subset</p>
</def></gitem>
<gitem><label>parentref</label>
<def>
<p>a URI reference to the parent document</p>
</def></gitem>
<gitem><label>sourcelocn</label>
<def>
<p>a URI reference to the fragment body <emph>in situ</emph> within the parent
document</p>
</def></gitem>
</glist>
<ednote id="fcs-as-xlink"><name>WG Review Note</name><date>1999/03/17</date>
<edtext>It was suggested that the ref attributes on fcs might make fcs look
like an &ldquo;xlink&rdquo; element, but xlink does not currently support
a single element with multiple references. It isn't clear to the XML Fragment
WG that our fcs element needs to be able to be an XLink kind of element, but
the WG submits this to the XLink WG as possible input to their requirements
consideration. The XML Fragment Chair has brought this issue to the attention
of the XLink WG for review to be completed by the end of this Last Call period.</edtext>
</ednote>
<p>The content of the <code>f:fcs</code> element shall be a subtree of elements
(possibly with attribute value assignments) from the parent document's namespace.
This subtree shall provide all the structural context for the fragment body
including various information about ancestor and sibling elements and attributes
by mimicking the (relevant) context within this parent document. No data characters
(mixed content) are allowed within the <code>f:fcs</code> element. The special
empty element <code>f:fragbody</code> shall be used to indicate the placement
of the fragment body within the specified context. It has one significant
attribute with meaning as follows:</p>
<glist>
<gitem><label>fragbodyref</label>
<def>
<p>a URI reference [<bibref ref="rfc2396"/>] to the fragment body</p>
</def></gitem>
</glist>
<p>For example, consider a fragment body that consists of <code>listitems</code>
2 and 3 of an <code>orderedlist</code> (indicated to be enumerated with arabic
numbers by the <code>numeration</code> attribute on the <code>orderedlist</code>
element) within the second <code>sect1</code> within the first <code>chapter</code>
within the first <code>part</code> within the <code>body</code> of a <code>book</code>.
Assume that the external subset (aka &ldquo;DTD&rdquo;) is in the file <code>Docbook.dtd</code>
on the OASIS Open web server, the parent document is in <code>mybook.xml</code>
on Acme's web server, and that there need be no internal subset given as part
of the fcs. Then the fcs for this fragment body might look like:</p>
<eg>  &lt;f:fcs xmlns:f="&frag-ns-uri;"
         extref="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
         parentref="http://www.acme.com/~me/mydocs/mybook.xml"
         xmlns="http://www.oasis-open.org/docbook/DocbookSchema">
    &lt;book>
      &lt;part>
        &lt;chapter>
          &lt;sect1/>
          &lt;sect1>
            &lt;orderedlist numeration="arabic">
              &lt;listitem/>
              &lt;f:fragbody/>
            &lt;/orderedlist>
          &lt;/sect1>
        &lt;/chapter>
      &lt;/part>
    &lt;/book>
  &lt;/f:fcs>
</eg>
</div2>
<div2>
<head id="fcs-formalnotn">Formal notation description</head>
<p>A formal notation for the <code>fcs</code> element used in the examples
of the previous section follows. Therein, the following terms are defined
in either the &ldquo;Extensible Markup Language (XML) 1.0&rdquo; (<bibref
ref="XML"/>) or &ldquo;Namespaces in XML&rdquo; (<bibref ref="Namespaces"/>)
Recommendations: <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-Attribute">Attribute</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-STag">STag</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-ETag">ETag</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-EmptyElemTag">EmptyElemTag</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-CharData">CharData</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-CDSect">CDSect</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-PI">PI</xnt>, <xnt
href="http://www.w3.org/TR/REC-xml#NT-Comment">Comment</xnt>, <xnt href="http://www.w3.org/TR/REC-xml#NT-prolog">prolog</xnt>,
and <xnt href="http://www.w3.org/TR/REC-xml#NT-Misc">Misc</xnt>.</p>
<scrap>
<head>Fragment Context Specification Element</head>
<prod id="NT-FCSelement">
<lhs>FCSelement</lhs><rhs><nt def="NT-FCSstag">FCSstag</nt> <xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>? <nt
def="NT-FCSelementContent">FCSelementContent</nt> <xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>? <nt
def="NT-FCSetag">FCSetag</nt></rhs>
</prod>
<prod id="NT-FCSstag">
<lhs>FCSstag</lhs><rhs>'&lt;' <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>
':fcs' ((<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> 'extref' <xnt
href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>)
| (<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> 'intref' <xnt href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt> <xnt
href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>) | (<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>
'parentref' <xnt href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>)
| (<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> 'sourcelocn' <xnt
href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>)
| (<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-Attribute">Attribute</xnt>))* <xnt
href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>? '>'</rhs><constraint def="frag-ns"/>
</prod>
<prod id="NT-FCSelementContent">
<lhs>FCSelementContent</lhs><rhs><xnt href="http://www.w3.org/TR/REC-xml#NT-EmptyElemTag">EmptyElemTag</xnt>
| <xnt href="http://www.w3.org/TR/REC-xml#NT-STag">STag</xnt> <nt def="NT-FCScontent">FCScontent</nt> <xnt
href="http://www.w3.org/TR/REC-xml#NT-ETag">ETag</xnt> | <nt def="NT-FCSfragbody">FCSfragbody</nt></rhs>
<constraint def="one-fragbody"/>
</prod>
<prod id="NT-FCSfragbody">
<lhs>FCSfragbody</lhs><rhs>'&lt;' <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>
':fragbody' ((<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> 'fragbodyref' <xnt
href="http://www.w3.org/TR/REC-xml#NT-Eq">Eq</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-AttValue">AttValue</xnt>)
| (<xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt> <xnt href="http://www.w3.org/TR/REC-xml#NT-Attribute">Attribute</xnt>))* <xnt
href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>? '/>'</rhs><constraint def="same-ns-prefix"/>
</prod>
<prod id="NT-FCSetag">
<lhs>FCSetag</lhs><rhs>'&lt;/' <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>
':fcs' <xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>? '>'</rhs>
</prod>
<prod id="NT-FCScontent">
<lhs>FCScontent</lhs><rhs>(<nt def="NT-FCSelementContent">FCSelementContent</nt>
| <xnt href="http://www.w3.org/TR/REC-xml#NT-CharData">CharData</xnt> | <xnt
href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt> | <xnt href="http://www.w3.org/TR/REC-xml#NT-CDSect">CDSect</xnt>
| <xnt href="http://www.w3.org/TR/REC-xml#NT-PI">PI</xnt> | <xnt href="http://www.w3.org/TR/REC-xml#NT-Comment">Comment</xnt>)*</rhs>
</prod>
</scrap>
<constraintnote id="frag-ns" type="FCSC">
<head>FCS Constraint: Fragment Namespace</head>
<p>The namespace prefix represented by <xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>
in the production for <nt def="NT-FCSstag">FCSstag</nt> (and, therefore necessarily, <nt
def="NT-FCSetag">FCSetag</nt>) must have been declared on one of the ancestors
of the FCS element and must be associated with the Fragment Interchange Namespace
URI defined in this Recommendation.</p>
</constraintnote>
<constraintnote id="one-fragbody" type="FCSC">
<head>FCS Constraint: Exactly One Fragbody</head>
<p>There must be exactly one <code>fragbody</code> (<nt def="NT-FCSfragbody">FCSfragbody</nt>)
element in the fcs.</p>
</constraintnote>
<constraintnote id="same-ns-prefix" type="FCSC">
<head>FCS Constraint: Same Namespace Prefix</head>
<p>The namespace prefix (<xnt href="http://www.w3.org/TR/REC-xml-names/#NT-NCName">NCName</xnt>)
used in the production for <nt def="NT-FCSfragbody">FCSfragbody</nt> must
be the same as that used in the production for <nt def="NT-FCSstag">FCSstag</nt>.</p>
</constraintnote>
<p><termdef id="frag-ns-uri" term="Fragment Interchange namespace">The <term>fragment
Interchange namespace</term> shall be associated with the following URI: <code>&frag-ns-uri;</code>.</termdef></p>
<p>In the productions for <nt def="NT-FCSstag">FCSstag</nt> and <nt def="NT-FCSfragbody">FCSfragbody</nt>,
there can be any number of other attribute assignments, all of which are ignored
by the fragment context specification processor. Per XML 1.0 compliance, there
can be at most one assignment to any given attribute including the specifically
mentioned attributes. (Since there is no &ldquo;and&rdquo; connector in EBNF,
this restriction is difficult to show directly in the EBNF, hence this restriction
in prose; however, this prose restriction is normative.)</p>
<p>In the production for <nt def="NT-FCScontent">FCScontent</nt>, the fragment
processor can optionally expand any <xnt href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt>s
that it can expand. Then all <xnt href="http://www.w3.org/TR/REC-xml#NT-CDSect">CDSect</xnt>s, <xnt
href="http://www.w3.org/TR/REC-xml#NT-PI">PI</xnt>s, <xnt href="http://www.w3.org/TR/REC-xml#NT-Comment">Comment</xnt>s,
remaining <xnt href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt>s,
and <xnt href="http://www.w3.org/TR/REC-xml#NT-CharData">CharData</xnt> (including
whitespace, <xnt href="http://www.w3.org/TR/REC-xml#NT-S">S</xnt>) are ignored
by the FCS processor.</p>
<note>
<p>If a <xnt href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt>
in <nt def="NT-FCScontent">FCScontent</nt> is expanded and the expansion includes
element structure, that element structure is considered part of the fcs as
it would if it had been included originally in its expanded form in the fcs.
However, since expansion of any <xnt href="http://www.w3.org/TR/REC-xml#NT-Reference">Reference</xnt>
in <nt def="NT-FCScontent">FCScontent</nt> is optional on the part of the
fragment context specification processor, any sender for which such expansion
is important should do the expansion when creating the fragment package.</p>
</note>
<scrap>
<head>Fragment Context Specification</head>
<prod id="NT-fcs">
<lhs>FCS</lhs><rhs><xnt href="http://www.w3.org/TR/REC-xml#NT-prolog">prolog</xnt> <nt
def="NT-FCSelement">FCSelement</nt> <xnt href="http://www.w3.org/TR/REC-xml#NT-Misc">Misc</xnt>*</rhs>
<constraint def="wf-nsc"/>
</prod>
</scrap>
<constraintnote id="wf-nsc" type="FCSC">
<head>FCS Constraint: Well-formed, namespace complete</head>
<p>A fragment context specification shall constitute a well-formed document
conforming to the &ldquo;Extensible Markup Language (XML) 1.0&rdquo; (<bibref
ref="XML"/>) and &ldquo;Namespaces in XML&rdquo; (<bibref ref="Namespaces"/>)
Recommendations. In particular, if there are entity references in the fcs,
the fcs document must comply with the <xspecref href="http://www.w3.org/TR/REC-xml#wf-entdeclared">Entity
declared well-formedness constraint</xspecref> per the &ldquo;Extensible Markup
Language (XML) 1.0&rdquo; (<bibref ref="XML"/>) Recommendation. (Appropriate
declarations would appear in the internal subset of the fcs document.) Furthermore,
for any use of namespaces, the fcs document must comply with the <xspecref
href="http://www.w3.org/TR/REC-xml-names/#nsc-NSDeclared">Namespace declared
namespace constraint</xspecref> per the &ldquo;Namespaces in XML&rdquo; (<bibref
ref="Namespaces"/>) Recommendation.</p>
</constraintnote>
<note>
<p>Generally, a fragment context specification document would be the well-formed
document consisting simply of the <code>f:fcs</code> element (and its contents)
with no prolog. However, a prolog is always allowable and might be necessary
when some declarations are required to satisfy the <xspecref href="http://www.w3.org/TR/REC-xml#wf-entdeclared">Entity
declared well-formedness constraint</xspecref>.</p>
</note>
<note>
<p>Since all of the components in <xnt href="http://www.w3.org/TR/REC-xml#NT-prolog">prolog</xnt>
are optional, an <nt def="NT-FCSelement">FCSelement</nt> by itself is an allowable
fragment context specification, and this Recommendation does not preclude
some packaging scheme from combining an <nt def="NT-FCSelement">FCSelement</nt>
along with a fragment body as shown in some of the examples in <specref ref="packaging"/>
and <specref ref="examples"/>.</p>
</note>
<ednote id="schema-intsubset"><name>WG Note</name><date>1999/03/17</date>
<edtext>If one is to be able to specify a well-formed fcs without resorting
to XML 1.0 DTD style internal subset declarations, there needs to be a requirement
on the XML Schema WG to be able to declare entities within the fcs using instance
syntax. The XML Fragment WG chair has sent a message to the XML Schema WG
to this effect.</edtext></ednote>
</div2>
<div2 id="fcs-semantics">
<head>Semantics of a fragment context specification</head>
<p>The previous section formally defines a fragment context specification
to be a well-formed XML document consisting of a single <code>f:fcs</code>
element with optional attributes and some content. The <code>f:fcs</code>
element's content consists of optional stuff from the parent document (from
which the fragment body is taken) plus a single <code>f:fragbody</code> element
with optional attributes. The <code>f:fcs</code> and <code>f:fragbody</code>
elements come from a namespace defined by this Recommendation and have certain
specific semantics relative to fragment interchange as defined by this section.</p>
<p>While it is important to be able to package a fragment body with its fcs,
it is expected that a general XML-friendly packaging mechanism will be developed
by the W3C that would satisfy this requirement. Meanwhile, this Recommendation
defines a simple association mechanism that doesn't rely on a packaging scheme.
Applications and interchange partners may agree on any packaging mechanism
to aid in fragment interchange&mdash;this is beyond the scope of this Recommendation.</p>
<p>The fcs document is a well-formed XML document that (1) provides the fragment
context and (2) provides a reference to the fragment body. Because it is well-formed,
existing XML processors can be used to process fcs documents. To support this
fragment interchange Recommendation, an application must also understand the
semantics of the  <code>f:fcs</code> and <code>f:fragbody</code> elements
and their attributes and process accordingly.</p>
<p>Specifically, the <code>fragbodyref</code> attribute on the <code>fragbody</code>
element is a URI reference [<bibref ref="rfc2396"/>] to the fragment body.
A fragment-aware processor is expected to resolve this reference and process
the referenced fragment body in the context specified by the fcs. None of
the attributes on the <code>fcs</code> element have required semantics with
respect to fragment processing; they are provided (optionally) for the application's
use at its discretion.</p>
<note>
<p>For example, a browser might bring up an fcs document, &ldquo;expand&rdquo;
the reference to the fragment body (i.e., put a copy of the fragment body
in place of the <code>fragbody</code> element), and then ignore (e.g., not
display) the part of the document that was originally the fcs, thereby displaying
(in the proper context) only the part of the document that was originally
the fragment body.</p>
</note>
<note>
<p>The <code>fragbody</code> element and its <code>fragbodyref</code> attribute
are in many ways logically equivalent to an external entity reference or an
XLink reference with an &ldquo;embed&rdquo; semantic.</p>
</note>
<ednote id="fragbody-as-xlink"><name>WG Review Note</name><date>1999/03/17</date>
<edtext>The XML Fragment WG requests a specific review of this issue by the
XLink WG as a sanity check to ensure that there is nothing in our definition
of the fragbody element that would make it incompatible with XLink. The XML
Fragment WG chair brought this issue to the attention of the XLink WG for
review to be completed by the end of this Last Call period.</edtext></ednote>
</div2>
<div2 id="fcs-example">
<head>An fcs example</head>
<p>The following example shows the complete set of information relative to
interchanging the two <code>listitem</code>s for the Docbook book mentioned
in <specref ref="fcs-notn-overview"/>.</p>
<p>The parent document, in <code>~me/mydocs/mybook.xml</code> on Acme's web
server, is a Docbook book document whose contents is outlined in the first
subsection below. The fragment body of interest consists of <code>listitems</code>
2 and 3 of the <code>orderedlist</code> (indicated to be enumerated with arabic
numbers by the <code>numeration</code> attribute on the <code>orderedlist</code>
element) within the second <code>sect1</code> within the first <code>chapter</code>
within the first <code>part</code> within the <code>body</code> of this <code>book</code>.
The external subset (aka &ldquo;DTD&rdquo;) is in the file <code>Docbook.dtd</code>
on the OASIS Open web server.</p>
<div3>
<head>The parent Docbook book document</head>
<p>The following represents the parent document from which the fragment body
in question comes.</p>
<eg>&lt;?xml version="1.0"?>
&lt;!DOCTYPE book SYSTEM "http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd">
&lt;book xmlns="http://www.oasis-open.org/docbook/DocbookSchema">
  &lt;part>
    &lt;chapter>&lt;title>The title for chapter one&lt;/title>
      &lt;sect1>&lt;title>The title for section one in chapter one&lt;/title>
        &lt;p>The first paragraph....&lt;/p>
        &lt;p>....&lt;/p>
      &lt;/sect1>
      &lt;sect1>&lt;title>The title for section two in chapter one&lt;/title>
        &lt;p>An introductory paragraph preceding an ordered list.&lt;/p>
        &lt;orderedlist numeration="arabic">
          &lt;listitem>&lt;para>This is the first listitem in this ordered 
          list.&lt;/para>&lt;/listitem>
          &lt;listitem>&lt;para>This is the second listitem within the
          second sect1 of the first chapter within the first part
          of a Docbook &lt;quote>book&lt;/quote> document.&lt;/para>&lt;/listitem>
          &lt;listitem>&lt;para>And this is the next listitem.&lt;/para>&lt;/listitem>
          &lt;listitem>&lt;para>This is the fourth and last listitem.&lt;/para>&lt;/listitem>
        &lt;/orderedlist>

        &lt;p>Another paragraph....&lt;/p>
      &lt;/sect1>
    &lt;/chapter>
    &lt;chapter>&lt;title>More content&lt;/title>
      &lt;p>More chapters, sections, paragraphs, and such....&lt;/p>
    &lt;/chapter>
  &lt;/part>
&lt;/book></eg>
<p>Note that the declaration of the default namespace on the <code>&lt;book></code>
tag isn't required for fragment interchange, but is shown for the purposes
of completeness of this example.</p>
</div3>
<div3>
<head>The fragment body</head>
<p>The following shows the fragment body in a separate file ready for interchange.
For the purposes of this example, we are assuming that this is in the file <code>~me/mydocs/myfrag.xml</code>
on Acme's web server.</p>
<eg>          &lt;listitem>&lt;para>This is the second listitem within the
          second sect1 of the first chapter within the first part
          of a Docbook &lt;quote>book&lt;/quote> document.&lt;/para>&lt;/listitem>
          &lt;listitem>&lt;para>And this is the next listitem.&lt;/para>&lt;/listitem>
</eg>
</div3>
<div3>
<head>The fragment context specification document</head>
<p>The following shows what the fcs document might look like for the above
parent document and fragment body. If this were in the file (e.g., <code>myfrag.fcs</code>),
when this file is sent to any recipient with a fragment-aware tool, that tool
should be able to access and process the desired fragment body.</p>
<eg>  &lt;f:fcs xmlns:f="&frag-ns-uri;"
         extref="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
         parentref="http://www.acme.com/~me/mydocs/mybook.xml"
         xmlns="http://www.oasis-open.org/docbook/DocbookSchema">
    &lt;book>
      &lt;part>
        &lt;chapter>
          &lt;sect1/>
          &lt;sect1>
            &lt;orderedlist numeration="arabic">
              &lt;listitem/>
              &lt;f:fragbody fragbodyref="http://www.acme.com/~me/mydocs/myfrag.xml"/>
            &lt;/orderedlist>
          &lt;/sect1>
        &lt;/chapter>
      &lt;/part>
    &lt;/book>
  &lt;/f:fcs>
</eg>
<p>Note that the <code>fragbodyref</code> value, which is a URI reference
[<bibref ref="rfc2396"/>], could be a URL, a file name, a MIME content id,
etc., depending on the MIME type of the referenced resource. Also note that
the <code>parentref</code> value above is only there for the information of
the receiving application, but is not necessary for this example's operation.
Likewise, the <code>extref</code> would only be necessary if the receiving
application wanted to be able to do validation.</p>
</div3>
</div2>
</div1>
<div1>
<head id="conformance">Conformance</head>
<p>A fragment conforms to this XML Fragment Interchange Recommendation if
it adheres to all syntactic requirements defined in this Recommendation. A
fragment is syntactically correct if all of the requirements specified in
Section 5.2 are met.</p>
<p>Application software acting as recipient conforms to the XML Fragment 
Interchange Recommendation if it interprets all conforming XML fragments (as
defined above) according to all required semantics prescribed by this Recommendation,
and, for any optional semantics it chooses to support, supports them in the
way prescribed. Specifically, conforming application software must be able
to parse all conforming valid fragment context specification information whether
it chooses to support its semantics or not. Application software acting as
sender conforms to the XML Fragment Interchange Recommendation if it creates
conforming XML fragments (as defined above) and, if including fragment context
information, includes conforming fragment context information according to
the requirements in section 4.</p>
<p>If fragment context information is included with a transmitted fragment,
then it should conform according to the requirements in section 4.</p>
</div1>
</body><back>
<div1>
<head id="references">References</head>
<div2>
<head id="refs-norm">Normative References</head>
<blist>
<bibl id="rfc2396" key="RFC 2396">IETF RFC 2396: <emph>Uniform Resource Identifiers
(URI): Generic Syntax</emph>. See <loc href="ftp://ftp.ietf.org/rfc/rfc2396.txt">ftp://ftp.ietf.org/rfc/rfc2396.txt</loc></bibl>
<bibl id="XML" key="XML 1.0">World Wide Web Consortium. <emph>Extensible Markup
Language (XML) 1.0.</emph> W3C Recommendation. See <loc href="&XMLRec;">&XMLRec;</loc></bibl>
<bibl id="Namespaces" key="XML Namespaces">World Wide Web Consortium. <emph>Namespaces
in XML</emph> W3C Proposed Recommendation. See <loc href="http://www.w3.org/TR/PR-xml-names">http://www.w3.org/TR/PR-xml-names</loc></bibl>
<bibl id="AssocStylesheets" key="Associating stylesheets">World Wide Web Consortium. <emph>Associating
stylesheets with XML documents</emph> W3C Working Draft. See <loc href="http://www.w3.org/TR/WD-xml-stylesheet">http://www.w3.org/TR/WD-xml-stylesheet</loc
></bibl>
</blist></div2>
<div2>
<head id="refs-other">Other References</head>
<blist>
<bibl id="TR9601" key="TR9601">OASIS (formerly SGML Open) <emph>Fragment Interchange
&mdash; SGML Open Technical Resolution 9601:1996</emph>. OASIS (SGML Open)
Technical Resolution. See <loc href="http://www.oasis-open.org/html/techpubs.htm#fragment">http://www.oasis-open.org/html/techpubs.htm#fragment</loc
> for an online version</bibl>
<bibl id="MIME" key="MIME">IETF RFC 2045: <emph>Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Bodies</emph>. See <loc
href="http://www.imc.org/rfc2045">http://www.imc.org/rfc2045</loc></bibl>
<bibl id="rfc2387" key="RFC 2387">IETF RFC 2387: <emph>The MIME Multipart/Related
Content-type</emph>. See <loc href="http://www.imc.org/rfc2387">http://www.imc.org/rfc2387</loc></bibl>
<bibl id="rfc2392" key="RFC 2392">IETF RFC 2392: <emph>Content-ID and Message-ID
Uniform Resource Locators</emph>. See <loc href="ftp://ftp.ietf.org/rfc/rfc2392.txt">ftp://ftp.ietf.org/rfc/rfc2392.txt</loc></bibl>
<bibl id="XML-FRAG-REQ" key="XML Fragment Requirements Document">World Wide
Web Consortium. <emph>XML Fragment Interchange Requirements</emph> W3C Note.
See <loc href="http://www.w3.org/TR/NOTE-XML-FRAG-REQ">http://www.w3.org/TR/NOTE-XML-FRAG-REQ</loc></bibl>
<bibl id="XPointer" key="XPointer WD">World Wide Web Consortium. <emph>XML
Pointer Language (XPointer)</emph> W3C Working Draft. See <loc href="http://www.w3.org/TR/WD-xptr">http://www.w3.org/TR/WD-xptr</loc></bibl>
</blist></div2>
</div1>
<inform-div1 id="packaging">
<head>Packaging and interchanging fragments</head>
<p>It is a design goal of this Recommendation to define a fragment context
specification to be a well-formed XML document. However, a fragment body itself
need not be a well-formed document, but only well-balanced. While it is important
to be able to package a fragment body with its fcs, it is expected that a
general XML-friendly packaging mechanism&mdash;beyond the scope of this Recommendation&mdash;will
be developed by the W3C that would satisfy this requirement. Meanwhile, applications
and interchange partners may agree on any packaging mechanism to aid in fragment
interchange. This appendix gives some non-normative examples of such possible
packaging mechanisms.</p>
<ednote id="packaging-req"><name>WG Note</name><date>1999/03/17</date><edtext>There
needs to be a requirement on the eventual XML Packaging WG to be able to handle
fragment interchange packaging needs. The XML Fragment chair will ensure any
XML Package WG briefing package/charter includes the necessary dependency
language.</edtext></ednote>
<p>The <code>fcs</code> element could be packaged along with the fragment
body by combining them into a single well-formed XML document. For the purposes
of fragment interchange packaging, one could define a simple &ldquo;document
type&rdquo; consisting of a &ldquo;head&rdquo; part containing the fcs (and,
potentially, other) metadata followed by a &ldquo;body&rdquo; part containing
the fragment body itself.</p>
<p>In the following template, <code>p</code> is defined as the local prefix
referring to the namespace defined for the packaging structure, and <code>f</code>,
as in previous sections, is the local prefix referring to the namespace defined
by this Recommendation for fragment-interchange related components. (Note
that this template example assumes that no explicit namespace prefixes are
present in the fragment body. If the fragment body contains explicit namespace
prefixes whose declarations are not also included in the fragment body, then
additional namespace declarations would be necessary on the <code>&lt;p:package></code>
or <code>&lt;f:fcs></code> element. If the parent document does not use namespaces
at all, then no default namespace declaration is needed for the fcs or its
package.)</p>
<p>The format of a complete fragment package might be outlined as follows:</p>
<eg>&lt;p:package xmlns:p="&pack-ns-uri;"
           xmlns:f="&frag-ns-uri;"
           xmlns="<emph>{the default namespace in effect at the start
                 of the fragment body in the parent document}</emph>">
  &lt;f:fcs <emph>{the ref attributes on the fcs tag}</emph>>
    <emph>{the content of the fcs with no namespace prefixes
      necessary except that on the &lt;f:fragbody/> element}</emph>
  &lt;/f:fcs>

  &lt;p:body>
  <emph>{the fragment body with no namespace prefixes necessary}</emph>
  &lt;/p:body>

&lt;/p:package>
</eg>
<note>
<p>The above template includes indentation and blank lines to help display
the overall structure of the package. However, all whitespace within the <code>p:body</code>
element <emph>is</emph> significant and is therefore part of the fragment
body. Therefore, the packaging process can introduce no whitespace (including
record ends immediately following <code>&lt;p:body></code> and immediately
preceding <code>&lt;/p:body></code>) within the <code>p:body</code> element.</p>
</note>
</inform-div1>
<inform-div1 id="examples">
<head>Examples</head>
<p>The following examples are designed in general to address the potential
reference scenarios described in <bibref ref="XML-FRAG-REQ"/>.</p>
<div2>
<head>One element of a transaction record as a fragment</head>
<p>The user has an XML document that represents a customer's set of purchases
at a bookstore, and the part of that document that represents the purchase
of a particular book needs to be represented as a fragment.</p>
<p>Here is the original XML document for the transaction:</p>
<eg>&lt;?xml version="1.0"?>
&lt;transaction TID="19990207-1234">
  &lt;purchase>
    &lt;book>
      &lt;Author>Frank Herbert&lt;/Author>
      &lt;Title>Dune&lt;/Title>
      &lt;Edition>Hardcover Reissue edition (April 1984)&lt;/Edition>
      &lt;ISBN>0399128964&lt;/ISBN>
      &lt;Price currency="USD">18.87&lt;/Price>
      &lt;Quantity>1&lt;/Quantity>
    &lt;/book>
    &lt;book>
      &lt;Author>J. R. R. Tolkien&lt;/Author>
      &lt;Title>The Book of Lost Tales (The History of Middle-Earth)&lt;/Title>
      &lt;Edition>Mass Market Paperback Reprint edition (June 1992)&lt;/Edition>
      &lt;ISBN>0345375211&lt;/ISBN>
      &lt;Price currency="USD">4.79&lt;/Price>
      &lt;Quantity>1&lt;/Quantity>
    &lt;/book>
  &lt;/purchase>
  &lt;refund RID="19990115-2">
    &lt;reason TID="19981220-3214">Late delivery&lt;/reason>
    &lt;value currency="USD">5.00&lt;/value>
  &lt;/refund>
  &lt;payment>
    &lt;client CID="123421"/>
    &lt;value currency="USD">18.66&lt;/value>
    &lt;creditcard type="MasterCard">
      &lt;bank>BankBoston&lt;/bank>
      &lt;owner>Joe J. Bill&lt;/owner>
      &lt;serial>1234567890&lt;/serial>
      &lt;expires>5/99&lt;/expires>
    &lt;/creditcard>
    &lt;status>Waiting for approval&lt;/status>
  &lt;/payment>
&lt;/transaction></eg>
<p>Here is a fragment representing the second book element from the above
document (the <code>sourcelocn</code> attribute on the <code>f:fcs</code>
element is optional and is shown merely as an example):</p>
<eg>&lt;?xml version="1.0"?>
&lt;p:package xmlns:p="http://acme.com/Packaging/1.0">
  &lt;p:fcs xmlns:f="http://www.w3.org/XML/Fragment/1.0"
         sourcelocn="http://acme.com/trans1234#root().child(1,purchase).child(2,book)">
    &lt;transaction>
      &lt;purchase>
        &lt;book/>
	&lt;p:fragbody/>
      &lt;/purchase>
    &lt;/transaction>
  &lt;/p:fcs>

  &lt;p:body>
    &lt;book>
      &lt;Author>J. R. R. Tolkien&lt;/Author>
      &lt;Title>The Book of Lost Tales (The History of Middle-Earth)&lt;/Title>
      &lt;Edition>Mass Market Paperback Reprint edition (June 1992)&lt;/Edition>
      &lt;ISBN>0345375211&lt;/ISBN>
      &lt;Price currency="USD">4.79&lt;/Price>
      &lt;Quantity>1&lt;/Quantity>
    &lt;/book>
  &lt;/p:body>
&lt;/p:package></eg>
</div2>
<div2>
<head>Use of external entities and MIME packaging</head>
<p>A user has an XML document that includes several external entities, and
she wants to be able to interchange a fragment that includes a reference to
the entities using MIME [<bibref ref="MIME"/>] packaging. (For references,
see also <bibref ref="rfc2387"/> and <bibref ref="rfc2392"/>.)</p>
<p>Here is the original document:</p>
<eg>&lt;?xml version="1.0"?>
&lt;!DOCTYPE book SYSTEM "http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd" [
&lt;!ENTITY title "My Book">
&lt;!ENTITY author "me">
&lt;!ENTITY try SYSTEM "try.cgm" NDATA CGM-BINARY>
]>
&lt;book>
  &lt;part>
    &lt;title>&amp;title;&lt;/title>
    &lt;introduction>This is my book ...&lt;/introduction>
    &lt;author>&amp;author;&lt;/author>
    &lt;chapter type="intro">
        &lt;sect1>The introduction ...&lt;/sect1>
    &lt;/chapter>
    &lt;chapter>...&lt;/chapter>
    &lt;chapter>
      &lt;p>This is a paragraph within the third chapter within
the first part of a Docbook &lt;quote>book&lt;/quote> document.&lt;/p>
      &lt;p>And this is a succeeding paragraph.&lt;/p>
      &lt;p>And an internal text entity reference &amp;author;.&lt;/p>
      &lt;p>And a reference to an unparsed entity (a CGM graphic):
         &lt;graphic entityref="try">&lt;/graphic>&lt;/p>
    &lt;/chapter>
    &lt;chapter>...&lt;/chapter>
  &lt;/part>
&lt;/book></eg>
<p>Note that the DocBook DTD includes the following (which is therefore not
included in the internal subset of this document):</p>
<eg>&lt;!NOTATION CGM-BINARY PUBLIC "ISO 8632/3//NOTATION Binary Encoding//EN">
</eg>
<p>Here is a fragment that represents the contents of the third chapter:</p>
<eg>&lt;?xml version="1.0"?>
&lt;f:fcs xmlns:f="http://www.w3.org/XML/Fragment/1.0"
       xmlns="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
       extref="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
       intref="mybook.decls">
    &lt;book>
      &lt;part>
        &lt;chapter type="intro"/>
        &lt;chapter/>
        &lt;chapter>
            &lt;f:fragbody fragbodyref="chapter3.xml"/>
        &lt;/chapter>
      &lt;/part>
    &lt;/book>
  &lt;/f:fcs></eg>
<p>Here is the corresponding fragment body:</p>
<eg>      &lt;p>This is a paragraph within the third chapter within
the first part of a Docbook &lt;quote>book&lt;/quote> document.&lt;/p>
      &lt;p>And this is a succeeding paragraph.&lt;/p>
      &lt;p>And an internal text entity reference &amp;author;.&lt;/p>
      &lt;p>And a reference to an unparsed entity (a CGM graphic):
         &lt;graphic entityref="try">&lt;/graphic>&lt;/p>
</eg>
<p>Here is the associated internal subset:</p>
<eg>&lt;!ENTITY title "My Book">
&lt;!ENTITY author "me">
&lt;!ENTITY try SYSTEM "try.cgm" NDATA CGM-BINARY>
</eg>
<p>Here is the external entity (represented in Base 64 encoding, since this
is really a binary entity):</p>
<eg>ACEAABAiAAEQXwBEQyJTb3VyY2U6IEhTSSAvV01GLXRvLUNHTSBmaWx0ZXIg
LyBWZXJzaW9uIDEuMzUgIiAiRGF0ZTogMTk5OS0wMS0xNyIRZgAB//8AARBi
AAAQpgAAAAkAFxFGAAAA////EYQwIgAQEYogyAAAAAB//3//AAARvwC3C1RJ
TUVTX1JPTUFODFRJTUVTX0lUQUxJQwpUSU1FU19CT0xEEVRJTUVTX0JPTERf
SVRBTElDCUhFTFZFVElDQRFIRUxWRVRJQ0FfT0JMSVFVRQ5IRUxWRVRJQ0Ff
Qk9MRBZIRUxWRVRJQ0FfQk9MRF9PQkxJUVVFB0NPVVJJRVIOQ09VUklFUl9J
VEFMSUMMQ09VUklFUl9CT0xEE0NPVVJJRVJfQk9MRF9JVEFMSUMGU1lNQk9M
ABHOAAABQgABAUEABAMqLToR4gABAGEAACAmAAE9NJ9IIEIAASBiAAAgggAA
IKIAACDI95D0wAhqCzoAAACAQWj5cAa5/TEJikGGAogCUQGQUGIACEAo+dD/
+v7g+TpRYgACUkwAAQAEAAAAAAAAAABRgBxUggAAABkAGQAAFKCAAJAkAEg/
MoAAQlTb21lIFRleHQAoABA</eg>
<p>And here is an example of MIME packaging used to transmit the fragment
context specification, the fragment body, the internal subset, and the external
entity within a single stream such as a mail message:</p>
<eg>Content-Type: multipart/related; boundary="/04w6evG8XlLl3ft";type="text/xml"

--/04w6evG8XlLl3ft
Content-Type: text/xml; charset=us-ascii
Content-ID: &lt;part1>
Content-Disposition: attachment; filename="mybook.decls"

&lt;!ENTITY title "My Book">
&lt;!ENTITY author "me">
&lt;!ENTITY try SYSTEM "cid:part2" NDATA CGM-BINARY>

--/04w6evG8XlLl3ft
Content-Type: image/cgm
Content-ID: &lt;part2>
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="try.cgm"

ACEAABAiAAEQXwBEQyJTb3VyY2U6IEhTSSAvV01GLXRvLUNHTSBmaWx0ZXIg
LyBWZXJzaW9uIDEuMzUgIiAiRGF0ZTogMTk5OS0wMS0xNyIRZgAB//8AARBi
AAAQpgAAAAkAFxFGAAAA////EYQwIgAQEYogyAAAAAB//3//AAARvwC3C1RJ
TUVTX1JPTUFODFRJTUVTX0lUQUxJQwpUSU1FU19CT0xEEVRJTUVTX0JPTERf
SVRBTElDCUhFTFZFVElDQRFIRUxWRVRJQ0FfT0JMSVFVRQ5IRUxWRVRJQ0Ff
Qk9MRBZIRUxWRVRJQ0FfQk9MRF9PQkxJUVVFB0NPVVJJRVIOQ09VUklFUl9J
VEFMSUMMQ09VUklFUl9CT0xEE0NPVVJJRVJfQk9MRF9JVEFMSUMGU1lNQk9M
ABHOAAABQgABAUEABAMqLToR4gABAGEAACAmAAE9NJ9IIEIAASBiAAAgggAA
IKIAACDI95D0wAhqCzoAAACAQWj5cAa5/TEJikGGAogCUQGQUGIACEAo+dD/
+v7g+TpRYgACUkwAAQAEAAAAAAAAAABRgBxUggAAABkAGQAAFKCAAJAkAEg/
MoAAQlTb21lIFRleHQAoABA

--/04w6evG8XlLl3ft
Content-Type: text/xml; charset=us-ascii
Content-ID: &lt;part3>
Content-Disposition: attachment; filename="chapter3.xml"

      &lt;p>This is a paragraph within the third chapter within
the first part of a Docbook &lt;quote>book&lt;/quote> document.&lt;/p>
      &lt;p>And this is a succeeding paragraph.&lt;/p>
      &lt;p>And an internal text entity reference &amp;author;.&lt;/p>
      &lt;p>And a reference to an unparsed entity (a CGM graphic):
         &lt;graphic entityref="try">&lt;/graphic>&lt;/p>

--/04w6evG8XlLl3ft
Content-Type: text/xml; charset=us-ascii

&lt;?xml version="1.0"?>
&lt;f:fcs xmlns:f="http://www.w3.org/XML/Fragment/1.0"
       xmlns="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
       extref="http://www.oasis-open.org/docbook/docbook/3.0/docbook.dtd"
       intref="cid:part1">
    &lt;book>
      &lt;part>
        &lt;chapter type="intro"/>
        &lt;chapter/>
        &lt;chapter>
            &lt;f:fragbody fragbodyref="cid:part3"/>
        &lt;/chapter>
      &lt;/part>
    &lt;/book>
&lt;/f:fcs>

--/04w6evG8XlLl3ft--
</eg>
</div2>
<div2>
<head>Indexes into a large document</head>
<p>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 &ldquo;index&rdquo;
for each document portion (fragment) that they wish to so address. The &ldquo;index&rdquo;
consists of a fragment context specification in combination with a packaging
mechanism designed for quick access to the fragment body. This should be used
to view and browse documents with a flat structure, like HTML, on devices
where only a part of the document can be parsed or rendered.</p>
<eg>&lt;?xml version="1.0"?>
&lt;f:fcs xmlns:f="http://www.w3.org/XML/Fragment/1.0"
       xmlns=""
       fragbodyref="http://www.w3.org/TR/REC-xml.html#sec-xml-and-sgml"
       extref="http://www.w3.org/TR/REC-html40-971218/loose.dtd">
  &lt;html>
    &lt;head>
      &lt;link rel='STYLESHEET' type='text/css' href='/StyleSheets/TR/rec.css'/>
    &lt;/head>
    &lt;body>
      &lt;h1>Extensible Markup Language (XML) 1.0&lt;/h1>
      &lt;h2 ID='sec-intro'>1. Introduction&lt;/h2>
      &lt;h3 ID='sec-origin-goals'>1.1 Origin and Goals&lt;/h3>
      &lt;h3 ID='sec-terminology'>1.2 Terminology&lt;/h3>
      &lt;h2 ID='sec-documents'>2. Documents&lt;/h2>
      &lt;h3 ID='sec-well-formed'>2.1 Well-Formed XML Documents&lt;/h3>
      &lt;h3 ID='charsets'>2.2 Characters&lt;/h3>
      &lt;h3 ID='sec-common-syn'>2.3 Common Syntactic Constructs&lt;/h3>
      &lt;h3 ID='syntax'>2.4 Character Data and Markup&lt;/h3>
      &lt;h3 ID='sec-comments'>2.5 Comments&lt;/h3>
      &lt;h3 ID='sec-pi'>2.6 Processing Instructions&lt;/h3>
      &lt;h3 ID='sec-cdata-sect'>2.7 CDATA Sections&lt;/h3>
      &lt;h3 ID='sec-prolog-dtd'>2.8 Prolog and Document Type Declaration&lt;/h3>
      &lt;h3 ID='sec-rmd'>2.9 Standalone Document Declaration&lt;/h3>
      &lt;h3 ID='sec-white-space'>2.10 White Space Handling&lt;/h3>
      &lt;h3 ID='sec-line-ends'>2.11 End-of-Line Handling&lt;/h3>
      &lt;h3 ID='sec-lang-tag'>2.12 Language Identification&lt;/h3>
      &lt;h2 ID='sec-logical-struct'>3. Logical Structures&lt;/h2>
      &lt;h3 ID='sec-starttags'>3.1 Start-Tags, End-Tags, and Empty-Element Tags&lt;/h3>
      &lt;h3 ID='elemdecls'>3.2 Element Type Declarations&lt;/h3>
      &lt;h4 ID='sec-element-content'>3.2.1 Element Content&lt;/h4>
      &lt;h4 ID='sec-mixed-content'>3.2.2 Mixed Content&lt;/h4>
      &lt;h3 ID='attdecls'>3.3 Attribute-List Declarations&lt;/h3>
      &lt;h4 ID='sec-attribute-types'>3.3.1 Attribute Types&lt;/h4>
      &lt;h4 ID='sec-attr-defaults'>3.3.2 Attribute Defaults&lt;/h4>
      &lt;h4 ID='AVNormalize'>3.3.3 Attribute-Value Normalization&lt;/h4>
      &lt;h3 ID='sec-condition-sect'>3.4 Conditional Sections&lt;/h3>
      &lt;h2 ID='sec-physical-struct'>4. Physical Structures&lt;/h2>
      &lt;h3 ID='sec-references'>4.1 Character and Entity References&lt;/h3>
      &lt;h3 ID='sec-entity-decl'>4.2 Entity Declarations&lt;/h3>
      &lt;h4 ID='sec-internal-ent'>4.2.1 Internal Entities&lt;/h4>
      &lt;h4 ID='sec-external-ent'>4.2.2 External Entities&lt;/h4>
      &lt;h3 ID='TextEntities'>4.3 Parsed Entities&lt;/h3>
      &lt;h4 ID='sec-TextDecl'>4.3.1 The Text Declaration&lt;/h4>
      &lt;h4 ID='wf-entities'>4.3.2 Well-Formed Parsed Entities&lt;/h4>
      &lt;h4 ID='charencoding'>4.3.3 Character Encoding in Entities&lt;/h4>
      &lt;h3 ID='entproc'>4.4 XML Processor Treatment of Entities and References&lt;/h3>
      &lt;h4 ID='not-recognized'>4.4.1 Not Recognized&lt;/h4>
      &lt;h4 ID='included'>4.4.2 Included&lt;/h4>
      &lt;h4 ID='include-if-valid'>4.4.3 Included If Validating&lt;/h4>
      &lt;h4 ID='forbidden'>4.4.4 Forbidden&lt;/h4>
      &lt;h4 ID='inliteral'>4.4.5 Included in Literal&lt;/h4>
      &lt;h4 ID='notify'>4.4.6 Notify&lt;/h4>
      &lt;h4 ID='bypass'>4.4.7 Bypassed&lt;/h4>
      &lt;h4 ID='as-PE'>4.4.8 Included as PE&lt;/h4>
      &lt;h3 ID='intern-replacement'>4.5 Construction of Internal Entity Replacement Text&lt;/h3>
      &lt;h3 ID='sec-predefined-ent'>4.6 Predefined Entities&lt;/h3>
      &lt;h3 ID='Notations'>4.7 Notation Declarations&lt;/h3>
      &lt;h3 ID='sec-doc-entity'>4.8 Document Entity&lt;/h3>
      &lt;h2 ID='sec-conformance'>5. Conformance&lt;/h2>
      &lt;h3 ID='proc-types'>5.1 Validating and Non-Validating Processors&lt;/h3>
      &lt;h3 ID='safe-behavior'>5.2 Using XML Processors&lt;/h3>
      &lt;h2 ID='sec-notation'>6. Notation&lt;/h2>
      &lt;h3>Appendices&lt;/h3>A. &lt;A ID='sec-bibliography'>References&lt;/A>
      &lt;h3 ID='sec-existing-stds'>A.1 Normative References&lt;/h3>
      &lt;h3 ID='null'>A.2 Other References&lt;/h3>
      &lt;h2 ID='CharClasses'>B. Character Classes&lt;/h2>
      &lt;f:fragbody/>
      &lt;h2 ID='sec-entexpand'>D. Expansion of Entity and Character References (Non-Normative)&lt;/h2>
      &lt;h2 ID='determinism'>E. Deterministic Content Models (Non-Normative)&lt;/h2>
      &lt;h2 ID='sec-guessing'>F. Autodetection of Character Encodings (Non-Normative)&lt;/h2>
      &lt;h2 ID='sec-xml-wg'>G. W3C XML Working Group (Non-Normative)&lt;/h2>
    &lt;/body>
  &lt;/html>
&lt;/f:fcs></eg>
</div2>
</inform-div1>
<inform-div1>
<head id="design-principles">Design Principles</head>
<p>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 were used (the
order of these principles is not necessarily significant):</p>
<olist>
<item><p>XML fragment specifications should be usable over the internet.</p>
</item>
<item><p>XML fragment specifications should support the specification of context
for any well-formed chunk of XML; the definition of a fragment may be broadened
to allow any chunk of XML that matches XML's &ldquo;content&rdquo; production
(production [43]). Chunks of XML that do not match XML's &ldquo;content&rdquo;
production (i.e., that are not well-formed entities) are specifically out
of scope.</p></item>
<item><p>XML fragment specifications should be optimized to work with simpler
XML fragments (such as those conforming to the simpler XML profile being developed
by the XML Syntax WG), though the language should also work with any XML (&ldquo;the
easy stuff should be easy, and the harder stuff should be possible&rdquo;);
working with SGML features not included in XML (including those, such as tag
omission, allowed in HTML) is not a goal.</p></item>
<item><p>XML fragment specifications should be capable of being specified
both in the same storage object as the fragment body itself as well as in
a separate object linked in some fashion to the fragment body.</p></item>
<item><p>XML fragment specifications should support interaction with XML browsers,
editors, repositories, and other XML applications.</p></item>
<item><p>SGML features and characteristics not included in XML shall not be
taken into consideration in the design of our fragment context specification
solution.</p></item>
<item><p>It is specifically not a goal that XML fragment specifications be
designed in consideration of non-XML HTML browsers, parsers, or other non-XML
applications.</p></item>
<item><p>Since interoperability is a primary goal, there should be only one
language for the fragment context specification rather than multiple &ldquo;features.&rdquo;
However, since the goal is to provide enough information to parse the fragment,
and well-formed XML may not require any extra information to allow it to be
parsed, no specific set of context information should be required in all context
specifications. (No implementation should choke on any valid piece of context
information, but no implementation should be considered non-compliant for
choosing to ignore [on the receiving end]&mdash;or not include [on the sending
end]&mdash;a specific piece of context information if doing so makes sense
in the particular environment.)</p></item>
<item><p>XML fragment specifications should leverage other recommendations
and standards, including XML 1.0, XML Namespace, XPointer, XML Information
Set, the SGML Open TR9601:1996 on Fragment Interchange, and relevant IETF
work.</p></item>
<item><p>XML fragment specifications should be human-readable and reasonably
clear.</p></item>
<item><p>Terseness in XML fragment specification syntax is of minimal importance.</p>
</item>
<item><p>Issues involved with the possible &ldquo;return&rdquo; of any fragment
to its original context and the determination of the possible validity of
the &ldquo;returned&rdquo; fragment in its original context are beyond the
scope of this activity.</p></item>
</olist>
</inform-div1>
<inform-div1>
<head id="acknow">Acknowledgments</head>
<p>The following participated in the XML Fragment WG during the authoring
of this Recommendation:</p>
<slist>
<sitem>Paula Angerstein, Vignette</sitem>
<sitem>Tim Boland, NIST</sitem>
<sitem>Charles Frankston, Microsoft</sitem>
<sitem>Paul Grosso, Arbortext</sitem>
<sitem>Michael Hyman, Microsoft</sitem>
<sitem>Joel Nava, Adobe</sitem>
<sitem>Conleth O'Connell, Vignette</sitem>
<sitem>Joakim Östman, Citec</sitem>
<sitem>Christina Portillo, Boeing</sitem>
<sitem>Shriram Revankar, Xerox</sitem>
<sitem>Daniel Veillard, W3C</sitem>
</slist>
</inform-div1>
<inform-div1>
<head id="changes">Changes from Previous Public Working Drafts</head>
<div2>
<head>Changes between the March 3 and April 2 WD</head>
<p>Major changes to the previous public working draft are outlined below.
Various other changes have also been made throughout the document.</p>
<olist>
<item><p>Added &ldquo;fragment context specification document&rdquo; (<specref
ref="fcs-doc"/>) as a defined term.</p></item>
<item><p>Added a <code>fragbodyref</code> attribute to the <code>fragbody</code>
element (<specref ref="NT-FCSfragbody"/>) and renamed the <code>fragbodyref</code>
attribute of the fcs element to <code>sourcelocn</code>.</p></item>
<item><p>Added a production (<specref ref="NT-fcs"/>) to allow an fcs to have
a prolog; added a well-formed, namespace complete FCS Constraint.</p></item>
<item><p>Wrote a new subsection of the fcs notation chapter (<specref ref="fcs-semantics"/>)
describing the Semantics of a fragment context specification.</p></item>
<item><p>Wrote a new subsection of the fcs notation chapter (<specref ref="fcs-example"/>)
giving a complete example of a fragment context specification use (without
packaging).</p></item>
<item><p>Moved the chapter on packaging to the non-normative back matter (<specref
ref="packaging"/>).</p></item>
<item><p>Did major editing of the appendix of examples (<specref ref="examples"/>).</p>
</item>
</olist>
</div2>
<div2>
<head>Changes between the April 2 and June 19 WD</head>
<p>Major changes to the previous public working draft are outlined below.
Various other minor changes have also been made to the document.</p>
<olist>
<item><p>The Status section was updated.</p></item>
<item><p>References to XPointer usage were replaced with references to &ldquo;URI
reference [RFC 2396].&rdquo;</p></item>
<item><p>Some items in the fragment context information set were moved from
the &ldquo;affect proper parsing&rdquo; list to the &ldquo;cannot affect proper
parsing&rdquo; list.</p></item>
<item><p>An additional note was added at the top of the Overview of the fcs
to indicate what kinds of fci is necessary and sufficient for CSS use.</p>
</item>
<item><p>The conformance section was expanded.</p></item>
<item><p>References to related IETF RFC's were added.</p></item>
<item><p>Example C.2 was modified to use content ids.</p></item>
</olist>
</div2>
</inform-div1>
</back></spec>
