Kohsuke KAWAGUCHI wrote:
> In DTD, there is a rule that the first declared entity overrides other
> declarations with the same name. So if we try to cache one external
> entity, you cannot do much parsing because any parameter entity can be
> possibly overrided by the internal DTD subset.
However, in many of the situations where people want to cache
DTD grammars, they have two reasons for doing so:
1) so that grammars don't have to be re-loaded, and
2) the document cannot override the grammar it's supposed
to validate against.
In the second case, the internal subset should be ignored
anyway. Otherwise, a document instance could define its own
grammar and most business applications want to strictly enforce
a grammar for validation.
> So I think the minimum unit of DTD grammar is the whole DTD grammar.
I would agree with this. If you allowed the internal subset
to be processed and used, you would lose all of the benefit
of caching grammars in the first place.
> Also, as related issue, I think it's very difficult to cache XML Schema
> grammar at namespace-level. And why does this necessary after all? I
> haven't seen such a use case before.
I think there are many many uses for this. But we also need
to think about caching Schema grammars that don't specify a
target namespace.
However, a point that I've made before is that I don't think
that the two grammars (DTD and Schemas) can use the same
cache because the grammars really aren't interchangeable.
But I think we can use the same pool as long as we have a
way of identifying the grammar type.
--
Andy Clark * IBM, TRL - Japan * [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]