用xsl怎样把xml里的数据加到一个文本框里呢
北一 2007-11-02 05:39:15 我的xml为
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type='text/xsl'?>
<shop>
<book>
<type>科幻</type>
<title>海底两万里</title>
<author>凡尔纳</author>
<price>30.00</price>
</book>
<shop>
xsl为
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match ="shop">
<html>
<body>
<table width="100%" border="0">
<tr>
<td>种类</td>
<td>书名</td>
<td>作者</td>
<td>价格</td>
</tr>
<xsl:apply-templates select ="book"/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="book">
<tr>
<td><xsl:value-of select ="type"/></td>
<td><xsl:value-of select ="title"/></td>
<td><xsl:value-of select ="author"/></td>
<td><xsl:value-of select ="price"/></td>
</tr>
</xsl:template>
html为
<html>
<body>
<script language="javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("test.xml")
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("test.xsl")
// Transform
document.write(xml.transformNode(xsl))
</script>
sdsds
</body>
</html>
这样在html中显示的数据是直接在页面上的,因为我要编辑数据,所以需要把数据显示在文本框这样的form元素里,该怎么做呢,帮帮忙啊,很急呀!!!!