[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Global variable in included stylesheet

Subject: RE: Global variable in included stylesheet
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 21 Feb 2002 09:39:39 -0000
kay anjali
> I have xml file (global.xml) and two xsl files (1.xsl, 2.xsl).
> File global.xml is transformed with the stylesheet 1.xsl.
> File 2.xsl is included in 1.xsl.
> File 1.xsl
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:include href="2.xsl"/>
> <xsl:variable name="DefaultLanguageID"/>
> 	<xsl:template match="global-settings">
> 		<xsl:variable name="DefaultLanguageID"
> select="parameter[@name='DefaultLanguageID']/@value"/>

You have two separate variables here with the same name: a global variable
which is accessible anywhere in the stylesheet (including in other modules),
whose value is the empty string "", and a local variable which is accessible
only within one template rule. There is absolutely no relationship between
these two variables apart from the fact that they share the same name.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.