This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]