Re: [xsl] Understanding Identity Transformations

Subject: Re: [xsl] Understanding Identity Transformations
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Sat, 12 Feb 2005 22:21:18 +0100
Tempore 21:55:30, die 02/12/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Karl Stubsjoen <kstubs@xxxxxxxxx>:

Wow.. that is easy except that I do not understand your notice
explanation... the difference between your not( ... ) and your !=.

"@cat != 'BLUE'": will be true if the context node has a 'cat' attribute *and* if it has a 'cat' attribute not equal to 'BLUE'. So it's the same as "boolean(@cat) and not(@cat='BLUE')"


"not(@cat='BLUE')": will be true if the context node has no 'cat' attribute *or* if it has a 'cat' attribute not equal to 'BLUE'. So it's equal to "not(@cat) or not(@cat='BLUE')"

Wow... so much boolean logic that it doesn't seem logical anymore...

So what is the difference then? I don't get it.

The difference is that '!=' will work and 'not(...=...)' will not.
Now don't ask me why:)
The reason can probably found at http://www.w3.org/TR/xpath.html#booleans , but I know it rather from experience than from any documentation.




regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
Gaudiam omnibus traderat W3C, nec vana fides

Current Thread