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.
Table 2.1. Parser add-in features
| Feature name | Allowed value(s) | Default value | Description |
|---|---|---|---|
| * only supported by Apache Xerces parsers | |||
| http://xml.org/sax/features/validation | true/false | false | specifies whether the parser should validate (against a DTD) |
| http://xml.org/sax/features/namespaces | true/false | false | whether to recognise namespaces; should be set to true in most cases |
| http://xml.org/sax/features/namespace-prefixes | true/false | false | whether to recognise namespace prefixes; should be set to true in most cases |
| http://xmlprobe.com/features/issue-warnings | true/false | false | whether warnings (as defined in the XML 1.0 Recommendation) issued by the parser will be reported |
| http://xmlprobe.com/features/show-activity-log | true/false | false | whether 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" | text | specifies 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-8 | specifies the encoding for the report |
| http://apache.org/xml/features/validation/schema | true/false | false | whether to validate against a W3C XML Schema* |
| http://apache.org/xml/features/continue-after-fatal-error | true/false | false | whether to continue parsing after a fatal error; should be set to false normally* |
| http://xmlprobe.com/features/relaxng-schema-location-xml-syntax | system 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-syntax | system 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-ruleset | true/false | false | whether 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) |
The QA process may be configured using the following features, available to com.xmlprobe.QAHandler.
Table 2.2. QA handler add-in features
| Feature name | Allowed value(s) | Default value | Description |
|---|---|---|---|
| http://xmlprobe.com/features/xpath-extension-function |
| [none] | loads an XPath extension function dynamically at runtime |
| http://xmlprobe.com/features/time-xpath-evaluation | true/false | false | whether to report timings for each XPath rule evaluation; useful in identifying evaluation hotspots |
| http://xmlprobe.com/features/use-xpath-locators | true/false | false | whether to include discrete XPath paths (e.g. /foo/bar[3]) for nodes reported by the handler |
| http://xmlprobe.com/features/include-physical-locators | true/false | true | whether 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 |
| [none] | specifies entity remappings to be performed by the parser; useful e.g. when overriding DOCTYPE declarations, entities called in by the DTD, etc. |
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 name | Allowed value(s) | Default value | Description |
|---|---|---|---|
| http://xmlprobe.com/features/pseudo-root-element |
| [none] | selects the pseudo-root element for efficient large document evaluation |