[lxml-dev] ElementTree docinfo attribute

Stefan Behnel stefan_ml at behnel.de
Sat Aug 23 13:55:53 CEST 2008


Hi,

David Soulayrol wrote:
> I can read at
> http://article.gmane.org/gmane.comp.python.lxml.devel/1106/match=docinfo
> 
> "a DocInfo object that you can also instantiate on an ElementTree (or
> Element) by hand."
> 
> But I also can read from _ElementTree help : 
> 
> "docinfo: Information about the document provided by parser and DTD.
> This value is only defined for ElementTree objects based on the root
> node of a parsed document (e.g.  those returned by the parse
> functions)."

I just added ", not for trees that were built manually." at the end, that
should make it clearer.


> In any case, the docinfo property of ElementTree seems read only. So
> please tell me, is it possible to fill the docinfo property of an
> ElementTree by hand, or is it necessary to use the etree parse method ?

What information would you like to add, and for what purpose?

Stefan


More information about the lxml-dev mailing list