Subject: RE: [xsl] transform mixing up namespaces From: "Michael Kay" <mhkay@xxxxxxxxxxxx> Date: Fri, 25 May 2001 14:45:10 +0100 |
> > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Unused namespaces (was RE: [xsl] tr, Gareth Sylvester-Bra | Thread | Re: [xsl] transform mixing up names, Michael Beddow |
Re: [xsl] Problem with attributes, Jeni Tennison | Date | RE: [xsl] element nodes in a string, Michael Kay |
Month |