TonyMarston
Programmer
I have created the following template:
I am calling it with the following:
Note that $script, $orderby and $order have been declared previously using <xslaram>
I cannot get this to show the value 'ID' for $string, as 'ID' is not a node, just a literal string. Is there a way I can pass a string that will be treated as a string and not a node?
Code:
<xsl:template name="column_hdg">
<xsl:param name="item"/>
<xsl:param name="string"/>
<!-- create hyperlink to sort on this field -->
<a><xsl:attribute name="href"><xsl:value-of select="$script"/>?orderby=<xsl:value-of select="name($item)"/>/xsl:attribute>
<!-- this is supposed to show the value of $string -->
<xsl:value-of select="$string"/>
</a>
<!-- if sorted by this field insert ascending or descending image -->
<xsl:if test="$orderby=name($item)">
<img>
<xsl:attribute name="src">order_<xsl:value-of select="$order"/>.gif</xsl:attribute>
<xsl:attribute name="alt">order_<xsl:value-of select="$order"/>.gif</xsl:attribute>
</img>
</xsl:if>
</xsl:template>
I am calling it with the following:
Code:
<xsl:call-template name="column_hdg">
<xsl:with-param name="item" select="pers_type_id"/>
<xsl:with-param name="string" select="ID"/>
</xsl:call-template>
Note that $script, $orderby and $order have been declared previously using <xslaram>
I cannot get this to show the value 'ID' for $string, as 'ID' is not a node, just a literal string. Is there a way I can pass a string that will be treated as a string and not a node?