|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: creating links to resource files listed in XML fil
Hi,
> I want to create some links to resource files which
> are referenced in my .xml file. In my .xsl file I have
> added the following code:
>
> <xsl:template match="/">
> <xsl:for-each select="//file/@href">
> <xsl:variable name="myVar">
> <xsl:value-of select="."/>
> </xsl:variable>
> <a href='<xsl:value-of select="$myVar"/>'>
> <xsl:value-of select="$myVar"/> </a>
> </xsl:for-each>
>
> The link creates fine with the proper file name etc.
> However, the path to the actual file is not correct.
> It comes out as <xsl:value-of select="$myVar"/>.
> Is there a way to embed this in the <a href... tag so
> that I can link to the file properly.
You haven't read the XSLT specification, have you? Anyhow, you want
<a href="{$myVar}"><xsl:value-of select="$myVar"/></a>
I.e. Attribute Value Templates [1]
Cheers,
Santtu
[1] http://www.w3.org/TR/xslt#attribute-value-templates
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








