springro
asked on
Passing linked url from xml to html
Looking to pass data from an xml file to html.
Simple data can be passed without a problem.
Would like the links to work on the html side.
Examples attached.
Any help which could be provided would be appreciated.
Simple data can be passed without a problem.
Would like the links to work on the html side.
Examples attached.
Any help which could be provided would be appreciated.
<html>
<head>
<script><endnote><head>
<script></script>
<title>Theaters</title>
</head>
<body>
<br>
<script type="text/javascript">
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","jack.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write("<table border='0'>");
var x=xmlDoc.getElementsByTagName("qry_Website_2");
for (i=0;i<x.length;i++)
{
document.write("<tr><td><strong>");
document.write(x[i].getElementsByTagName("dma_name")[0].childNodes[0].nodeValue);
document.write("</strong><tr><td>");
document.write(x[i].getElementsByTagName("theater_name")[0].childNodes[0].nodeValue);
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("street_address1")[0].childNodes[0].nodeValue);
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("street_city")[0].childNodes[0].nodeValue.concat(" , ")) ;
document.write(x[i].getElementsByTagName("street_state")[0].childNodes[0].nodeValue.concat(" "));
document.write(x[i].getElementsByTagName("street_zip_code")[0].childNodes[0].nodeValue);
document.write("<tr><td>");
document.write(x[i].getElementsByTagName("Link")[0].childNodes[0].nodeValue) ;
document.write("<tr><td>");
}
document.write("</table>");
</script>
</body>
</html>
jack.xml.xml
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER