[relaxng-user] Re: Validating in 1.5

Elliotte Harold elharo at metalab.unc.edu
Fri Oct 29 11:22:07 ICT 2004


Thanks. That looks like what I need, but it doesn't seem to be working:

[elharo at stallion elharo]$ java 
-Xbootclasspath/p:jing.jar:isorelax.jar:iso-relax-tiger.jar Relax 
greeting.rng greeting.xml
This implementation does not support RELAX NG.
http://relaxng.org/ns/structure/1.0
java.lang.IllegalArgumentException: http://relaxng.org/ns/structure/1.0
         at 
javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:186)
         at Relax.main(Relax.java:19)


Relax is my own class. I tried this on both classpath and bootclasspath. 
The line it's dying on is just loading the RELAX NG schema factory. Up 
to that point the code is:

import javax.xml.*;
import javax.xml.validation.*;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
import org.xml.sax.*;

public class Relax implements ErrorHandler {

   public static void main(String[] args) {

     if (args.length < 2) {
       System.out.println("Usage: java Relax schema.rng file.xml");
       return;
     }

     Schema schema;
     try {
       SchemaFactory factory = 
SchemaFactory.newInstance(XMLConstants.RELAXNG_NS_URI);
       schema = factory.newSchema(new File(args[1]));
     }
     // ...

The web page says, "this release is designed to work with Tiger beta 1, 
and it probably won't work with the official Tiger release (as the 
validation API is still not finialized)" Has anyone gotten this to work 
with the final 1.5 yet? Or are there any other JAR files I'm missing?


-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim


More information about the relaxng-user mailing list