|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: transform mixing up namespaces
>
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








