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 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:
<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.
PS: I am using IE 9.0.8112.16421 and Firefox 15.0.1.
See 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…