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

RE: xsl templates, Removing spurious namespace declara

Subject: RE: xsl templates, Removing spurious namespace declarations in output elements
From: "Tim Wilkins" <Tim.Wilkins@xxxxxxxxxxxxxxxx>
Date: Wed, 9 Apr 2003 13:55:45 +0100
recursecopy
I have a solution which seems to work for a simple copy:

<xsl:template name="recurseCopy">
   <xsl:choose>
     <xsl:when test="local-name()=''">
        <xsl:copy/>
     </xsl:when>
     <xsl:otherwise>
       <xsl:element name="{local-name()}" namespace="">
          <xsl:for-each select="@*">
             <xsl:attribute name="{local-name()}">
                <xsl:value-of select="current()"/>
             </xsl:attribute>
          </xsl:for-each>
          <xsl:for-each select="node()">
              <xsl:call-template name="recurseCopy"/>
          </xsl:for-each>
       </xsl:element>
     </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<xsl:template match="Point|Attribute">
   <xsl:call-template name="recurseCopy"/>
</xsl:template>

but if anyone can see any simplifications or problems with this, that would
be useful!  The <xsl:when> bit is needed for copying text nodes.



 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.