Solved

Passing linked url from xml to html

Posted on 2010-09-14
2
435 Views
Last Modified: 2013-12-25
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.
<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>

Open in new window

jack.xml.xml
0
Comment
Question by:springro
2 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 33678167
0
 
LVL 4

Author Closing Comment

by:springro
ID: 33678365
Excellent!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question