[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: String concatenation inside open tag

Subject: Re: String concatenation inside open tag
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 27 Feb 2007 15:38:00 +0100
Re:  String concatenation inside open tag
Jason Solan wrote:

How my initial thought to handle it is:
If there is a javascript function for this column I would output:
<a href="javascript:void(0)"

I would then add the onclick event for the function name:
onclick="javascript:myFunction(

I think I can handle that part.

The problem comes in because I don't know how to parse the parameters.
I'm in an open "<a" tag so I can't do (unless I'm mistaken) an
xsl:for-each (which is how I would normally handle this situation).

Your stylesheet is a well-formed XML document so you can't never have something like an incomplete tag e.g.
<a href="javascript:void(0)"
in there, instead you would have e.g.
<a href="javascript:void(0)">
and then inside of that you could create further attributes with xsl:attribute e.g.
<xsl:attribute name="onclick">
<xsl:text>myFunction(</xsl:text>
<xsl:for-each select="parameters/param">
<xsl:text>'</xsl:text>
<xsl:value-of select="."/>
<xsl:text>'</xsl:text>
<xsl:if test="position() != last()">
<xsl:text>,</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>); return false;</xsl:text>
</xs:attribute>
Then here you could create further attributes if needed and finally include the contents of the a element
<xsl:text>Bar</xsl:text>
</a>


--

	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.