RE: [xsl] XML merge

Subject: RE: [xsl] XML merge
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 14 May 2003 12:16:04 +0300

> So I have an XML, which contains many same nodes:
> <TABLE_NAME>ConnectionTemp</TABLE_NAME>, and each of them have a
> <COLUMN_NAME>, which are different.
> I'd like make a new XML file from this above, which contains the
> TABLE_NAME node only one for every value of this, and the 
> children of this
> are the COLUMN_NAME nodes. Like this:

Your's is a grouping problem--see Jeni's pages <>.

  <xsl:key name="name" match="Table" use="TABLE_NAME" />  
  <xsl:template match="Tables">    
      <xsl:for-each select="Table[generate-id(.) = generate-id(key('name', TABLE_NAME))]">        
        <Table name="{TABLE_NAME}">          
          <xsl:for-each select="key('name', TABLE_NAME)">            
            <Column name="{COLUMN_NAME}"/>          


Jarno - Covenant: Speed (Live)

 XSL-List info and archive:

Current Thread