This page is not meant to replace an XQuery tutorial or book – it shows some examples of the individual XQuery standards and extensions that are supported by MXQuery. Please also check the the links to relevant standard documents on the left side bar.

XQuery 1.0

Run as: java -jar ../dist/mxquery.jar -f <query.xq>

Run as: java -jar ../dist/mxquery.jar -sa -f schema.xq

  • external.xq: using command line settings for serializer, external variable and static context

Run as java -jar ../dist/mxquery.jar -e ext=books.xml -e.:=”<context123/>” -s omit-xml-declaration=true -c boundary-space=preserve -f external.xq

XQuery 1.1

Run as: java -jar ../dist/mxquery.jar -11m -f <query.xq>

XQuery Update Facility 1.0

  • update.xq: transform/copy statement with update+output
  • inserttest.xq: Insert element into document, update file (no output, just modified file)

Run as: java -jar ../dist/mxquery.jar -um -x -f <query.xq>

XPath/XQuery Fulltext 1.0

Run as java -jar ../dist/mxquery.jar -fm -f fulltext.xq

XQuery Scripting 1.0

Run as java -jar ../dist/mxquery.jar -sm -x -f <query.xq>

Web Service Support

(Check the provided tutorial for detailed information)

  • REST_GET.xq: RESTful web service, example for the ‘GET’ verb in HTTP
  • REST_POST.xq: RESTful web service, example for the ‘POST’ verb HTTP

Run as: java -jar ../dist/mxquery.jar -f <query.xq>

  • MashupExpose.xq: exposes a web service mashup (from the example in A_Web Service_Mashup.xq) as a web service on its own (bundled in MXQuery.war)
  • mod.xquery: Module to export as SOAP (bundled in MXQuery.war)