[xsl] selecting for variable based on attribute

Subject: [xsl] selecting for variable based on attribute
From: "Rick Roen" <Rick@xxxxxxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2006 09:10:05 -0700
XSLT 2.0

I have an xml like this snippet: 		

      <item print="1" hardware="0" packetdescription="FLOWER " sku="">
			<name>ALYSSUM BASKET GOLD</name>
		<item print="1" hardware="0" packetdescription="FLOWER "
			<name>ALYSSUM CARPET OF SNOW</name>

And an xslt snippet like this:

			<xsl:variable name="rack" select="items/item[rack
castable as xs:integer and tray castable as xs:integer and pocket castable
as xs:integer and @hardware ne '0' ]"/>

This returns an empty sequence for $rack.  When I leave out the "@hardware
ne '0'" then it returns what I would expect, i.e. the items/item.

How do I test for the hardware attribute <> 0?


Current Thread