XmlValidation

WebHome | UnixGeekTools | Geekfarm | About This Site

Pointers

Validating XML

Sun's Multi-Schema Validator validates against DTD, RELAX NG, and W3C XML Schema

    java -cp xerces.jar;xsdlib.jar;relaxngDatatype.jar;isorelax.jar -jar msv.jar event.dtd event.xml
    --(~/src/multi_schema_validator/msv-20030225)------(04/02/13-01:58)-(p7:L2)--
    java -cp xerces.jar:xsdlib.jar:relaxngDatatype.jar:isorelax.jar -jar msv.jar /path/to/schema.xsd /path/to/file.xml

    start parsing a grammar.
    warnings are found. use -warning switch to see all warnings.
    validating /path/to/file.xml
    the document is valid.

Emacs

DTDGenerator

With dtdgen.jar in your classpath, enter the following command line:

    java -cp dtdgen.jar DTDGenerator event.xml > event.dtd

Good for making edits inside emacs in PSGML mode, since it requires a DTD.

DTDinst

    java -jar dtdinst.jar -i -r rng event.dtd

Trang

Trang converts between different schema languages for XML. It supports the following languages:

A schema written in any of the supported schema languages can be converted into any of the other supported schema languages, except that W3C XML Schema is supported for output only, not for input.

    java -jar trang.jar rng/event.rng new-event.dtd

Trang's WXS output is still in the alpha stage, so there may be some changes in the future.





Updated Sat Oct 7, 2006 8:53 PM