Basic Xinclude question
Posted: Tue Sep 20, 2005 5:37 pm
I'm having some trouble understanding how Xinclude should work. By the examples on http://www.w3.org, I think this should work to include all of the file bfile.xml in axml.xml. I'm thinking it will find bfile.xml in the same directory as afile.xml
afile.xml:
<?xml version="1.0" encoding="UTF-8"?>
<forest xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="bfile.xml" />
<tree><name>oak</name></tree>
<tree><name>elm</name></tree>
</forest>
bfile.xml:
<?xml version="1.0" encoding="UTF-8"?>
<residents>
<animal><name>bear</name></animal>
<animal><name>weasel</name></animal>
<animal><name>wizard</name></animal>
</residents>
ab.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
</xsl:stylesheet>
Running ab.xsl on afile.xml results in oak and elm only. Whereas running ab.xsl on this file results in the residents first, then the trees:
<?xml version="1.0" encoding="UTF-8"?>
<forest xmlns:xi="http://www.w3.org/2001/XInclude">
<residents>
<animal><name>bear</name></animal>
<animal><name>weasel</name></animal>
<animal><name>wizard</name></animal>
</residents>
<tree><name>oak</name></tree>
<tree><name>elm</name></tree>
</forest>
I think I'm missing something basic here?
thanks for any advice -- GeorgeG
afile.xml:
<?xml version="1.0" encoding="UTF-8"?>
<forest xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="bfile.xml" />
<tree><name>oak</name></tree>
<tree><name>elm</name></tree>
</forest>
bfile.xml:
<?xml version="1.0" encoding="UTF-8"?>
<residents>
<animal><name>bear</name></animal>
<animal><name>weasel</name></animal>
<animal><name>wizard</name></animal>
</residents>
ab.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
</xsl:stylesheet>
Running ab.xsl on afile.xml results in oak and elm only. Whereas running ab.xsl on this file results in the residents first, then the trees:
<?xml version="1.0" encoding="UTF-8"?>
<forest xmlns:xi="http://www.w3.org/2001/XInclude">
<residents>
<animal><name>bear</name></animal>
<animal><name>weasel</name></animal>
<animal><name>wizard</name></animal>
</residents>
<tree><name>oak</name></tree>
<tree><name>elm</name></tree>
</forest>
I think I'm missing something basic here?
thanks for any advice -- GeorgeG