Aug. 25, 2008
3:31 a.m.
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