
thankyou On Mon, Jan 16, 2012 at 3:03 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
Le 15/01/2012 16:27, Mag Gam a écrit :
Hello,
I have a xml file like this, http://msdn.microsoft.com/en-us/library/windows/desktop/ms762271(v=vs.85).as...
Lets say I want to get all the book titles authored by, ¨O'Brien, Tim¨. What is the best way to do that?
Hi,
Have you looked at XPath?
The link above is for the lxml API. There are many resources on the web for learning the XPath syntax. Your example would be something like this (untested)
element_list = some_lxml_tree.xpath( '/book[author/text() = "O'Brien, Tim"]')
Regards, -- Simon Sapin _________________________________________________________________ Mailing list for the lxml Python XML toolkit - http://lxml.de/ lxml@lxml.de https://mailman-mail5.webfaction.com/listinfo/lxml