Oliver Becker, System Architecture, Department of Computer Science, Humboldt University Berlin .

Java API for the Schematron

This page contains references to the first (and surely incomplete) implementation of a Java API for the Schematron. It is based on version 1.5 but doesn't make use of all the 1.5 features yet.

Authors: Anna Hovhannisian, Oliver Becker
Version: 0.1, 2001-04-02

Rationale

The Schematron can be used as an approach for validating XML data based on patterns in trees. Since XSLT patterns and XPath expressions are the foundations of this approach, implementations of the Schematron are in general XSLT based. The output of an XSLT processor is the result of the validation process.

Applications which want to benefit from the Schematron approach need a way to to access the results of this validation process. Java based applications may use the API described on this page.

Basic Idea

A Schematron generated validation stylesheet outputs a well-formed XML instance, which can be access via specific methods of a schematron.Result object. Since a preprocessor (called meta-stylesheet) is responsible for the format of the validation result, such a special preprocessor is part of the API package.

Outline of the validation result:

<RESULT>
   <TITLE>The title of the schema</TITLE>
   <element>
      <ASSERT>violated assertions for element</ASSERT>
   </element>
   <element>
      <REPORT>reported messages for element</REPORT>
   </element>
   ...
</RESULT>

Files

The Schematron Java API consists of 3 files contained in the package schematron:

Needed external classes:

Bugs and Problems

Ideally the meta-stylesheet for the Schematron Java API should use a skeleton. Unfortunately the latest Xalan 2.0.1 (which implements the TrAX API of JAXP 1.1) has still a bug with xsl:namespace-alias of imported stylesheets. Saxon 6.2.2 has a problem on UNIX platforms to resolve the URI of a stylesheet which is given as a local file.

For this reason no skeleton is used, the preprocessor.xslt contained in the package is a standalone meta-stylesheet (a slightly extended skeleton1-5.xsl).

To do

© ob Montag, 02-Apr-2001 17:14:59 CEST .