Oct 10, 2008

XInclude, jaxp and xerces

XInclude defines a powerful way to control inclusions of xml fragments in another xml file:
<xi:include
xi="http://www.w3.org/2001/XInclude"
href="source.xml"
xpointer="xpointer(string-range(chapter/p[1],'Sentence 2')/range-to(string-range(/chapter/p[2]/i,'3.',1,2)))">
</xi:include>

This looks good, however in reality none of the current parser implementations support that ! For example, Xerces (implemented in jaxp 1.3 & 1.4) only supports xpointer="element(...)". This makes it almost useless, unless a whole tree has to be included. It is not possible to easily merge two xml files this way.

Frédéric Laurent already noticed this 3 years ago... It's time for a Java expert to implement it in Xerces !

No comments: