What is XQuery?

XML Query (XQuery) is the World Wide Web Consortium (W3C) language for querying XML. XQuery is a language developed by the W3C XML Query working group.

Example

The XQuery grammar allows you to define expressions like those shown in the following sample query, R-Q2.xquery:

<result>
               
	{
               
		for $i in document("items.xml")/items/item_tuple
               
		let $b := document("bids.xml")//bid_tuple[itemno = $i/itemno]
               
		where contains($i/description,"Bicycle")
               
		order by $i/itemno
               
		return
               
		<item_tuple>
               
			{$i/itemno}
               
			{$i/description}
               
			<high_bid>
               
				{ max ( for $c in $b/bid return xs:decimal($c) ) }
               
			</high_bid>
               
		</item_tuple>
               
	}
               
</result>
               

            

This and other XQuery examples are provided in the Stylus Studio examples\XQuery directory.

Sources for Additional XQuery Information

For more information about XQuery, visit http://www.w3.org/XML/Query (the W3C page for XML Query).

 
Free Stylus Studio XML Training: