Re: Converting a string to node test
Hi Xavier, > <!-- This line works --> > <xsl:copy-of select="$x[@my-attrib-name=$z]/node()"/> > <!-- This line doesn't, nor any line of that kind I've tried... --> > <xsl:copy-of select="$x[@$y=$z]/node()"/> Here, you're trying to evaluate a string (held in the $y variable) as (part of) an XPath. You can't do that without an extension function like saxon:evaluate() to do the evaluation. However, you can compare the name of an attribute to the string. So you can use the following to find the attribute with the name given by the $y variable: @*[local-name() = $y] And therefore use: <xsl:copy-of select="$x[@*[local-name() = $y] = $z]/node()" /> I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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