xsl:include question / error messages
Posted: Fri Jan 04, 2008 2:25 pm
Hi,
I often works with xsl:includes.
When I edit an xsl file which is included in another xsl I always get an error that some templates or variables are missing because these are defined in another xsl.
How can I solve this problem?
Example:
file nl.xsl
file test.xsl
I get an error in test.xsl the variable "template_name" and template "include_test" isn't declared. I am using Xalan XSLT Processor and oXygenXML 9.1
Thx walter
I often works with xsl:includes.
When I edit an xsl file which is included in another xsl I always get an error that some templates or variables are missing because these are defined in another xsl.
How can I solve this problem?
Example:
file nl.xsl
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:variable name="template_name">B2C</xsl:variable>
<xsl:include href="test.xsl" />
<xsl:template name="inculde_test"/>
</xsl:stylesheet>
Code: Select all
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="\">
<xsl:value-of select="$template_name"/>
<xsl:call-template name="include_test"/>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
Thx walter