SimpleExpressions.jws Sample

A web service illustrating XQuery by showing a few simple expressions in use. XQuery offers a variety of ways to operate on XML. It supports simple path expressions that are similar to XPath, as well as more complex expressions for looping through XML.

All of the XQuery expressions in the source code use the special word "$this". This is not an XQuery word, but for XQuery expressions in WebLogic Workshop it signifies "the current context in the XML instance document". Contrast this with XQuery maps, which use $input to indicate "the start of the XML instance document".

Also, notice that these expression are executed with an XmlCursor instance. Contrast this with using an instance of XmlObject (or a type that inherits from it), as described in Selecting XML with XQuery and XPath.

For more information about XQuery, see http://www.w3.org/TR/xquery/.

Concepts Demonstrated by this Sample

Location of Sample Files

This sample is located in the xmlBeans/xquery folder of the SamplesApp WebLogic Workshop project. In the file system the location is:

BEA_HOME\weblogic81\samples\workshop\SamplesApp\WebServices\xmlBeans\xquery\SimpleExpressions.jws

To Run the Sample

Related Topics

Getting Started with XMLBeans

Selecting XML with XQuery and XPath