If you use CDATA, then you must decode it correctly (textContent, value and innerHTML are methods that will NOT return the proper data).
let us say that you use an xml structure similar to this:
<response>
<command method="setcontent">
<fieldname>flagOK</fieldname>
<content>479</content>
</command>
<command method="setcontent">
<fieldname>htmlOutput</fieldname>
<content>
<![CDATA[
<tr><td>2013/12/05 02:00 - 2013/12/07 01:59 </td></tr><tr><td width="90">Rastreado</td><td width="60">Placa</td><td width="100">Data hora</td><td width="60" align="right">Km/h</td><td width="40">Direção</td><td width="40">Azimute</td><td>Mapa</td></tr><tr><td>Silverado</td><td align='left'>CQK0052</td><td>05/12/2013 13:55</td><td align='right'>113</td><td align='right'>NE</td><td align='right'>40</td><td><a href="http://maps.google.com/maps?q=-22.6766,-50.2218&iwloc=A&t=h&z=18" target="_blank">-22.6766,-50.2218</a></td></tr><tr><td>Silverado</td><td align='left'>CQK0052</td><td>05/12/2013 13:56</td><td align='right'>112</td><td align='right'>NE</td><td align='right'>23</td><td><a href="http://maps.google.com/maps?q=-22.6638,-50.2106&iwloc=A&t=h&z=18" target="_blank">-22.6638,-50.2106</a></td></tr><tr><td>Silverado</td><td align='left'>CQK0052</td><td>05/12/2013 18:00</td><td align='right'>111</td><td align='right'>SE</td><td align='right'>118</td><td><a href="http://maps.google.com/maps?q=-22.7242,-50.2352&iwloc=A&t=h&z=18" target="_blank">-22.7242,-50.2352</a></td></tr>
]]>
</content>
</command>
</response>
in javascript, then you will decode by loading the xml (jquery, for example) into a variable like xmlDoc below and then getting the nodeValue for the 2nd occurence ( item(1)
) of the content
tag
xmlDoc.getElementsByTagName("content").item(1).childNodes[0].nodeValue
or (both notations are equivalent)
xmlDoc.getElementsByTagName("content")[1].childNodes[0].nodeValue