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

Re: xsl:copy- of and namespaces

Subject: Re: xsl:copy- of and namespaces
From: "Alessandro Bologna" <alessandro.bologna@xxxxxxxxx>
Date: Tue, 1 Apr 2008 12:35:03 -0400
Re:  xsl:copy- of and namespaces
Off topic.
This list will never cease to amaze me. 3 valid answers, with
explanations, in 9 minutes. Kudos to all.
Alessandro



On Tue, Apr 1, 2008 at 11:19 AM, Florent Georges <lists@xxxxxxxxxxxx> wrote:
> Garvin Riensche wrote:
>
>  Hi
>
>
> > Can someone please tell me how I can give elements of a
> > subtree that are copied to the output with <xsl:copy-of
> > select="."> a new namespace?
>
>  The aim of xsl:copy-of is to, well, copy its arguments.
> If I understand you right (but that's not sure), you want to
> change the namespace URI part of the name of the elements to
> copy.  So that's not excatly a copy, but a transformation:
>
>    <xsl:template match="@*|node()">
>       <xsl:copy>
>          <xsl:apply-templates select="@*|node()"/>
>       </xsl:copy>
>    </xsl:template>
>
>    <xsl:template match="*" priority="0">
>       <xsl:element name="new:{ local-name(.) }">
>          <xsl:apply-templates select="@*|node()"/>
>       </xsl:element>
>    </xsl:template>
>
>  That means: copy everything, except the element nodes, in this case
> create a new element node whose the name is the same local-name but in
> the new namespace.
>
>  Regards,
>
> --drkm
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>      _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr

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.