0
我遇到了本地存儲的.xml和.xls文件的問題。爲什麼XML不能識別XSL並獲得空白頁?
我的XML文件是:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="statement.xsl" ?>
<STATEMENT_3>
<SENTENCE>
<MENTAL>In my mind there are things I remember and things that are confused </MENTAL>
</SENTENCE>
<SENTENCE>
<MATTERIAL>I saw him near the basketball court </MATTERIAL>
</SENTENCE>
<SENTENCE>
<MATTERIAL> I saw him at my front door </MATTERIAL>
</SENTENCE>
</STATEMENT_3>
我的.xsl文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<html xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<body style="font-family:Arial;font-size:13pt;background-color:#E8E09C">
<xsl:for-each select="STATEMENT_3/SENTENCE">
<div style="background-color:blue;color:white;padding:4px">
<span style="font-weight:bold"><xsl:value-of select="MENTAL"/> - </span>
</div>
<div style="background-color:green;color:white;padding:4px">
<span style="font-weight:bold"><xsl:value-of select="MATTERIAL"/> - </span>
</div>
</xls:for-each>
</body>
</html>
</xsl:stylesheet>
鉻給人空白頁和Firefox說,有一個錯誤:
</xls:for-each>
我搜索了很多,但找不到任何工作解決方案。
你需要部署和使用瀏覽器測試之前驗證您的XSLT。 XSLTC工具將爲您做到這一點。 'xls:for-each'錯誤會被IDE收集。 – EJP
http://stackoverflow.com/help/someone-answers –