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 XQuery, 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

See An XQuery Primer if you are just getting started with XQuery. For more detailed information, including the formal W3C XQuery specification, visit http://www.w3.org/XML/Query (the W3C page for XML Query).

 
Free Stylus Studio XML Training:
W3C Member