Subject: Re: [xsl] urgent..creating loops in output xml based on input xml values.. From: "Joris Gillis" <roac@xxxxxxxxxx> Date: Mon, 12 Sep 2005 11:48:14 +0200 |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/>
<xsl:template match="root"> <xsl:copy> <xsl:apply-templates select="name[.='1']"/> </xsl:copy> </xsl:template>
<xsl:template match="name"> <Loop> <xsl:copy-of select="."/> <xsl:apply-templates select="following::name[1]" mode="recursive"> <xsl:with-param name="level" select="number(.)+1"/> </xsl:apply-templates> </Loop> </xsl:template>
<xsl:template match="name" mode="recursive"> <xsl:param name="level"/> <xsl:if test="number(.)=$level"> <xsl:apply-templates select="."/> </xsl:if> <xsl:if test=". >= $level"> <xsl:apply-templates select="following::name[1]" mode="recursive"> <xsl:with-param name="level" select="$level"/> </xsl:apply-templates> </xsl:if> </xsl:template>
</xsl:s tylesheet>
regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) Laudeo W3C et dona ferens
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] urgent..creating loops in, Ragulf Pickaxe | Thread | Re: [xsl] urgent..creating loops in, omprakash . v |
[xsl] Re: 3 elements on the same li, bharathi kongara | Date | Re: [xsl] urgent..creating loops in, omprakash . v |
Month |