Hi João,

"João Luís Pinto" <[EMAIL PROTECTED]> wrote on 10/08/2007 03:44:23
AM:

> Michael,
>
> > If you're willing to stray a little away from writing pure JAXP code,
you
> > may be able to achieve what you want by setting the
> > "http://apache.org/xml/features/internal/validation/schema/use-
> grammar-pool-only"
> >  feature to false on the SchemaFactory.
>
> It looks like that particular feature is not supported by the internal
> Xerces bundled in Java5.

Not surprising. Whatever shipped in Java 5 predates the JAXP 1.3
implementation in Xerces, so probably wouldn't support any features which
were introduced after Xerces 2.6.2 (like this one).

> A small example of my problem:

<snip/>

> Exception got:
>
> org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching
> wildcard is strict, but no declaration can be found for element
> 'wsdl:definitions'.
>
> The resolver is never called.

Works for me with Xerces 2.9.1, so this sounds like a bug in Java 5. I've
found that it has issues that the Apache version of Xerces has never had.

> > You could do that, though if there's no technical reason why you need
to
> > pre-compile the "base" schema SchemaFactory.newSchema() [1] would work
as
> > well and would avoid any Xerces specific features.
>
> The only technical reason is eficiency, since validation will be a
> recurring task and the overhead of re-compiling the schema in each and
> every call might be significative.

The Schema returned from SchemaFactory.newSchema() does caching as well so
that shouldn't be an issue.

> I am feeling a bit overwhelmed by the prospect of having to implement
> a full caching structure for schemas and having to reprocess the top
> schema every time to keep standard for a "trivial" task like
> validation :-) .
>
> Any thoughts or should I move forward?

You should try the latest version of Xerces.

Check that you're getting the right SchemaFactory implementation. It should
be org.apache.xerces.jaxp.validation.XMLSchemaFactory.

> Thanks,
>
> João
> --
> O Insurgente - http://oinsurgente.org
>
> Small Brother - http://small-brother.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to