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
<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>
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)
//document/items/item[@name='Form'][text()='Procedure']/../item[@name='Body']
Results in the CDATA wrapped content, I am lost as to how select the inner text.
//document/items/item[@name='Form'][text()='Procedure']/../item[@name='Body']/text()
Is yielding an empty string