[lxml-dev] parsing DTDs - listing of valid elements

Stefan Behnel stefan_ml at behnel.de
Wed Jul 1 07:37:05 CEST 2009


Hi,

Elliott Slaughter wrote:
> Please ignore my previous message; I solved my own problem by finding an XML
> schema for what I need to do.

Note that you can always use trang to convert a DTD to an XML Schema.

http://www.thaiopensource.com/relaxng/trang.html

If all you need is a list of allowed elements, the required logic to
extract that from the schema shouldn't be too hard to figure out. Although
I wonder if RelaxNG wouldn't be easier to work on.

Stefan


More information about the lxml-dev mailing list