
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Ian Bicking wrote:
Stefan Behnel wrote:
Hi Ian,
Ian Bicking wrote:
Stefan Behnel wrote:
There is no API for it, but internally, we have this information for parsed trees, at least the line number - note that exceptions contain the line number
Is there a file or resource name in there somewhere too? This would be nice to have if, say, you were using xinclude to combine elements from different sources.
No, that's only stored at a per-document level (which makes sense IMHO).
What would you do then if you create a document with multiple sources? E.g., if you use xinclude to include elements from different sources into a single document. The line numbers will be nonsense at that point, and there's no clear place to keep track of the real source.
Logically, wouldn't the xincluded node have its "own" document reference, with correct filename / URL, since it is just "borrowed" into the including document? I don't know if lxml's / ETree's semantics support such a notion, however.
Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com