Rick Jelliffe did a minor update to the current ISO Schematron implementations. Please download them here: http://www.schematron.com/implementation.html

Briefly the changes are:

  1. A fix for running EXSLT Schematron.
  2. New parameter “terminate” to stop validation on the first failed assert.
  3. A new version of the Schematron ANT task is also available.

Share/Save/Bookmark

A tutorial is a wonderful thing. Learning how to write Schematron rules with a tutorial is also a wonderful thing. Unfortunately validating XML instance files against a Schematron schema is not always easy. But if it is cumbersome to work with Schematron schemas, then going through the tutorial is also no fun. XML ValidatorBuddy makes it easy to validate XML instance files against a Schematron rule set directly within XMLSpy. This enables you to focus on Schematron itself and not on how to use it.

I take the files from chapter 7 of the Schematron tutorial available at http://www.dpawson.co.uk/schematron/keys.html . Of course the method described here to create and validate the sample files can also applied on any other chapter of the tutorial.

The basic steps are:

  1. Select and copy the content of the Schematron schema and XML sample instance files directly from the web pages of the tutorial (with Ctrl+C).
  2. Create a new .sch document for the Schematron schema and a new .xml document for the sample XML in XMLSpy. Paste the file content with Ctrl+V.
  3. Save the files anywhere you like.
  4. Add a folder to the Project open in XMLSpy and put both into the new folder. ValidatorBuddy recognizes that there is a .sch file in the same project folder as the XML instance and takes this schema for Schematron validation.
  5. Make the .xml file the active document in XMLSpy.
  6. Press “Validate” on the Schematron tab of the XML ValidatorBuddy plugin window.
  7. Check the results :-)
After doing this the Schematron tab shows the following result:

Schematron tutorial chapter 7 result

Schematron tutorial chapter 7 result

Share/Save/Bookmark

, ,

Today I read by chance a post in the oXygen XML editor forum (here) if it is possible to get the XSL which is used in the last step of Schematron validation to validate the XML instance. To make it short: in oXygen there is no special functionality for it, with ValidatorBuddy in XMLSpy you get it with one click.

Some background: Usually, to validate a XML instance document using Schematron a XSL stylesheet which is generated from the Schematron schema is applied to the input XML. To generate the XSL to validate the XML another XSL stylesheet that implements the Schematron definition is used. In addition you also need to do some pre-processing to resolve the includes at least. Guess what, this is also done with the help of a stylesheet.

To simplify this for the user and to save time XML ValidatorBuddy has a button to get the final XSL used to validate the XML with one click:

 

Get XSLT button for Schematron

Get XSLT button for Schematron

On the upper-right corner you can see the “Get XSLT” button. If a Schematron stylesheet is assigned to the XML a new .xsl document will be created in XMLSpy with the stylesheet to validate any instance document.

You can then save this stylesheet and apply it to any XML with simple XSL transformation or you can use it to debug the Schematron schema in the built-in debugger of XMLSpy.

Share/Save/Bookmark

, , ,