I'm playing with some XML
processing methods and I'v had a wierd problem which is that I see two different views of my XML
file when I see my XML
file using the IE
browser and when I see it using the FireFox
. When I open the file in the IE
, I see:
我正在使用一些XML处理方法,我遇到了一个严重的问题,那就是当我看到我的XML文件使用IE浏览器时,当我看到它使用FireFox时,我看到我的XML文件有两个不同的视图。当我打开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>
However, in the FireFox
, I see the below:
然而,在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>
Basically, I know the problem is the FireFox
isn't showing the xmlns
attribute. I tried to find a way to resolve it; but had no luck. Anyone has encountered this problem before and know how to solve it? Thanks.
基本上,我知道问题是FireFox没有显示xmlns属性。我试着想办法解决它;但没有运气。有人遇到过这个问题,知道怎么解决吗?谢谢。
PS: I am using IE 9.0.8112.16421 and Firefox 15.0.1.
我使用的是IE 9.0.8112.16421和Firefox 15.0.1。
1 个解决方案
#1
0
See https://bugzilla.mozilla.org/show_bug.cgi?id=175946
参见https://bugzilla.mozilla.org/show_bug.cgi?id=175946
Basically, Firefox actually uses XSLT to implement the XML prettyprinter and XSLT can't work with xmlns attributes...
基本上,Firefox实际上使用XSLT实现XML prettyprinter,而XSLT不能处理xmlns属性……
#1
0
See https://bugzilla.mozilla.org/show_bug.cgi?id=175946
参见https://bugzilla.mozilla.org/show_bug.cgi?id=175946
Basically, Firefox actually uses XSLT to implement the XML prettyprinter and XSLT can't work with xmlns attributes...
基本上,Firefox实际上使用XSLT实现XML prettyprinter,而XSLT不能处理xmlns属性……