0
使用ASP.NET 2.0中使用的XmlDataSource conrol转换XML我进行以下步骤在asp.net 2.0
是book.xml
<?xml version="1.0"?>
<greeting>
Hello, World!
</greeting>
data.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<xsl:apply-templates select="greeting"/>
</xsl:template>
<xsl:template match="greeting">
<h1>
<xsl:value-of select="."/>
</h1>
</xsl:template>
</xsl:stylesheet>
页码
<div>
<asp:XmlDataSource runat="server" EnableCaching="false" ID="xmlDs" DataFile="~/book.xml" TransformFile="~/data.xsl"></asp:XmlDataSource>
</div>
可悲的是没有出现在页面中,我预计输出Hello, World!
。那么这里有什么问题?
+1是我的错大声笑,谢谢 – Deeptechtons 2012-04-12 07:12:23