Instead of giving handlers for each element, for some applications it would be useful to have a data structure generated from the DTD and the XML-parsing code populates this data structure. So each element could be turned into a C struct, with attributes and subelements as fields. If you have
<!ELEMENT a (b, c?, d*)>
then maybe the corresponding data structure would be
struct A {
struct B b;
struct C *c; /* could be null */
int num_D; /* zero or more */
struct D *ds; /* array of num_D Ds */
}
And then attributes, PCDATA and CDATA could be turned automatically into strings. You get the idea.
(From ed@membled.com, Sourceforge user epaepa, unable to log in due to site problems.)