?
Solved

Passing linked url from xml to html

Posted on 2010-09-14
2
Medium Priority
?
445 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

765 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