C
CB
I am using xerces 2.5.0 and xalan 2.6.0, and am following the xinclude
instructions on the xerces faq at
http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no
luck. I imagine I must be missing something fundamental, can someone
point it out, please?
Here are all the gory details;
---- command line ----
java \
-Djava.endorsed.dirs='/usr/local/xerces-j;/usr/local/xalan-j' \
-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=\
org.apache.xerces.parsers.XIncludeParserConfiguration \
org.apache.xalan.xslt.Process -in world.xml -xsl simple.xslt
---- simple.xsd ----
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="element"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
---- hello.xml ----
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="simple.xsd">
<element>hello</element>
</root>
---- world.xml ----
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="simple.xsd">
<xi:include href="hello.xml"
xmlns:xi="http://www.w3.org/2003/XInclude" />
<element>world</element>
</root>
---- simple.xslt ----
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text" indent="no"/>
<xsl:template match="//root/element">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
---- expected output ----
hello
world
---- actual output ----
world
instructions on the xerces faq at
http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no
luck. I imagine I must be missing something fundamental, can someone
point it out, please?
Here are all the gory details;
---- command line ----
java \
-Djava.endorsed.dirs='/usr/local/xerces-j;/usr/local/xalan-j' \
-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=\
org.apache.xerces.parsers.XIncludeParserConfiguration \
org.apache.xalan.xslt.Process -in world.xml -xsl simple.xslt
---- simple.xsd ----
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="element"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
---- hello.xml ----
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="simple.xsd">
<element>hello</element>
</root>
---- world.xml ----
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="simple.xsd">
<xi:include href="hello.xml"
xmlns:xi="http://www.w3.org/2003/XInclude" />
<element>world</element>
</root>
---- simple.xslt ----
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="text" indent="no"/>
<xsl:template match="//root/element">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
---- expected output ----
hello
world
---- actual output ----
world