XSL with-param

admin

Administrator
Staff member
Hi all,

Is it possible to use the param and with-param elements to pass a value to a template that will be used as an attribute value for an xsl element? An example:
<xsl:call-template select="something">
<xsl:with-param name="order" select="'descending'"/>
</xsl:call-template>

<xsl:template match="something">
<xsl:param name="order" select="'ascending'"/>
<xsl:for-each select="children">
<xsl:sort select="children/@attribute" order="$order"/>
<xsl:apply-templates/>
</xsl:for-each>
</xsl:template>
The above doesn't work, obviously, but is the general idea possible, or do xsl element attributes have to be hard-coded?

Cheers,
D.
 
Back
Top