+ -
当前位置:首页 → 问答吧 → xml与html问题

xml与html问题

时间:2011-12-06

来源:互联网

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文档里面的数据

作者: zhaopei010203   发布时间: 2011-12-06

<XML id="XMLdata" src="code7_1.xml"></XML>
XMLdata 写成 XMLDdata了,多了个D

作者: hookee   发布时间: 2011-12-07