RE: [xsl] xsl filter problem

Subject: RE: [xsl] xsl filter problem
From: "Yuval" <yuvalkro@xxxxxxxxxxxx>
Date: Thu, 26 Dec 2002 12:10:01 +0200
Hi again,
My xml looks like this :

<customers>
	<customer>
		<city>a</city>
		<name>Jhon<name>
	</customer>
	<customer>
		<city>b</city>
		<name>Don<name>
	</customer>
	<customer>
		<city>c</city>
		<name>Ron<name>
	</customer>
</customers>

The data is to presented in a table and I want to filter it according to
the "city" - meaning I have 4 options :
1.a
2.b
3.c
4.all the cities = no filter

Im using a html select box to let the user choose which city to filter
and the first option is "all cities".for this parameter I give the value
*.

The xsl looks like this :

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
	<xsl:output method="xml" encoding="windows-1255" />
	
	<xsl:param name="city"  />
		
	<xsl:template match="/">
		<customers>		
			<xsl:for-each
select="customers/customer[city=$city]">
				<customer>
					<xsl:for-each select="*">
						<xsl:element
name='{name()}'>
							<xsl:value-of
select="." />
						</xsl:element>
					</xsl:for-each>
				</customer>
			</xsl:for-each>
		
		</customers>
	</xsl:template>
</xsl:stylesheet>

When choosing "all cities" - the result is an empty table instead of the
list of all cities with the customers names.
I tried to giva the param "city" a diect value of "*" or " '*' " and it
still didn't work.
How can I pass a value to this param which will act like : <xsl:for-each
select="customers/customer[city=*]"> ??

Thanks in advance


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread