You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Michael D. Crawford" <cr...@goingware.com> on 2000/12/29 19:34:35 UTC
Re: DTD to element graph?
While Xerces may not give you the tools you need to operate on a DTD as
an object in itself, the PyXML python library does.
You can interface it to C and C++ so if you want to work with a DTD from
a C++ program you could bolt a python interpreter to your application (I
think you link to it as a shared library or something), then create an
instance of a subclass of the dtd parser thingy they have, parse the
DTD, and methods in your subclass get called with different components
of the DTD as parameters.
I guess it's kind of like SAX for reading DTD's. This isn't the main
thing PyXML is advertised for but there's a module in there that does it
and it's mighty handy.
You can get PyXML from:
http://www.python.org/sigs/xml-sig/
and the module that does this is
xml/parsers/xmlproc/dtdparser.py
in the PyXML library.
Mike
--
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com
Tilting at Windmills for a Better Tomorrow.