cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Schwarz" <J.Schw...@wika.de>
Subject Antw: XSL parameter question
Date Thu, 14 Feb 2002 12:33:17 GMT
Hi Gustav!

Try  it with    "normalize-space()"  Function, maybe there are
white-spaces in your request parameter

<xsl:sort select ="normalize-space($sortby)"></xsl:sort>


Johannes






>>> gustav.liden@ctakt.com 14.02.2002  12.38 Uhr >>>
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message