XInclusion: fragment defined by ID?
Posted: Thu Jan 19, 2006 9:34 am
Hello!
I want to do fragment XInclusion. Something like [url]http://www.w3.org/TR/xinclude/#fragment-example[/url] I have element "table" defined with ID according to [url]http://www.zvon.org/xxl/XPointerTutoria ... d_st0.html[/url] using XSD as:
<xs:element name="table">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="column"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="table"/>
</xs:sequence>
<xs:attribute name="xmlName" use="required" type="xs:NCName"/>
<xs:attribute name="sql" use="required"/>
<xs:attribute ref="xml:base" use="optional"/>
<xs:attribute name="id" type="xs:ID" use="optional"/>
</xs:complexType>
</xs:element>
But when I want to use <xi:include href="test.xml" xpointer="element(bdp)"/>, there is an error "XPointer resolution unsuccessfull". When I use <xi:include href="test.xml" xpointer="element(/1)"/> (first element of document tree), all is OK.
So, please, where is the problem? Does oXygen (JAXP) support XPointer expression based on ID? Or is the problem on my side (I hope it is). Thank You, Stepan.
My test.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<table id="bdp" xmlName="bdp" sql="select * from testTable">
<column xmlName="kod" sqlName="kod"/>
</table>
I want to do fragment XInclusion. Something like [url]http://www.w3.org/TR/xinclude/#fragment-example[/url] I have element "table" defined with ID according to [url]http://www.zvon.org/xxl/XPointerTutoria ... d_st0.html[/url] using XSD as:
<xs:element name="table">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="column"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="table"/>
</xs:sequence>
<xs:attribute name="xmlName" use="required" type="xs:NCName"/>
<xs:attribute name="sql" use="required"/>
<xs:attribute ref="xml:base" use="optional"/>
<xs:attribute name="id" type="xs:ID" use="optional"/>
</xs:complexType>
</xs:element>
But when I want to use <xi:include href="test.xml" xpointer="element(bdp)"/>, there is an error "XPointer resolution unsuccessfull". When I use <xi:include href="test.xml" xpointer="element(/1)"/> (first element of document tree), all is OK.
So, please, where is the problem? Does oXygen (JAXP) support XPointer expression based on ID? Or is the problem on my side (I hope it is). Thank You, Stepan.
My test.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<table id="bdp" xmlName="bdp" sql="select * from testTable">
<column xmlName="kod" sqlName="kod"/>
</table>