ElementTree uses XPath which uses square brackets to indicate filters: //c...@name="ralf"]
On Feb 4, 4:03 pm, BeSharp <[email protected]> wrote: > I'm not a native Python developer but found the learning curve pretty > okay. However, I'm currently stuck in processing an XML document. I'm > trying to use ElementTree and it basically works fine. I've got to get > all elements with a specific value for an attribute. Here is what I've > tried: > > result = tree.findall('c...@name="ralf"') > > As to the ElementTree documentation this is supposed to return all > <col> elements where the attribute "name" has the value "ralf", e.g. > the following element would qualify: > > <col name="ralf"> > > I do receive the following error: > > SyntaxError: expected path separator (@) > > Can anybody shed some light on this, please? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
