View Single Post
Old 10-18-2012, 06:12 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,399
Thanks: 18
Thanked 352 Times in 351 Posts
sunfighter is on a distinguished road
You will have to play with the presentation, but here is barebones xmt to html via js:

Code:
<!DOCTYPE html>
<html>
<body>
<script>
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","test.xml",false);
xmlhttp.send('');
xmlDoc=xmlhttp.responseXML;

document.write("<table border='1'>");
var x=xmlDoc.getElementsByTagName("perldata");
for (i=0;i<x.length;i++)
  {
  document.write("<tr><td>");
  document.write(x[i].getElementsByTagName("hashref")[0].getAttribute('memory_address'));
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("item")[0].getAttribute('key'));
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("item")[0].childNodes[0].nodeValue);
  document.write("</td></tr>");
  }
document.write("</table>");
</script>

</body>
</html>

Last edited by sunfighter; 10-18-2012 at 08:05 PM..
sunfighter is offline   Reply With Quote