Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Passing linked url from xml to html

Posted on 2010-09-14
2
Medium Priority
?
446 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Accepted Solution

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

Author Closing Comment

by:springro
ID: 33678365
Excellent!
0

Featured Post

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches viewers about errors in exception handling.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
Suggested Courses

604 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