Announcing Schematron for Ant v3ᵝ

Plus some other OSS sites

By Rick Jelliffe
April 22, 2010

The latest release for the Schematron for Ant (Java) task is now available at SCHEMATRON.COM.

This is the third release of the Schematron for Ant task which has been through four or five different programmers' hands over the years.


  • The first release supported Schematron 1.5 and output text messages.

  • The second release forked to support basic ISO Schematron (default) and output SVRL.

  • This release merges the forks to support full ISO Schematron (including proposed additions) as well as legacy Schematron 1.6, and can output both SVRL and text messages. It supports almost all the many command line options from the latest skeleton, including localization.

This is a beta; the final will have the source code in the bundle too. I am still not sure which website to use. Christophe Lauret has said some good things about Google Code (more about WebOrganic.org below) as has Alex Brown.

I recommend using the latest SAXON library. That is what it is tested on; however it uses vanilla JAXP so it should be OK with other XSLTs. (The beta testing should shake that up.)

Here is a simple example of invocation:

  <target name="test-2" description="Simple test">
  	<taskdef name="schematron"     classpath="../lib/*.jar"
              classname="com.schematron.ant.SchematronTask" />

<schematron schema="../schemas/test.sch"
file="../xml/test2.xml"
format="svrl"
failonerror="false"/>
</target>

And a more complex one:

<target name="validate" description="Simple test">
 
	<taskdef name="schematron"  classpath="../lib/*.jar
             classname="com.schematron.ant.SchematronTask"  "/>

<schematron schema="../schemas/test-xslt2.sch"
file="../xml/test1.xml"
failonerror="false"
allow_foreign="true"
queryLanguageBinding="xslt2"
diagnose="yes"
debugmode="true"
langCode="nl"
outputEncoding="UTF-8" />
</target>

The Schematron for Ant task has been used in production systems. I am interested in feedback on the beta, it is more tested in some areas than other (such as the Schematron 1.6 support: I have little motivation for it.)

It basically is just a pipeline of four XSLT scripts internally, and saves a lot of configuration nonsense.

In the pipeline

I will be rebuilding it in the next couple of days to bring in some features I've added to the Schematron pre-processor this week that provides some compile-time validation of the XPaths.

I also have a pre-processor ready, but not integrated into this release, that generates assertions based on (ISO DSDL Part 7) Character Repertoire Description Language schemas: it allows you to limit any content (even mixed content) or names to belonging to certain repertoires of characters: for example, to let you say "Introductory paragraphs should only have ASCII characters" or "This document should only contain the characters allowed at Japanese 7th grade level". Try doing that in your XSDs!

[OLDIE: For validating Ant with Schematron, see here.]

At WEBORGANIC.ORG

Weborganic is a sister company to Allette Systems and Topologi. They have had enough small open source projects spilling out that they have started the Weborganic.org FOSS portal. The projects are stored on Google Code as mentioned above.

Projects at time of writing:


  • FURI Originally based on Joe Gregorio's URI Templates idea, FURI is an implementation of a URI Template processor which can also be used for URI pattern matching.

  • DiffX DiffX is an open source Java API for comparing XML documents by analyzing the sequence of XML events.

  • Flint Flint is a lightweight framework for Lucene. You can easily read and write data into a Lucene index using a simple XML format (iXML)

  • XmlDoclet Output Java API documentation as XML.

  • Berlioz Berlioz is a Servlet-based Web framework which uses XSLT for rendering pages and URI Patterns to match URL to services.

Another project I track, which started off with Topologi code, is

  • BreadCrumbBar Now part of Kirill Grouchnikov's Flamingo GUI library.

You might also be interested in:

News Topics

Recommended for You

Got a Question?