Re: [xsl] String concatenation inside open tag

Subject: Re: [xsl] String concatenation inside open tag
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Tue, 27 Feb 2007 15:38:00 +0100
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:

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:for-each select="parameters/param">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>); return false;</xsl:text>
Then here you could create further attributes if needed and finally include the contents of the a element


	Martin Honnen

Current Thread