lxml and identification of elements in source

Laurent Pointal laurent.pointal at wanadoo.fr
Wed Sep 19 16:39:28 EDT 2007


Hello,

I use lxml to parse a document, modify some elements in the tree, run
xinclude on it (thanks to Stefan Behnel for the pointer), and finally use
the data to feed my sax-aware tool.

To report warnings/errors to the user (not related to XML itself, but to
things like missing source for a cross-reference by example), is there a
way to get the source-file and line/column of an element ?

[note: these informations are available when lxml parse the source, but are
they kept anywhere in the document tree ?]

Thanks.

Laurent.




More information about the Python-list mailing list