xjparse: Easier XSD validation with Xerces

01 Dec 2005; last modified 08 Oct 2010

This is the permanent status page for xjparse. Xjparse is a simple command-line wrapper for the Xerces XML Schema validator. It accepts several options, notably one which specifies the set of schemas to be used during validation. Version 1.0 is now available.

I thought it was oddSomething else that I think is really odd is the fact that I can't find any way to tell Xerces to start validation in “lax” mode. Anyone got clues about that? that I couldn't find an option for Xerces’ standard command-line parser to specify which schema(s) to validate against. When one of my friends asked me about it, I decided I wasn't the only one who thought it was odd, so I banged together a quick hack. When another friend mentioned it in passing at XML 2005 and a whole bunch of people clamored for it, I made myself a note to just publish it. So here's my hack.

Xjparse performs W3C XML Schema validation with Xerces. Version 1.0 of xjparse was released on 01 Dec 2005. It should be considered an alpha release; it seems to work fine, but it probably doesn't respond to error conditions with any robustness or grace at all. Like Xerces, it is implemented in Java and runs on any platform that supports Xerces 2.x. You can get xjparse from its home on nwalsh.com. It is available under the Apache Software License.

Xjparse is maintained by Norman Walsh. It was first announced on 01 Dec 2005. Please report any bugs that you encounter.

Comments

Not that I would rain on anyone's useful little hack, and certainly to be preempted by James Clark is no disgrace. But I would point out that Jing already does this. If it discovers that the schema you feed it is XSD rather than RNG, it tells Xerces to do the Right Thing with it, completely ignoring any xsi:whatever hints.

This fact seems to be little-known, although I called it out at one session or another at XML 2005, in answer to someone who wanted an XSD validator that allows any-against-any validation.

—Posted by John Cowan on 01 Dec 2005 @ 08:55 UTC #

Yes, indeed you did. And I promptly forgot. Oh, well. Maybe my little hack will still be valuable to folks with documents that need to be validated against schemas from several namespaces. And if anyone ever answers the "lax validation" question, I'll add a switch for that, too.

—Posted by Norman Walsh on 01 Dec 2005 @ 09:22 UTC #