Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Xsl:copy-of writes xmlns:xsi always - Any way to avoid this?

From: Abel Braaksma <abel.online@--------->
To:
Date: 3/5/2007 10:09:00 AM
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

way.



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

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).


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent