Hi,

When I tried to use jing with iso-relax I of course ran into the same 
NullPointerException in the VerifierHandlerImpl that you fixed. A quick 
look in the source led me to the same conclusion you must have had: 
there was no way this could ever have worked so it must have been 
completely untested.

Also, as the latest jing version was several years old and included such 
a fatal bug, I concluded that it must be completely unmaintained.

I simply gave up and used Sun's MSV (msv.dev.java.net), which worked for me.

Regards,
Bas


m-ringler wrote:
> 
> 
> Hello relax-ng users.
> I had some trouble getting jing to run under the javax.xml.validation
> API but I finally succeeded and thought this might be interesting for
> other relax ng users .
> 
> I combined jing-20030619, isorelax-20041111 and isorelax-jaxp-bridge
> 1.0. I found and fixed some bugs (see below) and made the whole thing
> compile in jdk 1.5 and with recent versions of the libraries (see
> build.xml).
> Now it works but you must set the system property
> javax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0 
> <http://relaxng.org/ns/structure/1.0>
> to
> org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl
> manually. At least in my case it was not sufficient to have the jar
> file on the class path.
> 
> I uploaded a binary jar and source zip (including the ant script) to
> http://tech.groups.yahoo.com/group/rng-users/files/jing/ 
> <http://tech.groups.yahoo.com/group/rng-users/files/jing/>
> 
> Using the jar file would look like this:
> java -cp
> "jing-20070318.jar;your-javax-xml-validation-aware-application.jar"
> -Djavax.xml.validation.SchemaFactory:http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl
>  
> <http://relaxng.org/ns/structure/1.0=org.iso_relax.verifier.jaxp.validation.RELAXNGSchemaFactoryImpl>
> your.MainClass
> 
> Here's a summary of the two most important bugs fixed:
> *Jing*
> In com.thaiopensource.relaxng.impl.PatternValidator and
> com.thaiopensource.relaxng.jarv.VerifierHandlerImpl
> 
> PatternValidator called its public reset() method in its constructor.
> VerifierHandlerImpl overrides reset() with a method that dereferences
> an object that is assigned in its own constructor. Together, this
> caused a NullPointerException when VerifierHandlerImpl(...) called
> super(...).
> Solution: put the reset code in PatternValidator into a private method
> resetImpl and make both PatternValidator(...) and reset() call
> this method.
> 
> *JAXP-JARV-Bridge*
> Assured that a validator will have a DraconianErrorHandler after
> initialization or reset (as required by the spec). The unfixed code
> set a null error handler on reset() which lead to the validator not
> emitting any errors.
> 
> M. Ringler

Reply via email to