Hi João,

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. With this approach you
would register a resolver with the Validator to locate all of your schema
documents including the "base" one.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/javax/xml/validation/SchemaFactory.html#newSchema()

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

"João Luís Pinto" <[EMAIL PROTECTED]> wrote on 09/28/2007 04:15:30
PM:

> Hello Michael,
>
> Thank you for answering.
>
> I'm trying to keep it "pure", because the code I'm developing will
> probably be (re)used to process both snippets comming from a pull
> parser and from Xerces.
>
> Anyway, since the snippet only has namespace (and not schemaLocation
> info), am I understanding correctly what you are saying is that I
> should compile the "base" schema, and set the feature allowing the
> parser to fetch the uncovered schemas found through a resolver?
>
> João
>
> On 9/28/07, Michael Glavassevich <[EMAIL PROTECTED]> wrote:
> > Hi João,
> >
> > 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. This will tell the validator
that
> > it should try loading schema documents for target namespaces which are
not
> > already covered by the precompiled Schema object.
> >
> > Thanks.
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: [EMAIL PROTECTED]
> > E-mail: [EMAIL PROTECTED]
> --
> 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]


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

Reply via email to