I have an XML document with some sample content like this:
<someTag>
<![CDATA[Hello World]]>
</someTag>
I'm parsing the above XML in JavaScript. When I try access and render the Hello World text using xmldoc.getElementsByTagName("someTag")[0].childNodes[0].textContent
all I get was a blank text on screen.
The code is not returning undefined
or any error messages. So I guess the code is properly accessing the message. But due to CDATA
, it is not rendering properly on screen.
Anyway to fix the issue and get the Hello World out of this xml file?