Custom validation of XML documents

If you need to validate the edited document with other validation engine than the built-in one you have the possibility to configure external validators as custom validation engines in <oXygen/>. After such a custom validator is properly configured it can be applied on the current document with just one click on the Custom Validation Engines toolbar. The document is validated against the schema declared in the document.

Some validators are configured by default but they are third party processors which do not support the output message format for linked messages described above:

LIBXML

included in <oXygen/> (Windows edition), associated to XML Editor, able to validate the edited document against XML Schema, Relax NG schema full syntax, internal DTD (included in the XML document) or a custom schema type. XML catalogs support(--catalogs) and XInclude processing(--xinclude) are enabled by default in the preconfigured LIBXML validator. The --postvalid flag is set as default allowing LIBXML to validate correctly the main document even if the XInclude fragments contain IDREFS to ID's located in other fragments.

For validation against an external DTD specified by URI in the XML document the parameter --dtdvalid ${ds} must be added manually to the DTD validation command line. ${ds} represents the detected DTD declaration in the XML document.

Note

Known problem: file paths containing spaces are not handled correctly in the LIBXML processor. For example the built-in XML catalog files of the predefined document types (DocBook, TEI, DITA, etc) are not handled by LIBXML if <oXygen/> is installed in the default location on Windows (C:\Program Files) because the built-in XML catalog files are stored in the frameworks subdirectory of the installation directory which in this case contains at least a space character.

Note

On Mac OS X if the full path to the LIBXML executable file is not specified in the Executable path text field some errors may occur on validation against a W3C XML Schema like:

Unimplemented block at ... xmlschema.c

These errors can be avoided by specifying the full path to the LIBXML executable file.

Saxon SA

included in <oXygen/>. It is associated to XML Editor and XSD Editor. It is able to validate XML Schema schemas and XML documents against XML Schema schemas. The validation is done according to the W3C XML Schema 1.0 specification or according to the W3C XML Schema 1.1 one. This can be configured in Preferences.

MSXML 4.0

included in <oXygen/> (Windows edition). It is associated to XML Editor, XSD Editor and XSL Editor. It is able to validate the edited document against XML Schema, internal DTD (included in the XML document), external DTD or a custom schema type.

MSXML.NET

included in <oXygen/> (Windows edition). It is associated to XML Editor, XSD Editor and XSL Editor. It is able to validate the edited document against XML Schema, internal DTD (included in the XML document), external DTD or a custom schema type.

XSV

not included in <oXygen/>. A Windows distribution of XSV can be downloaded from: ftp://ftp.cogsci.ed.ac.uk/pub/XSV/XSV31.EXE A Linux distribution can be downloaded from ftp://ftp.cogsci.ed.ac.uk/pub/XSV/XSV-3.1-1.noarch.rpm The executable path is configured already in <oXygen/> for the installation directory [oXygen-install-dir]/xsv. If it is installed in a different directory the predefined executable path must be corrected in Preferences. It is associated to XML Editor and XSD Editor. It is able to validate the edited document against XML Schema or a custom schema type.

SQC (Schema Quality Checker from IBM)

not included in <oXygen/>. It can be downloaded from here (it comes as a .zip file, at the time of this writing SQC2.2.1.zip is about 3 megabytes). The executable path and working directory are configured already for the SQC installation directory [oXygen-install-dir]/sqc. If it is installed in a different directory the predefined executable path and working directory must be corrected in Preferences. It is associated to XSD Editor.

Linked output messages of an external engine

Validation engines display messages in an output view at the bottom of the <oXygen/> window. If such an output message (warning, error, fatal error, etc) spans between three to five lines of text and has the following format then the message is linked to a location in the validated document so that a click on the message in the output view highlights the location of the message in an editor panel containing the file referred in the message. This behavior is similar to the linked messages generated by the default built-in validator. The format for linked messages is:

  • Type:[F|E|W] (the string "Type:" followed by a letter for the type of the message: fatal error, error, warning - this line is optional in a linked message)

  • SystemID: a system ID of a file (the string "SystemID:" followed by the system ID of the file that will be opened for highlighting when the message is clicked in the output message - usually the validated file, the schema file or an included file)

  • Line: a line number (the string "Line:" followed by the number of the line that will be highlighted)

  • Column: a column number (the string "Column:" followed by the number of the column where the highlight will start on the highlighted line - this line is optional in a linked message)

  • Description: message content (the string "Description:" followed by the content of the message that will be displayed in the output view)