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

Re: Xsl:copy-of writes xmlns:xsi always - Any way to

Subject: Re: Xsl:copy-of writes xmlns:xsi always - Any way to avoid this?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 05 Mar 2007 11:06:44 +0100
Re:  Xsl:copy-of writes xmlns:xsi always - Any way to
binu.idicula@xxxxxxxxx wrote:
I used the following .. But the problem was that it is not copying
nested. It just copies the direct chile element nodes. If the child element has
another child, do I have to write one more for-each OR is there a simple

            <xsl:for-each select="./*">
                <xsl:element name="{name()}"
                <xsl:copy-of select="@*"/>

Once I select a particular node, all the contents (including next level
- children) should be translated to another XML. Please advice

Michael was not talking of a for-each loop, which only walks through the selected node set. He meant (and gave an example of) a modified identity template which is the generic way of processing an input tree and modify only small parts of it. Use template matches instead of for-each to achieve that effect (see Michaels original answer).

Current Thread


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.
First Name
Last Name
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.