Examples of Comparisons

The following query finds all authors whose last name is Bob:

author[last-name = "Bob"]
               

            

The next query finds authors whose degrees are not from Harvard:

author/degree[@from != "Harvard"]
               

            

The following query returns prices that are greater than 20 dollars. This assumes that the current context contains one or more price elements.

price [. > 20]
               

            

 
Free Stylus Studio XML Training:
W3C Member