0
我有一個ASP.NET Web窗體應用程序。 我使用XSLT來形成HTML頁面。來自XSLT的數據未加載
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Footballer's XSLT Demo</title>
</head>
<body>
<h2>Footballer's Information</h2>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
我寫負載頁面上此代碼:
namespace XSLT
{
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
string MyXsltPath = Request.PhysicalApplicationPath + "1/footballers.xslt";
XslCompiledTransform XSLTransform = new XslCompiledTransform();
XSLTransform.Load(MyXsltPath);
}
}
}
但不顯示任何信息。 我該怎麼辦?
您提供一個轉換,但如果是源數據?轉換用於讀取XML並根據xslt輸出它,但您似乎缺少xml源。 – dbugger 2015-02-10 18:30:33
上一個評論者是正確的,儘管我會使用不同的措辭:XSLT通常會轉換XML輸入文檔_。另外,在我看來,你並沒有真正引用這個轉換。 – 2015-02-10 20:11:33