mahati schrieb:
i could see that only + gets printed but not href tag around it.
Typically, that means you're using <xsl:value-of> instead of
<xsl:copy-of>. In your case, the reason seems to be different.
<xsl:call-template name=columnHeader">
<xsl:with-param name="value">
<xsl:attribute name="id">frameloader</xsl:attribute>
<xsl:attribute name="href">javascript:void(0);</xsl:attribute>
<xsl:attribute name="onclick">javascript:<xsl:value-of
select="$gridName"/>.expandAllTreeRows(this);</xsl:attribute>
+
</xsl:with-param>
</xsl:template>
This differs from your original example. You're missing the <a> element.
(Maybe it got eaten in the mail processing chain.) Xalan-J 2.7.1 and
LibXSLT 1.1.24 both ignore this attribute. Saxon 6.5 issues a warning:
Cannot write an attribute node when no element start tag is open
I suggest you adjust your code.
By the way, if you pass the parameter as you intend it to appear in the
output, spare yourself the hassle of exsl:node-set() plus identity
transform and use <xsl:copy-of> as in the following example.
In addition, use literal XML for the parameter instead of constructing
it using <xsl:attribute>. That's much more readable. Use the latter
method only if dynamic computation of the attribute name is required.
Michael Ludwig
<xsl:stylesheet version="1.0"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<xsl:call-template name="x">
<xsl:with-param name="y">
<eins><zwei/><drei>vier</drei></eins>
<!-- The following does not work: -->
<!-- <xsl:attribute name="z">moin</xsl:attribute> --><!-- Saxon 6.5:
Cannot write an attribute node when no element start tag is open -->
</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template name="x">
<xsl:param name="y"/>
<Urmel>
<good><xsl:copy-of select="$y"/></good><!-- good and simple -->
<hassle><!-- unnecessary hassle -->
<xsl:apply-templates select="exsl:node-set($y)/*"/>
</hassle>
<attr><xsl:apply-templates select="exsl:node-set($y)//@*"/></attr>
</Urmel>
</xsl:template>
<xsl:template match="@*|node()"><!-- identity template -->
<xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>
</xsl:stylesheet>