Re: Incorrect output with Firefox when using xmlns attribute

Doug D <[email protected]> Mon, 17 Sep 2007 12:49:18 -0700
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization http://groups.google.com
Message-ID <[email protected]>
On Sep 16, 7:21 pm, [email protected] wrote:
> Hopefully someone can help me with this. I will use a xhtml namespace
> as an example. Lets say I have the following xml file:
>
> <?xml-stylesheet type="text/xml" href="file.xslt"?>
> <html><!-- this breaks if i add xmlns="http://www.w3.org/1999/xhtml" --
>
>   <head>
>     <title>Title</title>
>   </head>
>   <body>
>     <div>Yaddah</div>
>   </body>
> </html>
>
> and I use the following xslt file:
> <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
> version = "1.0" >
>   <xsl:output method = "text" />
>   <xsl:template match = "/" >a
>     <xsl:apply-templates/>
>   </xsl:template>
>   <xsl:template match="head">b
>     <xsl:apply-templates/>
>   </xsl:template>
>   <xsl:template match="title">c
>     Title: <xsl:value-of select="."/>
>   </xsl:template>
> </xsl:stylesheet>
>
> When I use Firefox to open the xml file it works properly when I dont
> have the xmlns attribute, but it only shows "a" on the screen when I
> do include it. This tells me that match="/" works in both cases but
> match="head" does not. Why is this?

See
XPath select statements do not match XML or XHTML with a default
namespace
http://dev.ektron.com/kb_article.aspx?id=495