Hi Russell,

"Thamm, Russell" <[EMAIL PROTECTED]> wrote on 09/08/2008
12:08:59 AM:

> Hi,
> it appears that the dynamic validation feature does not work as
documented.
> If a document that does NOT specify a schema is parsed and the
> grammar pool contains a matching schema (ie a schema that defines
> the root element of the document),
> the document is validated.
> This IS NOT what the documentation says: "The parser will validate
> the document only if a grammar is specified."

It was specified by the grammar pool.

> When I googled this, I found someone who stated that:
> If dynamic validation is set to true, and validation is set to true,
> validation will only occur if a grammar is found.
> This appears to match the way the software works but contradicts the
> documentation (specified is not the same as found).
> Can I use grammar caching and get xerces to validate only documents
> that specify a schema?

Grammar pool is an interface [1]. You're in control of what it returns. If
you want it to only return a grammar if a schema location hint was provided
by the instance document then you need to change your implementation of
grammar pool to behave as such.

> Cheers
> Russell Thamm

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/grammars/XMLGrammarPool.html

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

Reply via email to