Configuration using XQJ

The root object in the XQJ (XQuery for Java) API is javax.xml.query.XQDataSource, and the Saxon implementation class is com.saxonica.xqj.SaxonXQDataSource. The XQDataSource provides methods getProperty(name) and setProperty(name, value). In these calls, the name is the URI-valued string associated with one of the net.sf.saxon.lib.Feature constants.

There is a glitch however. The XQJ specifications mandate that the properties available through this interface should also have explicit getters and setters: for example if a property named "lineNumbering" is available, then there should be a pair of methods setLineNumbering() and getLineNumbering(). This does not square well with the use of URIs for property names. Secondly, XQJ requires that the property values should be strings. Saxon therefore:

  1. exposes a subset of commonly-used configuration properties using shortened names such as dtdValidation and retainLineNumbers

  2. provides getters and setters for these properties, as required by the XQJ specification

  3. lists the names of the above properties (only) in the result of the method getSupportedPropertyNames()

  4. makes all other configuration properties available using URIs as the name, without providing getters and setters, and without listing the names in the result of getSupportedPropertyNames(), provided that the value can be represented as a string. Boolean values can be represented using any of the strings ("yes", "on", "true", or "1"), or ("no", "off", "false", or "0").