Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Site Directory for multiple xml documents(newbie)

Status
Not open for further replies.

dadougalee

Programmer
Jul 29, 2005
10
US
What I would like to do is have about 12 XML files in one folder. Take those files and load them into an HTML document. From there I want to display 3 or four tags from each XML document. Mostly likely I would display them all in a table or something. I know how to load one in. Here is my code in doing this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
<html>
<head>
<title></title>
<script type="text/javascript">
<!--
function loadXML()
{
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("test.xml")
nodes=xml.documentElement.childNodes
document.getElementById('a1').innerText=nodes(1).text
document.getElementById('a2').innerText=nodes(2).text
document.getElementById('a3').innerText=nodes(3).text
document.getElementById('a4').innerText=nodes(4).text
document.getElementById('a5').innerText=nodes(5).text
document.getElementById('a6').innerText=nodes(6).text
document.getElementById('a7').innerText=nodes(7).text
}
// -->
</script>
</head>
<body onload="loadXML()" bgcolor="#ffffc8">
<table border="1" align="center" cellSpacing=1 cellPadding=1 summary="">
<tr align=center>
<td align=left>
<table summary="">
<tr>
<td align="right"><b>Node 1:</b></td>
<td><span id="a1"></span></td>
</tr>
<tr>
<td align="right"><b>Node 2:</b></td>
<td><span id="a2"></span></td>
</tr>
<tr>
<td align="right"><b>Node 3:</b></td>
<td><span id="a3"></span></td>
</tr>
<tr>
<td align="right"><b>Node 4:</b></td>
<td><span id="a4"></span></td>
</tr>
<tr>
<td align="right"><b>Node 5:</b></td>
<td><span id="a5"></span></td>
</tr>
<tr>
<td align="right"><b>Node 6:</b></td>
<td><span id="a6"></span></td>
</tr>
<tr>
<td align="right"><b>Node 7:</b></td>
<td><span id="a7"></span></td>
</tr>
</table>
</td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td></tr>
</table>
</body>
</html>


Anyone have any ideas? Or can at least steer me in the right path?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top