[Expat-discuss] Refering to XML Schema and Expat

rolf@pointsman.de rolf@pointsman.de
Tue, 24 Sep 2002 18:58:43 +0200 (MEST)


On 24 Sep, Karl Waclawek wrote:
>> Just one more general question.
>> --One reason of expat being so popular is that it s light-weight and very
>> efficient. But since it does not validate, for peope who would like to validate
>> an XML document first and then parse it. Are there some efficient validators by
>> the same author? If not, are there any other efficient validators to be used in
>> conjunction with expat?
> 
> Good question.
> I know of at least one validation layer on top of Expat, written
> for a TCl wrapper. There are probably others but nobody has ever
> contributed one back to the project.
> Btw, such a layer would validate as you parse, not as an extra step.
> 
> Could anyone on this list jump in here?
> We would really like to know what is out there.

I'm the one, who has written this validation layer on top of expat for
an expat Tcl wrapper, that Karl above mentioned. If someone is
interested, best would be to grab the sources out of the CVS of this
project. To get it, use

   cvs -d:pserver:anonymous@www.archiware.com:/usr/local/pubcvs co tdom

The validation code is in the subdirectory extensions/tnc.

But don't rush. This code needs the framework of the hole project, to
work. On the other side, it should be possible, to break the
validation code out of the framework. The core of that code are simply
a few expat handler functions. It's not perfect, though, the code has
a few limitations.

But beside the deficiencies of my code, I should mention, that I
think, it's not possible, to write a 100 percent compliant DTD
validator on top of the current expat code. There are two major
problems, I see: It is not possible at the moment, to check for the
Validity constraint: Proper Declaration/PE Nesting, and second it is
not possible, to validate XML documents, that have standalone="yes"
and an external subset (the problem is, that there is no reliable way
to know, if expat has done additional normalization on attribute
types other than CDATA (see XML rec 3.3.3). If somebody is interested,
I may elaborate this notes a bit more.

> According to SourceForge statistics we have had 150,000 downloads
> in the last 5 months, so there is a chance that somebody did work
> in that area.

Yes! Please, raise your head.

rolf