<page>I was trying to access the CDATA section the way I access all the text nodes:
<p>Paragraph 2 <a href="lnk.html">lnk</a></p>
xmlDocument.getElementsByTagName('content').firstChild.nodeValue;Unfortunately it doesn't work. I was wondering what am I doing wrong. I run some tests and discovered that the <content> node has actually 3 children (I thought it has only 1). The first and third childNodes are empty text nodes; the middle one is the CDATASection node I was trying to access. So the final code looks like this:
I'm using this for parsing a server response returned by AJAX Request (invoked using prototype.js library). I am not an expert here but I guess it may differ between XML DOM implamantations.