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 in Preferences it can be applied on the current document with just one click on the External Validation toolbar. The document is validated against the schema declared in the document.

Figure 4.26. External validation toolbar

External validation toolbar

Some validators are configured by default:

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. 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

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

not included in <oXygen/>, the jar file and license key file of Saxon 8 SA must be placed in the lib subdirectory of the installation directory and the entry

<library name="lib/saxon8sa.jar"/>
must be copied to the <runtime> section of the [Eclipse-install-folder]/plugins/com.oxygenxml.editor_8.2.0/plugin.xml file. After that Eclipse must be restarted with the -clean parameter. It is associated to XML Editor and XSD Editor.

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/XSV210.EXE A Linux distribution can be downloaded from ftp://ftp.cogsci.ed.ac.uk/pub/XSV/XSV-2.10-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. It must be used with a Java 1.4 virtual machine because it does not work with Java 1.5.