|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: is recursion the best way to solve this?
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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








