Subject: Re: Performance versus legibility
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 24 Nov 2000 14:45:00 GMT
|
> not(string(.)) string-length(.)=0
> not(x) count(x)=0
> not(x=y) x!=y
>
>
> I always use the expressions in the second column for maintainability,
I usually find the first forms are clearer not(@id) seems to say "no id
attribute" clearer than count(@id)=0. But beware while the first two
pairs are equivalent, not(x=y) is not the same thing as x!=y and I find
it's really dangerous to use != as usually I want not ( = ).
If either x or y is a node set containing nodes with different values
then x!=y is always true.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|