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

Re: If/then/else confusion

Subject: Re: If/then/else confusion
From: Liam R E Quin <liam@xxxxxx>
Date: Tue, 25 Dec 2012 15:43:45 -0500
Re:  If/then/else confusion
On Tue, 2012-12-25 at 13:14 -0700, Mark Wilson wrote:
> Thanks for the info Syd.
> 
> I am using XSLT2, which I should have said in the original posting.
Mark, the difference between
  if (Prefix != 'A') then 1 else 2
and
  if (Prefix = 'A') then 2 else 1
is the case where there's no prefix element, as in the last case in your
set of examples.

$A != $B, for two nodelists, means,
  there's some pair of elements a and b for which the value
  of a is not equal to the value of b
  So if $A is empty, there is no such value, and it's false.

$A = $B means there's some pair of values a and b whose values are equal
one with another. So if $A is empty, $A = $B is false.

not($A != $B) is true when $A is the empty sequence.
$A = $B is false when $A is the empty sequence.

Decide which you want and code accordingly :-)

Liam



-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml

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.