logo       

Re: Validation of snippet following schema with <xsd:any>: precompile and E: msg#00032

Subject: Re: Validation of snippet following schema with <xsd:any>: precompile and EntityResolver
Hi João,

"João Luís Pinto" <joaoluispinto@xxxxxxxxx> 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: j-users-unsubscribe@xxxxxxxxxxxxxxxxx
> For additional commands, e-mail: j-users-help@xxxxxxxxxxxxxxxxx

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe