[Home] [By Thread] [By Date] [Recent Entries]
Tempore 20:44:51, die 03/01/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit anil jacob <anujcb@xxxxxxxxx>:
I have been trying to write an xsl transfor for converting the following src xml to dest xml. No success yet, wondering if anyone of you have faced similar problem, appreciate if you could share any ideas. The problem is how to wrap the OuterTag over the InnerTag and the OuterTag can be nested. Hi, Playing around with 'xsl:apply-templates' and 'xsl:copy' can do the trick (there are plenty of other ways too) <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:template match="/Object"> <Root> <xsl:apply-templates select="*[1]"/> </Root> </xsl:template> <xsl:template match="/Object/*"> <xsl:copy/> <xsl:apply-templates select="following-sibling::Object/*[1]"/> </xsl:template> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates select="following-sibling::Object/*[1]"/> </xsl:copy> </xsl:template> </xsl:stylesheet>
|

Cart



