xpath - Xml search in parent node -


i have xml:

<data>     <title>nice day</title>     <foo>         <bar>         <count>5</count>         </bar>     </foo> </data> 

at first search specific node xpath

e= root.findall('/title/foo/bar/count') 

then check value of node special condition

if int(e.text)>0: 

if node satisfies me, want value of title node.

now i'm looking right xpath syntax it. thanks.

fount foo grandchild count has text , take title text of same parent

//foo[bar/count/text()]/../title/text() 

Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -