xsl:include question / error messages

<oXygen/> general issues.
walterbt
Posts: 2
Joined: Tue Aug 21, 2007 5:47 pm

xsl:include question / error messages

Post by walterbt » 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

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>
file test.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:template match="\">
<xsl:value-of select="$template_name"/>
<xsl:call-template name="include_test"/>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
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

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Fri Jan 04, 2008 3:04 pm

Hello,

This is a perfect application for oXygen's notion of validation scenario. Just define a validation scenario in which the base unit is nl.xsl and associate this scenario with test.xsl. Both manual validation and automatic validation will apply this scenario instead of simply validating test.xsl as a standalone stylesheet.


Regards,
Sorin

Post Reply