求助:XML导出
在技术教程里学xml可就是调不出来 大家帮忙看看cd.xml:
<?xml version="1.0" encoding="utf-8" ?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
<CD>
<TITLE>Still got the blues</TITLE>
<ARTIST>Gary More</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Virgin redords</COMPANY>
<PRICE>10.20</PRICE>
<YEAR>1990</YEAR>
</CD>
<CD>
<TITLE>Eros</TITLE>
<ARTIST>Eros Ramazzotti</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>BMG</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1997</YEAR>
</CD>
</CATALOG>
cd.hml
<head>
<title>无标题页</title>
<script for="window" event="onload">
XMLdso.XMLDocument.load("cd.xml");
</script>
<script language="JavaScript">
function movenext()
{
if (XMLdso.recordset.absoluteposition < XMLdso.recordset.recordcount)
{
XMLdso.recordset.movenext();
}
}
function moveprevious()
{
if (XMLdso.recordset.absoluteposition > 1)
{
XMLdso.recordset.moveprevious();
}
}
</script>
</head>
<body>
<object WIDTH="0" HEIGHT="0" CLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39" ID="XMLdso"></object>
<table>
<tr><td>Title:</td><td><SPAN ID="title" DATASRC=#XMLdso DATAFLD="TITLE"></SPAN></td></tr>
<tr><td>Artist:</td><td><SPAN ID="artist" DATASRC=#XMLdso DATAFLD="ARTIST"></SPAN></td></tr>
<tr><td>Year:</td><td><SPAN ID="year" DATASRC=#XMLdso DATAFLD="YEAR"></SPAN></td></tr>
<tr><td>Country:</td><td><SPAN ID="country" DATASRC=#XMLdso DATAFLD="COUNTRY"></SPAN></td></tr>
<tr><td>Company:</td><td><SPAN ID="company" DATASRC=#XMLdso DATAFLD="COMPANY"></SPAN></td></tr>
<tr><td>Price:</td><td><SPAN ID="price" DATASRC=#XMLdso DATAFLD="PRICE"></SPAN></td></tr>
</table>
<INPUT TYPE=button VALUE="上一张CD" ONCLICK="moveprevious()">
<INPUT TYPE=button VALUE="下一张CD" ONCLICK="movenext()">
</body>
</html>
<?xml version="1.0" encoding="utf-8" ?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Bob Dylan</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CD>
<TITLE>Hide your heart</TITLE>
<ARTIST>Bonnie Tylor</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>CBS Records</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1988</YEAR>
</CD>
<CD>
<TITLE>Greatest Hits</TITLE>
<ARTIST>Dolly Parton</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>RCA</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1982</YEAR>
</CD>
<CD>
<TITLE>Still got the blues</TITLE>
<ARTIST>Gary More</ARTIST>
<COUNTRY>UK</COUNTRY>
<COMPANY>Virgin redords</COMPANY>
<PRICE>10.20</PRICE>
<YEAR>1990</YEAR>
</CD>
<CD>
<TITLE>Eros</TITLE>
<ARTIST>Eros Ramazzotti</ARTIST>
<COUNTRY>EU</COUNTRY>
<COMPANY>BMG</COMPANY>
<PRICE>9.90</PRICE>
<YEAR>1997</YEAR>
</CD>
</CATALOG>
cd.hml
<head>
<title>无标题页</title>
<script for="window" event="onload">
XMLdso.XMLDocument.load("cd.xml");
</script>
<script language="JavaScript">
function movenext()
{
if (XMLdso.recordset.absoluteposition < XMLdso.recordset.recordcount)
{
XMLdso.recordset.movenext();
}
}
function moveprevious()
{
if (XMLdso.recordset.absoluteposition > 1)
{
XMLdso.recordset.moveprevious();
}
}
</script>
</head>
<body>
<object WIDTH="0" HEIGHT="0" CLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39" ID="XMLdso"></object>
<table>
<tr><td>Title:</td><td><SPAN ID="title" DATASRC=#XMLdso DATAFLD="TITLE"></SPAN></td></tr>
<tr><td>Artist:</td><td><SPAN ID="artist" DATASRC=#XMLdso DATAFLD="ARTIST"></SPAN></td></tr>
<tr><td>Year:</td><td><SPAN ID="year" DATASRC=#XMLdso DATAFLD="YEAR"></SPAN></td></tr>
<tr><td>Country:</td><td><SPAN ID="country" DATASRC=#XMLdso DATAFLD="COUNTRY"></SPAN></td></tr>
<tr><td>Company:</td><td><SPAN ID="company" DATASRC=#XMLdso DATAFLD="COMPANY"></SPAN></td></tr>
<tr><td>Price:</td><td><SPAN ID="price" DATASRC=#XMLdso DATAFLD="PRICE"></SPAN></td></tr>
</table>
<INPUT TYPE=button VALUE="上一张CD" ONCLICK="moveprevious()">
<INPUT TYPE=button VALUE="下一张CD" ONCLICK="movenext()">
</body>
</html>
[此贴子已经被作者于2007-8-21 14:43:05编辑过]