You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Gustav Liden <gu...@ctakt.com> on 2002/02/14 12:38:35 UTC
XSL parameter question
Hi,
As an XSL-beginner, I'm having a problem I don't understand that has to do
with parameter passing through the sitemap to an XSL:
Can anyone see why the sorting (using 'sortby' parameter) of my elements
doesn't work while the parameter is correctly output later. If I hardcode
sorting (see commenting) it works...
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="sortby"/>
<xsl:output method="xml"/>
<xsl:template match="QueryResult">
<QueryResult>
<table spacing="">
<xsl:apply-templates select="Customer">
<xsl:sort select ="$sortby"></xsl:sort>
<!-- <xsl:sort select ="City"></xsl:sort>-->
</xsl:apply-templates>
</table>
</QueryResult>
</xsl:template>
<xsl:template match="Customer">
<row>
<column>
<justtext><xsl:value-of select="$sortby"/><xsl:value-of
select="Name"/></justtext>
</column>
<column>
<justtext><xsl:value-of select="City"/></justtext>
</column>
</row>
</xsl:template>
</xsl:stylesheet>
Anyone sees what's wrong?
Thanks,
Gustav
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>