Re: XML document validation

[email protected]
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
On 13 Aug, Ajit Kumar wrote:
> Can the property of expat to parse the DTD can be helpful in validating
> a XML document? If yes, than how?

First question: Almost yes. There are only very few information bits
missing to do a full check of all validity constraints of the XML
rec. As far as I'm aware, the missing bits are all related to DTD
syntax checking. If you want to validate XML documents against a DTD,
which is known to be valid, the answer is: Yes.

Second question: You've to write the validation layer. Use the
callbacks, which provides the information out of the DTD, store that
information and do the content model etc. checks while parsing within
your handler functions. I've written such code. Although it's not
exactly a trivial task it also isn't extraordinary difficult.

rolf
-- 
Im Urlaub / On vacation: 2005-07-28 - 2005-08-12.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.