data island problem

wxdqz

New Member
Hi everyone! I'm still new with xml. I'm trying to display some xml data in a table. The html code is as follows (adapted from w3schools tutorials):

<html>
<body>
<xml id="device_status" src=http://www.webdeveloper.com/forum/archive/index.php/"test.xml"></xml>
<table border="1" datasrc="#device_status">
<thead>
<tr><th>Common Address</th><th>Info Object Address</th><th>Type ID</th><th>Value</th></tr>
</thead>
<tr align="middle">
<td><span datafld="common_addr"></span></td>
<td><span datafld="io_addr"></span></td>
<td><span datafld="tid"></span></td>
<td><span datafld="val"></span></td>
</tr>

</tr>
</table>
</body>
</html>

The test.xml file contents are:
<?xml version="1.0" encoding="ISO-8859-1"?>
<device name="Test Device">
<info_obj>
<common_addr>1</common_addr>
<io_addr>5</io_addr>
<tid>1</tid>
<val>1</val>
<flags>0</flags>
</info_obj>

<info_obj>
<common_addr>1</common_addr>
<io_addr>1</io_addr>
<tid>9</tid>
<val>-0.25</val>
<flags>0</flags>
</info_obj>

<info_obj>
<common_addr>1</common_addr>
<io_addr>13</io_addr>
<tid>3</tid>
<val>0</val>
<flags>0</flags>
</info_obj>
</device>

The problem is this xml data cannot be displayed because the <device> tag has the'name' attribute. If I remove this attribute, it works fine. How do I rectify this problem? I'm planning to add some more attributes to the <device> tag if I can resolve this problem. FYI, I'm using IE6.

Many thanks!
:confused:
 
Back
Top