请问一个。net取xm里面数据的问题!!在线等候。。。
我建了一个。net application 并添加了一个new item(xml文件)用保存了信息的;另外添加了一个(xslt文件),用它来转换xml输出形式!
现在我想在aspx页面里面把符合某个条件的信息从xml中输出来,我想分别在客户端和服务器端去实现,那这两种情况下的代码该怎么写呢??
下面是xml和xslt两个文件的代码:
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="books.xsl" ?>
<books>
<book>
<isbn>001</isbn>
<title>The Autobiography of Benjamin Franklin</title>
<author>
<first-name>Benjamin</first-name>
<last-name>Franklin</last-name>
</author>
<price>8.99</price>
</book>
<book>
<isbn>002</isbn>
<title>The Confidence Man</title>
<author>
<first-name>Herman</first-name>
<last-name>Melville</last-name>
</author>
<price>11.99</price>
</book>
<book>
<isbn>003</isbn>
<title>The Gorgias</title>
<author>
<name>Plato</name>
</author>
<price>9.99</price>
</book>
</books>
————————————————————————————————————
<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<table border="2" bgcolor="yellow">
<tr>
<th>isbn</th>
<th>title</th>
<th>author</th>
<th>price</th>
</tr>
<xsl:for-each select="books/book">
<tr>
<td><xslt:value-of select="isbn" /></td>
<td><xslt:value-of select="title" /></td>
<td><xslt:value-of select="author" /></td>
<td><xslt:value-of select="price" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</stylesheet>