MXQuery supports two Java APIs

  • the MXQuery-specific (native) API (Javadoc)
  • XQJ, the standard XQuery API for Java (Tutorial)

The following examples outline particular aspects of these APIs. All examples are also included in the download.

  • XQJExample:  XQJ API (JSR 225) – getting started, describes compiling a query, setting values and getting output
  • SimpleExample: MXQuery Java API – getting started, describes compiling a query, setting values and getting output
  • ContextExample: More details on working with Static and Dynamic Context in MXQuery API
  • InputOutputExample: More details on providing input different inputs for queries: atomic values, xml from string/files, StAX, DOM, SAX, serialization
  • StoreExample: Details on the store API, different types + access
  • StreamExample: Creating Stream stores with different modes, running continuous queries on stream stores
  • ExternalFunctionExample: How to create and add external functions to the context