我有一個包含xhtml片段的xsl文件。我需要刪除它們,以便它變成瀏覽器兼容。我嘗試過,但後來停止工作。這裏是原來的xsl:如何編輯此xsl文件,以便它適用於所有瀏覽器
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml">
<xsl:output omit-xml-declaration="yes" />
<xsl:template match="messages">
<html:ul>
<xsl:apply-templates select="message" />
</html:ul>
</xsl:template>
<xsl:template match="message[message]">
<html:li>message <xsl:value-of select="@emp_msg" /></html:li>
<html:ul>
<xsl:apply-templates select="message" />
</html:ul>
</xsl:template>
<xsl:template match="message">
<html:li>message <xsl:value-of select="@emp_msg" /></html:li>
<xsl:apply-templates select="message" />
</xsl:template>
</xsl:stylesheet>
我試圖刪除XHTML片段這種方式,但它停止工作&打印,「沒有風格信息」。我做了什麼錯:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" />
<xsl:template match="messages">
<ul>
<xsl:apply-templates select="message" />
</ul>
</xsl:template>
<xsl:template match="message[message]">
<li>message <xsl:value-of select="@emp_msg" /></li>
<ul>
<xsl:apply-templates select="message" />
</ul>
</xsl:template>
<xsl:template match="message">
<li>message <xsl:value-of select="@emp_msg" /></li>
<xsl:apply-templates select="message" />
</xsl:template>
</xsl:stylesheet>
這兩個我們應該考慮重複嗎? http://stackoverflow.com/questions/4335513/transforming-xml-data-to-html-using-xsl-and-php-only-printing-xml-tags-without-a – 2010-12-02 23:09:54