Supported add-ins and features

Parser add-in
com.xmlprobe.QAHandler
com.xmlprobe.MultiRootQAHandler

XMLProbe comes with a number of standard add-ins used in handling XML content. An add-in is selected for loading at runtime in the configuration file by an addIn element in the XMLProbe namespace (whose URI is http://xmlprobe.com/200312).

Aspects of the parse - validation and namespace strategies, logging and reporting behaviour - are controlled by configuring the parser class. Any class implementing the org.sax.xml.XMLReader interface may be used, although not all parsers support all available features: see table below for details. If no parser class is specified in the configuration file, a default validating parser (org.apache.xerces.parsers.SAXParser) is used. A summary of parser features available is shown in the table.

Parser add-in

Table 2.1. Parser add-in features

Feature nameAllowed value(s)Default valueDescription
* only supported by Apache Xerces parsers
http://xml.org/sax/features/validationtrue/falsefalsespecifies whether the parser should validate (against a DTD)
http://xml.org/sax/features/namespacestrue/falsefalsewhether to recognise namespaces; should be set to true in most cases
http://xml.org/sax/features/namespace-prefixestrue/falsefalsewhether to recognise namespace prefixes; should be set to true in most cases
http://xmlprobe.com/features/issue-warningstrue/falsefalsewhether warnings (as defined in the XML 1.0 Recommendation) issued by the parser will be reported
http://xmlprobe.com/features/show-activity-logtrue/falsefalsewhether XMLProbe should emit logging messages as part of its validation report; useful for debugging purposes
http://xmlprobe.com/features/error-format"text"|"TEXT"|"xml"|"XML"|"html"|"HTML"textspecifies the report format; the default is text, if none is given, recognised or if the application exits before this information has been retrieved from the configuration
http://xmlprobe.com/features/encoding"UTF-8"|"UTF-16"|"US-ASCII"UTF-8specifies the encoding for the report
http://apache.org/xml/features/validation/schematrue/falsefalsewhether to validate against a W3C XML Schema*
http://apache.org/xml/features/continue-after-fatal-errortrue/falsefalsewhether to continue parsing after a fatal error; should be set to false normally*
http://xmlprobe.com/features/relaxng-schema-location-xml-syntaxsystem identifier of RELAX NG schema (XML syntax)[none]validate against the schema at the specified location; new in XMLProbe 1.5
http://xmlprobe.com/features/relaxng-schema-location-compact-syntaxsystem identifier of RELAX NG schema (compact syntax)[none]validate against the schema at the specified location; new in XMLProbe 1.5
http://xmlprobe.com/features/emit-normalized-rulesettrue/falsefalsewhether to emit the configuration file passed in (by default to standard output) in normalized form and exit; note that this feature will itself appear in the normalized ruleset with the value as passed in (i.e. true)

com.xmlprobe.QAHandler

The QA process may be configured using the following features, available to com.xmlprobe.QAHandler.

Table 2.2. QA handler add-in features

Feature nameAllowed value(s)Default valueDescription
http://xmlprobe.com/features/xpath-extension-function
  1. value - specifies the Java class name of the extension function to be loaded dynamically. The classpath for the purposes class loading is taken to be the directory in which the XMLProbe JAR file resides. XMLProbe will also attempt to find a requested class in any other JAR files in that location.

  2. alias (optional) - specifies the name by which the loaded extension function may be addressed. Any whitespace characters present are removed. If omitted, or equal to the empty string after removal of whitespace, the fully-qualified class name must be used to address the function instead.

[none]loads an XPath extension function dynamically at runtime
http://xmlprobe.com/features/time-xpath-evaluationtrue/falsefalsewhether to report timings for each XPath rule evaluation; useful in identifying evaluation hotspots
http://xmlprobe.com/features/use-xpath-locatorstrue/falsefalsewhether to include discrete XPath paths (e.g. /foo/bar[3]) for nodes reported by the handler
http://xmlprobe.com/features/include-physical-locatorstrue/falsetruewhether to include line and column numbers for nodes reported by the handler; if false, locators for nodes located by the QA process are reported as 0
http://xmlprobe.com/features/remap-entity
  1. from - specifies the entity to be remapped; if relative, the URI is resolved against the instance passed in

  2. to - specifies the entity to substitute for from; if relative, the URI is resolved against the instance passed in by default; alternatively, the resolution base may be set by the inclusion of an xml:base attribute for this element

[none]specifies entity remappings to be performed by the parser; useful e.g. when overriding DOCTYPE declarations, entities called in by the DTD, etc.

com.xmlprobe.MultiRootQAHandler

For very large documents (see the section called “Processing large XML documents with MultiRootQAHandler”) the QA process may in addition to the features available to com.xmlprobe.QAHandler, be configured using the following features, which are available to com.xmlprobe.MultiRootQAHandler.

Table 2.3. Multiple-root QA handler add-in features

Feature nameAllowed value(s)Default valueDescription
http://xmlprobe.com/features/pseudo-root-element
  1. value - specifies the local name of the element which will be treated as cueing a new document.

  2. namespaceURI (optional) - specifies the namespace URI in which the pseudo-root element resides.

[none]selects the pseudo-root element for efficient large document evaluation