XML Multi Schema Validator

Sun has released a tool that abstracts validation to its core, and builds different validation syntaxes on top. This allows the same engine to work with DTD, XML Schema, and even Relax/NG. Because of this multiple personality, it's called the Sun Multi Schema Validator, or MSV for short. Since each validator implements some slight variation of the standard, it's often useful to check schemas against more than one validator to catch problems that one might miss.

This article tells you how you can integrate the MSV into Stylus Studio as one of the Custom Validation Engines. It will work for files with a DTD, a single XSD, or both a DTD and a single XSD.

Where Can I Get the Sun Multi Schema Validator?

Click here to get to the main page.

The software comes as a pair of .zip files (at the time of this writing, msv.20030225.zip and relames.20030225.zip about 2½ megabytes each). You only need the second for this to work, but the first contains the documentation that you might want to peruse at a later time. In case you are having difficulties downloading them, here are archived copies of msv*.zip and relnames*.zip.

Installing the Multi Schema Validator

  1. Unpack the .zip file. For our testing purposes, we'll assume you unpack it into C:\MSV
  2. Create a one-line msv.cmd file, like this:
    java -cp msv-driver.jar;msv.jar com.stylusstudio.msv.StylusDriver %*
  3. Place this extra msv-driver.jar file in the same directory. (Source is here.)
  4. In Stylus Studio, go to Tools|Options|General|Custom Validation Engines
  5. Click on the Add New Validator icon to add a new custom validator
  6. Fill in the entries like this:
    Custom Validation Engines showing SQC settings

Using the Multi Schema Validator

Open any XML file with an attached schema, and click on the Validate XML Document (Validate Document) icon to drop down the list, and then select the Multi Schema Validator entry.

XML Validation Dropdown showing MSV

You will see the Output window appear, and show something like this:

Running custom validation engine Sun Multi Schema Validator (MSV)...

C:\MSV>java -cp msv-driver.jar;msv.jar com.stylusstudio.msv.StylusDriver "c:/u/ubl-sample.xml"
Stylus Studio Driver for the Sun MSV Validator 20030225
--Starting validation of "c:/u/ubl-sample.xml"--
Validating "c:/u/ubl-sample.xml" against XML Schema "file:///c:/u/cd-UBL-1.0/xsd/maindoc/UBL-OrderResponseSimple-1.0.xsd"
"c:/u/ubl-sample.xml" is valid
--Completed validation of "c:/u/ubl-sample.xml"--

Congratulations! You've just added yet another capable new tool to your Stylus Studio toolbox.


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now


Download a free trial of Stylus Studio's cross-platform development and validation tools Today!.

Get More Tips on Extending Stylus Studio Delivered to Your Inbox

Subscribe to the Stylus Scoop newsletter and get next month's tricks of the trade delivered to your inbox for free!.

What's New for Stylus Studio® X16?

New XQuery & Web Services Tools, Support for MySQL, PostgreSQL, HL7 EDI, Microsoft .NET Code Generation and much more!

Ask Someone You Know

Does your company use Stylus Studio? Do your competitors? Engineers from over 100,000 leading companies use Stylus Studio, and now you can ask someone from your own organization about their experiences using Stylus Studio.

Free Stylus Studio XML Training:
W3C Member