Conditional xpath with Java

moncar

New Member
I have a sample xml file which looks like the one below:\[code\]<Root> <SubOne> <book author="george" /> <indiv name="abc" /> <indiv name="khh" /> <indiv name="ioo" /> </SubOne> <SubTwo> <indiv book author="hamle" /> <indiv name="kok"/> <indiv name="ppp" /> </SubTow></Root>\[/code\]Is there a way in XPATH to check , if author="george" select /Root/SubOne/indiv/@name , or if the author="hamle", select /Root/SubTwo/indiv/@name.Any help is appreciated
 
Back
Top