views:

187

answers:

2

Is there a tool that can generate Django models from a DTD? Failing that, are there any decent DTD parsers available for Python?

A: 

I have not seen anything for Django that does that directly. However, have you looked at lxml's Xpath functionality? Breezing through the docs makes it look like it can do DTD parsing.

jathanism
I have, and unfortunately it's limited to using the DTD to validate arbitrary XML documents.
Ignacio Vazquez-Abrams
A: 

I realize that this reply (to the second question) comes several months after the question was posted but, if only for the record: you could use xmlproc to validate your code. You can find a good example on how to do it here.

plok
I only see validation there, not parsing.
Ignacio Vazquez-Abrams
My fault. I misunderstood your question. Kind of lame, I know.
plok