Re: [xsl] XSL to generate required output

Subject: Re: [xsl] XSL to generate required output
From: Ragulf Pickaxe <ragulf.pickaxe@xxxxxxxxx>
Date: Mon, 12 Dec 2005 09:28:28 +0100
Hi,
>
> I need to generate the ouput as below. i.e to take hierarchy one level down
when I see ## in Cell.

http://dpawson.co.uk/xsl/sect2/flatfile.html

You need something like this (untested):

<xsl:template match="row[Cell='##']">
  <xsl:variable name="idcurrent" select="generate-id()"/>
  <New>
    <xsl:copy-of
select="following-sibling::row[not(Cell='##')][generate-id(preceding-sibling:
:row[Cell='##'])=$idcurrent]"/>
  </New>
</xsl:template>

If you need more than identity, you will have to change the copy-of to
an apply-templates and make the appropreate templates.

I hope this gets you started,
Ragulf Pickaxe :-)

Current Thread