[lxml-dev] ElementTree docinfo attribute
Stefan Behnel
stefan_ml at behnel.de
Mon Aug 25 10:31:25 CEST 2008
David Soulayrol wrote:
> I have a method which takes a NS map, a root tag and DTD info and should
> return a correct document with all these info set. I was wondering if
> the only way to do this was to write everything inside a string and then
> call the parser with StringIO.
Ok, so the problem you have is how to set the DTD reference after creating
the root Element. There isn't currently an API to do that, so you have to
call the parser to create the right setting in the first place.
I wouldn't mind making the public_id and system_url properties in
ElementTree.docinfo (DocInfo class) writable. Patches appreciated.
Stefan
More information about the lxml-dev
mailing list