Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT multi conditions testing

Status
Not open for further replies.

lhugh

MIS
May 21, 2000
115
CA
my XML has


Year:
Weight:
Price:

I would like to diplay all records with Year > 1980, Weight < 50 lbs and price < 5.00

How do I express this in XSL

Thanks
 
Your description is not too descriptive, so in general:
inXPath expressions you can use multiple conditions:
node[subnode1=$variable and number(@attribute2) &lt; 2 and not(position() = 77)]
 
thanks

I would like to do it using XSLT

i am trying to do

< xsl:choose >
<xsl:when test="year &gt; 1980" and test="weight &lt; 50" test="price &lt; 5.00">
</xsl:when>
</xsl:choose >

but the syntax above didn't work

Thank you all for your suggestions/help
 
OK, if you want to use <xsl:when> syntax should be (something like):
<xsl:when test="subnode1=$variable and number(@attribute2) &lt; 2 and not(position() = 77)">
There is only 1 'test'-attribute to the node 'when'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top