|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Extracting hypertext attribut value of an xsl docu
1°)There's a link on my XSL document and 2°)there's the variable "my_var"
witch is defined *out* from the <a> element (this time).
<a href="javascript:void(0)" Name="linkName">link</a>
<xsl:variable name="my_var"><xsl:value-of select=...?></xsl:variable>
My question is : how can I affect the variable "my_var" using the link Name
attribute (Name="linkName") instead of using it value ("linkName") ?
I can directly affect "my_var" with the "linkName" string as follows...
<xsl:variable name="my_var">linkName</xsl:variable>
... but I prefer to affect it using the Name link attribute.
If your aim is to avoid specifying LinkName twice, then you just need to
specify the variable first:
<xsl:variable name="my_var">LinkName</xsl:variable>
<a href="javascript:void(0)" Name="{$my_var}">link</a>
If you really want to have it on the order you said, you need to read
the stylesheet as an input document to itself, like so
<a href="javascript:void(0)" Name="linkName">link</a>
<xsl:variable name="my_var" select="document('')//a/@Name"/>
if there's more than one <a> in your stylesheet that has a Name
attribute then you'd have to give a more specific xpath to it.
David
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








