Hi Esmond,
> Thanks, but 'abort parsing' how? Don't find this documented.
Like the "empty StringReader" trick that's the canonical way to force a
validating parser not to read anything external to the document entity,
this is something one just learns as part of the "lore of XML". Someone
has probably put this in a faq somewhere, though I haven't looked. Anyway:
Just throw a SAXException out of your resolveEntity method; this will
percolate back to the code that invoked the parser, and will stop the
parser right in its tracks.
> Is there a bad consequence if I just ignore the warning when parsing a
> non-root grammar which has already been pooled?
Probably not. If you have two different, unrelated (by <xs:include>)
schema documents with the same target Namespace though, you could get
undefined behaviour if grammars get into your grammar pool that refer to
components from both. This should never happen with our default
implementation, but if you choose to extend ours to do more creative
things, it's something you'll need to be aware of.
Cheers,
Neil
Neil Graham
XML Parser Development
IBM Toronto Lab
Phone: 905-413-3519, T/L 969-3519
E-mail: [EMAIL PROTECTED]
"Esmond Pitt"
<[EMAIL PROTECTED] To: <[EMAIL PROTECTED]>
le.net> cc:
Subject: Re: Schemas & grammar pools
11/11/2003 07:17
PM
Please respond to
xerces-j-dev
Neil
Thanks for the reply.
> If you register an EntityResolver, it will be called when Xerces requires
a
> grammar and can't find it in the registered grammar pool. At this point,
> you'll have an opportunity to abort parsing. In effect, your entity
> resolver implementation could be as simple as to abort parsing every time
> resolveEntity() is called.
Thanks, but 'abort parsing' how? Don't find this documented.
> The easiest way around this is either to parse only "root" schema
> documents, or to parse all schema documents but start with schema
documents
> on which others have dependencies. This is the application's
> responsibility and I'm afraid there's nothing Xerces's default
> implementation can do to help you.
Is there a bad consequence if I just ignore the warning when parsing a
non-root grammar which has already been pooled?
---------------------------------------------------------------------
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]