Using the &lt< and &gt> XQuery Operators

Using the &lt< and &gt> XQuery Operators

When you want to determine the order of articles into an sequence returned by an XQuery query, you can use the > operators:

    - X > Y: is true if Y is before X;

For example, suppose you have the following sequence of strings:

Shark, Daisy, Hunter, Lego, Helly

Use this query:

let $xml:=doc(?file:///C://Data_Local//xml//AirWings.xml?)for $a in $xml/company/aircrafts  for $b in  $xml/company/aircrafts   return(if($a/type<

The query returns:

Shark[--Shark, Shark--]Daisy, Shark--]Hunter, Shark--]Lego,Shark--]Helly, Daisy[--Shark, Daisy[--Daisy, Daisy--]Hunter,Daisy--]Lego, Daisy--]Helly, Hunter[--Shark, Hunter[--Daisy,Hunter[--Hunter, Hunter--]Lego, Hunter--]Helly, Lego[--Shark,Lego[--Daisy, Lego[--Hunter, Lego[--Lego, Lego--]Helly ,Helly[--Shark, Helly[--Daisy, Helly[--Hunter, Helly[--Lego,Helly[--Helly


Share the Post: