XPath (SimpleXML) selection of child based on value of child's sibling

后端 未结 3 1969
旧时难觅i
旧时难觅i 2021-01-22 05:28

I\'m using SimpleXML (Java) and I\'m trying to get a List of objects based on the value of one of the siblings of the list.

So, here\'s my XML:



        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-22 06:32

    I don't know about SimpleXML specifically, but this xpath should get you the elements you want:

    metadata/resources/resource[ittype = 'Service_Links']
    

提交回复
热议问题