This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl:include href attribute
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 16 Jul 2002 18:29:03 +0100
- Subject: RE: [xsl] xsl:include href attribute
- Reply-to: xsl-list at lists dot mulberrytech dot com
> Can someone help me out as to where I am going wrong
> here? I am trying to use a var as the value of the
> href attribute of xsl:include.
You have said where you are going wrong: you are trying to do something
the language does not allow. <xsl:include> is expanded at compile time,
long before the values of variables are known.
Now tell us what problem you were trying to solve.
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
>
> ----------------------------------------------------------
> <!-- change to real URL when moving to production -->
> <xsl:variable name="includePath"
> select="'http://xxx.xxx.xxx.xxx/dir/'" /> <xsl:variable
> name="getFileInfoPath"
> select="concat($includePath,'common/getFileInfo.xsl')"
> />
>
> <!-- get the xml file's name and parent directory:
> $FileName, $FileDir -->
> <xsl:include href="{$getFileInfoPath}" />
>
> However, when I try to parse an xml doc, for some
> reason, Saxon is trying to use the base url and tack
> on the var, so it ends up trying to find the included
> xslt at e:\wwwroot\dir\{$getFileInfoPath} instead of
> expanding the var and going to
> 'http://xxx.xxx.xxx.xxx/dir/common/getFileInfo> .xsl'
>
> If I
> hard-code the URI in there as
> 'http://xxx.xxx.xxx.xxx/dir/common/getFileInfo.xsl,'
> it finds it perfectly fine.
>
> What am I missing?
>
> [I am a digester, so a cc is appreciated.]
>
> --n
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list