[thelist] XSLT Attributes and Variable name

Howard Cheng howcheng at ix.netcom.com
Wed Jan 15 11:26:04 CST 2003


I'm so not understanding this. Perhaps you can post more complete XML and
an example of the result you want to achieve?

At 05:10 PM 1/15/2003 +0000, seb potter wrote:
>Hi all
>
>I have the following snippet of XML:
>
><reference name="site">some text</reference>
>... stuff ...
><target id="site" refuri="http://www.blah.com" />
>
>What I want to be able to do is use the following transform:
>
><xsl:template match="//target">
><xsl:variable name="@id"><xsl:value-of select="@refuri"
>/></xsl:variable>
></xsl:template>
>
>in the top-level of the stylesheet, and at a lower level:
>
><xsl:template match="reference">
><a href="{@refname}"><xsl:apply-templates/></a>
></xsl:template>
>
>Where @refname in the <a> tag will evaluate to the top-level variable
>created earlier, such that the refname attribute of the <reference> tag
>is replaced by the value of the variable with the corresponding name
>attribute.
>
>Anybody got any ideas?
>
>- seb
>
>--
>seb potter <seb at getfrank.com>
>Getfrank Ltd
>--
>seb potter - seb at poked.org
>http://poked.org - It's what you value.

::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315




More information about the thelist mailing list