how to obtain data inside a CDATA section using Xpath from a XML. I have embedded a html code inside a CDATA section within an XML like shown below
<xml>
<node1>
<![CDATA[ <div id= "div1">Hi howdy</div> ]]>
</node1>
</xml>
How can I access it directly from Xpath.
I can get the text of node1
by using .//node1/text()
What is the correct Xpath for getting the contents inside the CDATA section as a html document.
//node1/text()does select what you want. What do you mean you want it as a HTML document, it is just a page fragment.text()does return the content of the CDATA section, so what is the problem?