<xsl:param name="sort"/>
I then try to sort using this parameter, but it never recognizes the
parameters value:
<table width="1200" class="details" border="0">
<xsl:call-template name="columnHeaders"/>
<xsl:for-each select="$features">
<xsl:sort select="$sort"/> <!-- tried lots of variations here - doesn't
like {$sort}
<tr >
<xsl:call-template name="processFeatureAttr">
<xsl:with-param name="field" select="."/>
</xsl:call-template>
</tr>
</xsl:for-each>
</table>
but if I hard code the sort select value, like select ="owner", all works
well.
If it try something more brute force where I explicitly compare the value of
the parameter,
<xsl:choose>
<xsl:when test="$sort==owner"> \
<xsl:text>tested sort for owner </xsl:text><xsl:value-of select="$sort"/>
</xsl:when>
</xsl:choose>
it never works - gets assertion failure in the parser
any ideas on how best to parameterize the sort/select value?
how does one compare a parameter for an explicit value?
--
Cheers,
Paul Harding
Algorithmics Inc.
phar...@algorithmics.com 189 Spadina Ave.
(voice) 416-217-4431 Toronto, Ont. M5T 2C6
(fax) 416-971-6100
--
Cheers,
Paul Harding
Principal Software Engineer Algorithmics Inc.
phar...@algorithmics.com 189 Spadina Ave.
(voice) 416-217-4431 Toronto, Ont. M5T 2C6
(fax) 416-971-6100
There is no direct way. But if the sort key is a child element of the
elements you want to sort, as in your case, you could say:
<xsl:sort select="*[local-name()=$sort]"/>
> how does one compare a parameter for an explicit value?
<xsl:when test="$sort = 'owner'">
...
</xsl:when>
This assumes that the value of your parameter really is a string.
Hope this helps,
Tuija
--
Tuija Sonkkila
HUT CC
works like a charm
many thanx
pharding