Copy all contents except current node in XSLT
I have the following XML:
<FruitBasket>
<Apple>3</Apple>
<Bannana>2</Bannana>
...
</FruitBasket>
I like to create new XML with this result:
<WhatNeeded>
<Apple>3</Apple>
<Bannana>2</Bannana>
...
</WhatNeeded>
My current XSLT is the following:
<xsl:template name="FruitBasket>
<WhatNeeded>
<xsl:copy-of select="."/>
</WhatNeeded>
</xsl:template>
But my result came to be the following:
<WhatNeeded>
<FruitBasket>
<Apple>3</Apple>
<Bannana>2</Bannana>
...
</FruitBasket>
</WhatNeeded>
Here is my question. Is there a way to copy all contents, except the current node's tag, using copy-of? I don't want to copy the <FruitBasket> tag. Beside copy-of, are there any other commands that I should use?
|