Solved

Passing linked url from xml to html

Posted on 2010-09-14
2
428 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
Comment Utility
0
 
LVL 4

Author Closing Comment

by:springro
Comment Utility
Excellent!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now