xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Clark <an...@apache.org>
Subject Re: Forcing validation to a particular DTD
Date Tue, 06 Nov 2001 08:51:16 GMT
Scott Dewitt wrote:
> I would like to make sure when opening a document that it conforms 
> to the grammar for this vocabulary so that I can intelligently 
> notify the user if the document is not of the correct type.

The closest that you can get is using an entity resolver but
this doesn't get you very far. For one thing, if the document
didn't include a doctype line, then the entity resolver is
never called. Or perhaps the tool that Jeff mentioned would
be useful.

However, be careful about what solution you use. There are
certainly pros and cons with each approach. For example, does
Jeff's tool handle all the various encodings? And what does
it do with an internal subset? Does it swallow it completely
or allow general entity declarations to pass through for use
by the XML parser? etc, etc...

We're currently looking at how to provide a grammar caching
mechanism in Xerces2 which would be a solution to this problem.
But there is currently no code to do this. So if you have any
ideas, please let us know. (We generally talk about design
work in the xerces-j-dev mailing list.)

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message