![]() |
#2
tottibuffon2010-07-14 09:10
|

<html>
<head>
<title>剩余库存图书</title>
</head>
<Script language='javascript'>
fuction dolast(){
var xmldoc = xmlDSO.XMLDocument;
xmlDSO.async=false;
xmldoc.load("book0.xml");
var nodes = xmlDoc.selectNodes("/books/book/need");
xmldoc.load("bookseller.xml");
var nodes1 = xmldoc.selectNodes("books/book/remain");
for each x in nodes{
for each y in nodes
y.text=(String)(parseInt((String)y.text)-parseInt((String)x.text));
}
}//存储量减去需求量并把新仓储填入的操作
</Script>
<body onload="dolast()">
<center> <p><b><font size="3">图书信息表</font></b></p>
</center>
<table datasrc="#xmlDSO" border="1" align="center" id="table2">
<thead>
<th>书名</th>
<th>类别</th>
<th>书号</th>
<th>作者</th>
<th>出版社</th>
<th>定价</th>
<th>剩余量</th>
</thead>
<tr>
<td><span DATAFLD="title"></span></td>
<td><span DATAFLD="bookcategory"></span></td>
<td><span DATAFLD="ISBN"></span></td>
<td><span DATAFLD="author"></span></td>
<td><span DATAFLD="publisher"></span></td>
<td><span DATAFLD="price"></span></td>
<td><span DATAFLD="remain"></span></td>
</tr></table>
</body>
</html>
运行的结果只有表格的表头出现,纳闷啊 <head>
<title>剩余库存图书</title>
</head>
<Script language='javascript'>
fuction dolast(){
var xmldoc = xmlDSO.XMLDocument;
xmlDSO.async=false;
xmldoc.load("book0.xml");
var nodes = xmlDoc.selectNodes("/books/book/need");
xmldoc.load("bookseller.xml");
var nodes1 = xmldoc.selectNodes("books/book/remain");
for each x in nodes{
for each y in nodes
y.text=(String)(parseInt((String)y.text)-parseInt((String)x.text));
}
}//存储量减去需求量并把新仓储填入的操作
</Script>
<body onload="dolast()">
<center> <p><b><font size="3">图书信息表</font></b></p>
</center>
<table datasrc="#xmlDSO" border="1" align="center" id="table2">
<thead>
<th>书名</th>
<th>类别</th>
<th>书号</th>
<th>作者</th>
<th>出版社</th>
<th>定价</th>
<th>剩余量</th>
</thead>
<tr>
<td><span DATAFLD="title"></span></td>
<td><span DATAFLD="bookcategory"></span></td>
<td><span DATAFLD="ISBN"></span></td>
<td><span DATAFLD="author"></span></td>
<td><span DATAFLD="publisher"></span></td>
<td><span DATAFLD="price"></span></td>
<td><span DATAFLD="remain"></span></td>
</tr></table>
</body>
</html>