This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Performance versus legibility



>   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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]