How to perform comparisons in XQuery ?

 Posted by Bharathi Cherukuri on 5/11/2012 | Category: Web Services, Remoting Interview questions | Views: 1482 | Points: 40

In XQuery we can compare the values with general comparisons and value comparisons.

1. General Comparisons : We perform general comparisons by using these symbols.
Ex. =, !=, <, <=, >, >=

2. Value Comparisons : We use below symbols to perform value comparisons.
Ex. ne, lt, le, eq, ge, gt.

Now, here is the way to use comparisons in XQuery.

$bookstore//book/@q > 100

If any q attributes have values which is greater than 100 expression will return true.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response