RE: [xsl] Make Hirachy from flat file

Subject: RE: [xsl] Make Hirachy from flat file
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 14 Oct 2003 09:20:59 +0300

> So far I have only managed to get items grouped by the 
> row/data[1] element,
> but it is the "nested" gruoping by the row/data[2] element there is
> bothering me.

Did you want something in the lines of

  <xsl:key name="maingroup" match="row" use="data[1]"/>
  <xsl:key name="prodgroup" match="row" use="concat(data[1], ' ',data[2])"/>
  <xsl:template match="test">
      <xsl:for-each select="row[generate-id() = generate-id(key('maingroup', data[1]))]">
        <xsl:variable name="main" select="data[1]"/>
        <maingroup name="{$main}">
          <xsl:for-each select="../row[generate-id() = generate-id(key('prodgroup', concat($main, ' ',data[2])))]">
            <prodgroup name="{data[2]}">
              <xsl:for-each select="key('prodgroup', concat($main, ' ',data[2]))">
                    <xsl:value-of select="data[3]"/>
                    <xsl:value-of select="data[4]"/>


Jarno - Smashing Pumpkins: Eye

 XSL-List info and archive:

Current Thread