0

Using the pugixml library, I am trying to select all nodes that fit:

//v6_root_object/v6_rootlist2d/obj_pluginobject[@level='0']

that have a child node described by

//v6_root_object/v6_rootlist2d/obj_pluginobject[@level='0']/chunk[@id='110064']/string[@v='light']

Is there an easy way to do this in xpath?

AdamSpurgin
  • 951
  • 2
  • 8
  • 28

1 Answers1

1

You can try this way :

//v6_root_object/v6_rootlist2d/obj_pluginobject
    [
     @level='0' 
            and 
     chunk[@id='110064']/string[@v='light']
    ]

simply add child node XPath (relative to it's parent node) in the XPath criteria (within []).

har07
  • 88,338
  • 12
  • 84
  • 137