Parsing SGML document in Python program

Lars Marius Garshol larsga at garshol.priv.no
Wed Oct 16 20:22:08 CEST 2002


* Ilya Shambat
| 
| I need to be able to parse an SGML document in a Python program. I
| need to know the syntax on how to do that. The project involves
| using a DTD, passed as a command line argument, to read all the SGML
| files that exist in a directory. Does anybody know how this is done?

One way to do it would be to use the PySP integration of the SP SGML
parser. I'm not sure you can pass in the DTD as a parameter, but you
might be able to produce a catalog file that gives the DTD and then
make SP use that.

See <URL: http://www.garshol.priv.no/download/software/pysp/ >.

-- 
Lars Marius Garshol, Ontopian         <URL: http://www.ontopia.net >
ISO SC34/WG3, OASIS GeoLang TC        <URL: http://www.garshol.priv.no >



More information about the Python-list mailing list