The problem
-
XML document may become too large to parse or transfer
-
Need for a mechanism to isolate a fragment of an XML document
-
One also need to provide fragment metadata
-
And a way to combine them
What does it looks like
Technical choices
-
The fragment body is a well-balanced chunk of the original XML document
-
The fragment context is expressed as well-formed XML
-
Flexibility in the expressiveness of the fragment context is required
-
An XML packaging is suggested, but stay non-normative
The fragment context
-
Placeholder for pointers to subsets, parent, and the fragment in-situ
-
Is an XML tree containing at least all the ancestors nodes of the fragment
-
Has a special "fragbody" element expressing the location of the fragment in
that tree
-
Can be enriched by others nodes like fragment siblings and ancestors sibling
-
Attributes are allowed, but not text content
Example of a fragment context
<f:fcs xmlns:f="http://www.w3.org/XML/Fragment/1.0"
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">
<book>
<part>
<chapter>
<sect1/>
<sect1>
<orderedlist numeration="arabic">
<listitem/>
<f:fragbody fragbodyref="http://www.acme.com/~me/mydocs/myfrag.xml"/>
</orderedlist>
</sect1>
</chapter>
</part>
</book>
</f:fcs>
Fragment context tricks
-
Be careful with entities references, you may get well-formedness errors
-
It can be used to provide an Index to a large document, c.f. example C.3.
-
The sourcelocn used XPointer, but the syntax will change
The packaging syntax
Defined in a
non -normative appendix
<p:package xmlns:p="http://www.w3.org/XML/Package/1.0"
xmlns:f="http://www.w3.org/XML/Fragment/1.0"
xmlns="{the default namespace in effect at the start
of the fragment body in the parent document}">
<f:fcs {the ref attributes on the fcs tag}>
{the content of the fcs with no namespace prefixes
necessary except that on the <f:fragbody/> element}
</f:fcs>
<p:body>
{the fragment body with no namespace prefixes necessary}
</p:body>
</p:package>
Packaging tricks
-
Again, be careful with entities references.
-
Other metadata can be added too, fcs is just one of them
-
It will be overriden by the work from the XML Packaging WG.
Future
-
Proposed Req before WWW8
-
IBM talking about implementation, but they are blocked by XPointer
-
Schemas will help w.r.t. the current subsets problem
-
Most participants in Fragment will join XML Packaging WG
-
A revision will have to be done when XLink will support multiple links on one elem.