[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: transform mixing up namespaces

Subject: RE: transform mixing up namespaces
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Fri, 25 May 2001 14:45:10 +0100
mixing up names
> 
> 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.