Streaming basically impossible in the face of XPointers

This has been brought up before, but a recent test case raised by 
Jonathan Marsh indicated that the problem was worse than I had 
thought. An XPointer without an href part can point iunto the same 
document. For exxample,

<root>
   <element id="bar"/>
   <xi:include xpointer="bar"/>
</root>

Since XPointers can point forwards and backwards this means that even 
a minimally conforming implementation has to keep the entire document 
in memory until it has been completely processed. Furthermore, even a 
tree-based implementation can't modify a document in place because it 
may need to resolve XPointers that refer to the original, unmodified 
document.

As an implemennter, I see no plausible way to handle XPointers in 
SAX, and even in tree-based APIs like XOM (and presumably other 
tree-based APIs) it's very tough. XPointers are an implementation 
dependance conformance issue to start with because some 
implementations support the xpointer scheme, some don't, and some 
support it partially. However, a lot of use cases don't require 
XPointers at all.  I wonder if it would be better if they were 
removed completely?
-- 

   Elliotte Rusty Harold
   elharo@metalab.unc.edu
   Effective XML (Addison-Wesley, 2003)
   http://www.cafeconleche.org/books/effectivexml
   http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA

Received on Monday, 26 January 2004 11:55:57 UTC