Subject: Re: [xsl] Shorthand. From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 25 Jul 2007 18:55:56 +0200 |
Hey there, I have a template for creating ajax links:It depends. You may not need a named template at all. Or you can use the context node if you like, or you pass the context node, on in one of the parameters, which may make things shorter. In XSLT 2.0 things get even easier, where you can define functions.
<xsl:template name="a"> <xsl:with-param name="href" /> <xsl:with-param name="text" /> <a href="{$href}" onClick="showData('{$href}');return false;"><xsl:value-of select="$text" /></a> </xsl:template>
is there some shorter way to use this (XSL 1.0) template than...
<xsl:call-template name="a">
<xs:param name="href" select="'x'"/>
<xs:param name="text" select="'y'"/>
</xsl:call-template>
<xsl:template match="*[x|y]"> a href="{y}" onClick="showData('{y}');return false;"><xsl:value-of select="y" /></a> </xsl;tempalte>
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Shorthand., Steve | Thread | Re: [xsl] Shorthand., Andrew Welch |
RE: [xsl] Efficiency: predicate vs , Michael Kay | Date | RE: [xsl] Shorthand., Angela Williams |
Month |