Feb 18, 2008

xslt comparison

Below is an example of comparision.
            
            
            He is male
            
            
            She is a female
            
            
            
If the xpath expression return more than one value, that is a sequence. For example Program/@flag = 'favorite' , Program/@flag has more than one value, XSLT processor goes through each of the flag attributes in turn, if it finds any flag attribute that has the value 'favorite', then the comparison returns true. This expression means if the sequence has any value equals to 'favorite'. If you mean, none of sequence has value of 'favorite', you can not use Program/@flag != 'favorite', (which means any of sequence is not equal to 'favorite'), you should use not(Program/@flag = 'favorite')