This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: transform mixing up namespaces
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] transform mixing up namespaces
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Fri, 25 May 2001 14:45:10 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
>
> My xsl transform seems to be mixing up namespaces.
>
> I am using Xalan 1.2.
I think Xalan is getting it wrong. Saxon produces (adding indent="yes"):
<top xmlns="uri:foo">
<content xmlns="">
<next xmlns="uri:foo">bar</next>
<next xmlns="uri:foo">baz</next>
</content>
</top>
>
> Source:
>
> <?xml version="1.0"?>
> <top xmlns="uri:foo">
> <next name="bar"/>
> <next name="baz"/>
> </top>
>
> --------------------------------------------------------------
> --------------
> -
>
> First transform:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:po="uri:foo"
> version="1.0">
>
> <xsl:template match="po:next">
> <xsl:copy>
> <xsl:value-of select="@name"/>
> <xsl:apply-templates select="*"/>
> </xsl:copy>
> </xsl:template>
>
> <xsl:template match="po:top">
> <xsl:copy>
> <xsl:element name="content">
> <xsl:apply-templates select="*"/>
> </xsl:element>
> </xsl:copy>
> </xsl:template>
>
> </xsl:stylesheet>
>
> --------------------------------------------------------------
> --------------
> -
>
> Result of first transform:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <top xmlns="uri:foo">
> <content xmlns:po="uri:foo">
> <next>bar</next>
> <next>baz</next>
> </content>
> </top>
>
> --------------------------------------------------------------
> --------------
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list