[lxml-dev] xpath on text nodes
Jamie Norrish
jamie at artefact.org.nz
Thu Apr 30 06:30:53 CEST 2009
Hi,
> There is no such concept as a text node in lxml.etree.
Okay, but the string results of an XPath selecting text nodes in the XML
have additional attributes - it just seems a pity that an xpath method
isn't one of them.
> That sounds a lot like you should do that in Python by using iterwalk()
> and collecting .text and .tail attributes of Elements, not by using XPath.
Well, I like XPath. :) In fact I already have an implementation of the
use case that, while slightly subobtimal, is sufficient - it just seemed
like one obvious way of doing it better was to use XPath. I shall
investigate using iterwalk instead.
Thanks!
Jamie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://codespeak.net/pipermail/lxml-dev/attachments/20090430/440d3eac/attachment.pgp
More information about the lxml-dev
mailing list