[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: differences between x != 0 and not(x = 0)

Subject: Re: differences between x != 0 and not(x = 0)
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 08 Jun 2005 10:41:06 -0400
if x 0
At 2005-06-08 10:03 -0400, Jaime Stuardo wrote:
If I want to test that all nodes has value different from 0, I have to
use x!=0 or not(x=0) ?

Use not(x=0) to return true if all of the values are not equal to 0. The processor will walk through each node in set "x" and continue checking as long as the answer is false. "x=0" is false if x is non-zero, so it keeps checking the nodes in x. As soon as any is true, the comparison stops and true is returned, and the not() changes the true to false. If all of the tests are false, then false is returned and not() changes the false to true, implying that all of the nodes are not equal to zero because none of the nodes are equal to zero.


But be aware of what you want for the empty set "x", though. Do you want true or false? The comparison is initialized to false so if there are no nodes in "x" the comparison returns false and the not() returns true and you will get "all nodes different from 0" when you have no nodes ... you may not want that.

I hope this helps.

. . . . . . Ken


-- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.