Subject: RE: [xsl] xsl:include From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Tue, 27 Mar 2001 10:49:55 +0100 |
> One simple thing seems not to work. > I want to include some variables from an > extra stylesheet into another stylesheet. > The one xsl file may look like that: > > 'variable.xsl': > <?xml version="1.0"?> > <xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> > <xsl:variable name="var">Something</xsl:variable> > <xsl:variable name="var1">Something</xsl:variable> > </xsl:stylesheet> > > > <?xml version="1.0"?> > <xsl:stylesheet > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> > <xsl:import href="variable.xsl"/> > > <xsl:value-of select="var1"/> > <xsl:value-of select="var2"/> > > </xsl:stylesheet> > Once you've impored the stylesheet, you don't need to do anything special to import its global variables. The second stylesheet can simply refer to $var and $var1 declared in the first stylesheet. Or, if you want, it can override them with a global variable declaration, e.g. <xsl:variable name="var">Something Else</xsl:variable> In that case a reference to $var (from either stylesheet module) will have the value "Something Else" rather than "Something". Mike Kay Software AG XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xsl:include, David Carlisle | Thread | [xsl] DTD type that allows XHTML?, Ruben Inoto |
RE: [xsl] xsl:output question, Michael Kay | Date | [xsl] Error declaring doctype in ms, Riboni Ugo |
Month |