L
Larry
Given the "includer" xml file:
<?xml version="1.0"?>
<test-includer
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:testns="http://www.w3.org/TR/REC-xml-names"
xmlns:xi="http://www.w3.org/2001/XInclude"<xi:include
href="test-included.xml"
parse="xml"
/>
</test-includer>
and the "included" xml file:
<testns:test-element>1</testns:test-element>
and the xsl file:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:testns="http://www.w3.org/TR/REC-xml-names"<xslutput method="text"/>
<xsl:template match="/">
<xsl:value-of select="testns:test-element"/>
</xsl:template>
how do I avoid the duplication of the testns declaration
in the "includer" xml and the xsl file, and how do I
cause the testns namespace to be inherited by the
included elements (e.g. <testns:test-element> ). IOW,
I want to avoid the error message from xsltproc:
xsltproc --xinclude -o test-includer.html test-includer.xsl
test-includer.xml
test-included.xml:1: namespace error : Namespace prefix testns on
test-element is not defined
<testns:test-element>1</testns:test-element>
^
TIA.
<?xml version="1.0"?>
<test-includer
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:testns="http://www.w3.org/TR/REC-xml-names"
xmlns:xi="http://www.w3.org/2001/XInclude"<xi:include
href="test-included.xml"
parse="xml"
/>
</test-includer>
and the "included" xml file:
<testns:test-element>1</testns:test-element>
and the xsl file:
<?xml version="1.0"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:testns="http://www.w3.org/TR/REC-xml-names"<xslutput method="text"/>
<xsl:template match="/">
<xsl:value-of select="testns:test-element"/>
</xsl:template>
how do I avoid the duplication of the testns declaration
in the "includer" xml and the xsl file, and how do I
cause the testns namespace to be inherited by the
included elements (e.g. <testns:test-element> ). IOW,
I want to avoid the error message from xsltproc:
xsltproc --xinclude -o test-includer.html test-includer.xsl
test-includer.xml
test-included.xml:1: namespace error : Namespace prefix testns on
test-element is not defined
<testns:test-element>1</testns:test-element>
^
TIA.