RE: [xsl] Ordering Mathmatical functions in XSLT

Subject: RE: [xsl] Ordering Mathmatical functions in XSLT
From: cknell@xxxxxxxxxx
Date: Fri, 30 Jul 2004 13:16:54 -0400
I'm not clear on what you want to test.

"So how can I make XSLT do the determine if the first qualifiers for $var1 are true ..."

If you make this test and the result is "false", then the result of the whole test will be "false". 

So when you ask, "... and then see if the or qualifier for $var2 is correct in the same test?", the expression will only be evaluated if the first part evaluates to "true".

If $var1 is greater than or equal to six and less than eight, that part of the test evaluates to "true". Then the second part of the test will be evaluated. If $var2 is greater than or equal to nine or less than or equal to five, then the second part of the expression will evaluate to "true" and the whole test, therefore, will evaluate to true. If either evaluates to "false", then the whole expression will evaluate to "false".

A test like this will do that:
test="($var1 >=6 and $var1 <8) and ($var2 >=9 or $var2 <=5)"

This shows that parentheses group expressions in XSLT functions.

What I can't see is how you envision one of your expressions to be "inside" the other. They appear to be "sequential siblings" and not a "sequential containment". I'm sorry for the quoted phrases, but I couldn't think of another way to express the ideas.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Rob and Holly Monson <robnholly@xxxxxxxxxxxxx>
Sent:     Fri, 30 Jul 2004 10:50:25 -0600
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  [xsl] Ordering Mathmatical functions in XSLT

I'm trying to combine two sets of tests in one test line.

Basically, I'm trying to test the following:

If test="number($var1) >= 6 and number($var1) < 8
And if number($var2) >= 9 or number($var2) <= 5"

So how can I make XSLT do the determine if the first qualifiers for $var1 are true and then see if the or qualifier for $var2 is correct in the same test?  In mathmatical function I could put () around them to make sure what was inside was processed first.  Any thoughts on this?

Also Is there a between function?
Example: If test="number($var1) between 5 and 9

Thank you inadvance for you replies

Current Thread