XML XPATH Query sibling value with multiple sibling attributes

HeadShot

New Member
Given the following XML, I am wanting to build an XPath query to get me the text of the Body node which contains the HTML\[code\]<documents> <document> <items> <item name='Form'> Procedure </item> <item name='Body'> <![CDATA[<p>arbitrary html</p>]]> </item> </items> </document> <document> <items> <item name='Form'> Process </item> <item name='Body'> Some arbitrary value </item> </items> </document></documents>\[/code\]I am able to get close, I am just missing something. (this may not the best way to get there, but its the only way I have been able to get close)\[code\]//document/items/item[@name='Form'][text()='Procedure']/../item[@name='Body']\[/code\]Results in the CDATA wrapped content, I am lost as to how select the inner text. \[code\]//document/items/item[@name='Form'][text()='Procedure']/../item[@name='Body']/text()\[/code\]Is yielding an empty string
 
Back
Top