xml与html问题
html文件
<html>
<head><title>使用表格绑定XML</title></head>
<body bgcolor="lightblue">
<XML id="XMLDdata" src="code7_1.xml"></XML>
<center><b><font size=""4>HTML表格中绑定显示XML文档内容</font></b></center>
<table datasrc="#XMLdata" border="1" cellpadding="5" align="center">
<thead>
<th>customerID</th>
<th>order_date</th>
<th>order_status</th>
<th>items</th>
</thead>
<tr>
<td><span datafld="customerID"></span></td>
<td><span datafld="order_date"></span></td>
<td><span datafld="order_status"></span></td>
<td><span datafld="items"></span></td>
</tr>
</table>
</body>
</html>
xml文件
<?xml version="1.0" encoding="gb2312" ?>
<orders>
<order>
<customerID>c05000069</customerID>
<order_date>20070103</order_date>
<order_status>pending</order_status>
<items>
<item>
<bookID>001</bookID>
<quantity>10</quantity>
<item_status>pending</item_status>
</item>
</items>
</order>
<order>
<customerID>c500701</customerID>
<order_date>2009.302</order_date>
<order_status>pending</order_status>
<items>
<item>
<bookID>002</bookID>
<quantity>30</quantity>
<item_status>pending</item_status>
</item>
<item>
<bookID>003</bookID>
<quantity>20</quantity>
<item_status>pending</item_status>
</item>
</items>
</order>
</orders>
为什么在浏览器上看不到xml文档里面的数据
[解决办法]
<XML id="XMLdata" src="code7_1.xml"></XML>
XMLdata 写成 XMLDdata了,多了个D
[解决办法]
可以啊,除了items
[解决办法]
要IE的,其他浏览器不支持数据岛
[解决办法]
检查你的XML文档的严谨性。XML文档要求非常严格的,必须成对出现