You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by John Brayton <jb...@virtualsanity.com> on 2004/12/05 04:28:31 UTC

[digester] Schema Validation

I am trying to use Digester's schema validation capability, and would
appreciate some helpful input.

I did see the following note in the JavaDoc for Digester 1.6:
> IMPLEMENTATION NOTE - A bug in Xerces 2.0.2 prevents the support of XML
> schema. You need Xerces 2.1/2.3 and up to make this class working with XML
> schema

I am using Xerces 2.4, so I would assume the above note would not apply to
my project.  However, when I use Digester 1.6, schema validation does not
happen.  It does happen with Digester 1.5.  I can subclass Digester (1.6),
replacing the getParser() method with a copy of the getParser() function
from Digester 1.5, and the schema validation happpens.  The relevant
change appears to be the way the configuration properties are set.

So, what I'm trying to understand is:

-What is the goal of the change in the getParser() function between 1.5
and 1.6?

-Is there a "correct" way to use schema validation with Digester 1.6 that
I am not doing?

Thank you.

John


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [digester] Schema Validation

Posted by robert burrell donkin <ro...@blueyonder.co.uk>.
On 5 Dec 2004, at 03:28, John Brayton wrote:

> I am trying to use Digester's schema validation capability, and would
> appreciate some helpful input.
>
> I did see the following note in the JavaDoc for Digester 1.6:
>> IMPLEMENTATION NOTE - A bug in Xerces 2.0.2 prevents the support of 
>> XML
>> schema. You need Xerces 2.1/2.3 and up to make this class working 
>> with XML
>> schema
>
> I am using Xerces 2.4, so I would assume the above note would not 
> apply to
> my project.  However, when I use Digester 1.6, schema validation does 
> not
> happen.  It does happen with Digester 1.5.  I can subclass Digester 
> (1.6),
> replacing the getParser() method with a copy of the getParser() 
> function
> from Digester 1.5, and the schema validation happpens.  The relevant
> change appears to be the way the configuration properties are set.
>
> So, what I'm trying to understand is:
>
> -What is the goal of the change in the getParser() function between 1.5
> and 1.6?

better support for more modern parsers. (IIRC tomcat had some real 
issues with certain versions of xerces)

> -Is there a "correct" way to use schema validation with Digester 1.6 
> that
> I am not doing?

probably not

it's sad to have to say this but transparent schema validation is a 
nightmare. i really hope that a future JAXP specification will address 
this issue comprehensively but until then, it's a case of making the 
best of a bad lot. the only known reliable way to achieve schema 
validation is to grab a parser instance, configure it appropriately 
(for the particular parser version) and then pass it to digester.

AFAIK Xerces 2.4 should be supported (i'm pretty sure that it was 
tested) but digester has to make some educated guesses about the 
particular xerces version present and this code isn't infallible.

BTW have you checked that you've registered an ErrorHandler to log any 
violations

- robert


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org