xsl-list
[Top] [All Lists]

Re: Defining a variable for configuration file

2005-10-13 12:32:44
On 10/13/05, Challa, Harsha <hchalla(_at_)newbreed(_dot_)com> wrote:
Hi

Could someone help me with this. I am defining the variable in a template
but looks like the $Config is not being recognized.
I am getting error  'XSL transformation failed due to following error:
Invalid variable referenceErrror in XPath expression, invalid variable
reference"

thanks
Harsha

Looks like a scoping issue to me.

<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')"/>



                </xsl:if>


                        <xsl:element name="ShipmentOrderCreate">

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

                        </xsl:element>

        </xsl:template>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>