[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: String concatenation inside open tag
Jason Solan wrote:
I'm new to XSL. No problem, we all started at the basics. Your best bet is some tutorial that guides you through the processing model of XSLT, and explains you what nodes are, what attribute nodes are and how XSLT creates them. You don't need to do something inside "an open tag", because tags do not exist as far as XSLT is concerned. A solution: <a href="something" onclick="someFunc('{@column}');" /> where @column refers to the attribute with the name 'column' in the current processing context. Another solution: <a href="something"> <xsl:attribute name="onclick"> <xsl:text>someFunc('</xsl:text> <xsl:value-of select="@column" /> <xsl:text>');</xsl:text> </xsl:attribute> </a> In the place of "xsl:value-of" you can also do an apply-templates, if you need to parse all kinds of "column" nodes or attributes that need to be placed as parts of your function's parameters. There are many more ways to do this. The first approach above is, however, by far the simplest and between the {} brackets you can reference any element or attribute using any valid XPath. The {} part is called an "attribute value template" (google for some more pointers on it). Cheers, -- Abel Braaksma http://www.nuntia.nl
|
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
|