xsl-list
[Top] [All Lists]

Re: XSL to generate required output

2005-12-12 01:28:28
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 :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--