[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Defining a variable for configuration file


Subject: Re: [xsl] Defining a variable for configuration file
From: Jon Gorman <jonathan.gorman@xxxxxxxxx>
Date: Thu, 13 Oct 2005 14:37:54 -0500

> Looks like a scoping issue to me.

Hmmm, maybe you'll like some more clarification.


> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >
> >         <xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"
> > doctype-system="urn:/ShipmentOrderCreate.dtd"/>
> >
> >
> >           <xsl:template match="/">
> >
> >
> >                 <xsl:if test="//storerkey = '1011'">
> >
> >                         <xsl:variable name="Config" select=
> > "document('1011CustomerConfig.xml')"/>

so you've set up variable for every descendant of that if

> >                 </xsl:if>

you've closed out that branch along with every variable associated
with it ($Config goes bye-bye)

> >                         <xsl:element name="ShipmentOrderCreate">
> >
> >                                 <xsl:element
> > name="CustomerCode"><xsl:value-of
> > select="$Config/ConfigurationFile/CustomerCode">
> > </xsl:value-of> </xsl:element>

$Config isn't defined, throw up error saying $Config isn't defined.

> >
> >                         </xsl:element>


FAQ,
for more on variable info see
http://www.dpawson.co.uk/xsl/sect2/N8090.html

Jon Gorman


Current Thread