FireFox没有正确显示我的XML

时间:2012-10-13 03:03:24

标签: xml firefox

我正在使用一些XML处理方法,我遇到了一个奇怪的问题,当我看到XML文件时,我看到了XML文件的两个不同视图使用IE浏览器,当我使用FireFox看到它时。当我在IE中打开文件时,我看到:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="root">
        <xsl:apply-templates select="property" />
    </xsl:template>
    <xsl:template match="property">
        <xsl:number />
        <xsl:apply-templates select="node()" />
    </xsl:template>
    <xsl:template match="node()">
        <xsl:if test="normalize-space(.)">
            <xsl:value-of select="normalize-space(.)" />
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

但是,在FireFox中,我看到了以下内容:

<xsl:stylesheet version="1.0">
    <xsl:template match="root">
        <xsl:apply-templates select="property" />
    </xsl:template>
    <xsl:template match="property">
        <xsl:number />
        <xsl:apply-templates select="node()" />
    </xsl:template>
    <xsl:template match="node()">
        <xsl:if test="normalize-space(.)">
            <xsl:value-of select="normalize-space(.)" />
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

基本上,我知道问题是FireFox未显示xmlns属性。我试图找到解决问题的方法;但没有运气。以前有人遇到过这个问题,知道怎么解决吗?感谢。

PS:我使用的是IE 9.0.8112.16421和Firefox 15.0.1。

1 个答案:

答案 0 :(得分:0)

请参阅https://bugzilla.mozilla.org/show_bug.cgi?id=175946

基本上,Firefox实际上使用XSLT来实现XML prettyprinter,而XSLT无法使用xmlns属性......