Javascript variable limits to 4096 char. How to display the contents of XML Node to not get it truncated?

593 Views Asked by At

I have a problem with displaying the contents of the XML record in Javascript. Overall, getting to nodes with the values I want to view the contents in the div element

var data = xDoc.getElementsByTagName("baza")[0]; // node tree  
for (i = 0; i < data.childNodes.length; i++)  // use only 1st level element nodes
  if (data.childNodes[i].nodeType == 1) {
    oneXMLRecord = data.childNodes[i]; // one final match record

...

var div3 = document.createElement('div');
var str = oneXMLRecord.childNodes[0].nodeValue; //putting content into variable
div3.innerHTML = str;

td.appendChild(div3);

The problem is that when the elements have more than 4096 characters, then the contents of the output is truncated to the first 4096 characters.

I google a bit and yet I found that supposedly helps textContent method, it may be wrong but for me it does not help.

Anyone know how one would deal with this problem? How to omit the limit?

0

There are 0 best solutions below