Hey,
I need to display the contents of a xml file in a webpage using java script. This worked fine when My text was placed inside the <body> tag. However, when I go to insert the text inside a table the xml data will not be displayed. Is there a rule where you cannot display xml data inside a table? I have pasted the contents of my working html file below, not using tables. If anyone can explain why It wont let me use tables that would be appreciated.
thanks...
<html>
<head>
<script language="JavaScript"
for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("rfidxml.xml")
title1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(0).text
description1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(1).text
link1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(2).text
category1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(3).text
pubdate1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(4).text
</script>
<title>XML Example</title>
</head>
<body bgcolor="white">
<h1>RFID News Feed</h1>
<b>Title: </b><span id="title1"></span>
<br>
<b>PubDate: </b><span id="pubdate1"></span>
<br>
<b>Desc: </b><span id="description1"></span>
<br><b>Link: </b><span id="link1"></span>
<br>Category: </b><span id="category1"></span>
<hr>
</body>
</html>
I need to display the contents of a xml file in a webpage using java script. This worked fine when My text was placed inside the <body> tag. However, when I go to insert the text inside a table the xml data will not be displayed. Is there a rule where you cannot display xml data inside a table? I have pasted the contents of my working html file below, not using tables. If anyone can explain why It wont let me use tables that would be appreciated.
thanks...
<html>
<head>
<script language="JavaScript"
for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("rfidxml.xml")
title1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(0).text
description1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(1).text
link1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(2).text
category1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(3).text
pubdate1.innerText = xmlDoc.childNodes(0).childNodes(0).childNodes(6).childNodes(4).text
</script>
<title>XML Example</title>
</head>
<body bgcolor="white">
<h1>RFID News Feed</h1>
<b>Title: </b><span id="title1"></span>
<br>
<b>PubDate: </b><span id="pubdate1"></span>
<br>
<b>Desc: </b><span id="description1"></span>
<br><b>Link: </b><span id="link1"></span>
<br>Category: </b><span id="category1"></span>
<hr>
</body>
</html>