CIT041X Index > Jing

Using Jing

For those of you who want to use Relax NG’s compact syntax, you can use Jing.

First, download jing-20030619.zip here and then unzip it; it will create a directory named jing-20030619. Let’s say you place it on the C: drive. You may then copy this code into a file named jingvalidate.bat:


echo off
java -jar c:\jing-20030619\bin\jing.jar  -t %1 %2 %3 %4 %5 %6

To validate a file named data.xml with a grammar named grammar.rng (written in the XML format), you say:

jingvalidate grammar.rng data.xml

To validate a file named data.xml with a grammar named grammar.rnc (written in the compact syntax), you use:

jingvalidate -c grammar.rnc data.xml

Using Jing on Linux

Here’s the jingvalidate.sh file; replace the path with the location where you’ve placed jing.


java -jar /path/to/jing/jing.jar  -t $1 $2 $3 $4 $5 $6

Using Jing in the lab at Evergreen

To use jing in the lab at Evergreen, you use this in a batch file:


echo off
java -jar h:\java\xmljar\jing\bin\jing.jar  -t %1 %2 %3 %4 %5 %6