python - How to find children of an XML element with a given attribute? -
what wrong search term (using elementtree)?
matches = root.findall(".//{http://www.w3.org/2000/svg}g[@id='" + sid + "']/circle")
i no matches. element in question has 'circle' child , works fine (without circle):
matches = root.findall(".//{http://www.w3.org/2000/svg}g[@id='" + sid + "']")
with above i'll match. i'm following advice here (see examples section). example no different example
root.findall(".//*[@name='singapore']/year")
ah! silly mistake, these svg elements, solution follows:
matches = root.findall(".//{http://www.w3.org/2000/svg}g[@id='" + sid + "']/{http://www.w3.org/2000/svg}circle")
Comments
Post a Comment