RE: [xsl] Summarising XML datasets

Subject: RE: [xsl] Summarising XML datasets
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Tue, 21 Dec 2004 10:16:13 +0200

> I have a problem formatting some XML I am receiving from a 3rd party
> application that I cannot alter.
> The application is querying a database that has a table
> called photo and a
> table called photosubject, there is a one to many
> relationship between photo
> and photosubject.


> What I want to do if possible is to render the information
> using xslt as:
> HouseID  |  House  |  Description | Subjects
> ===========================================
> 1        |  House  |  House 1     | X, Y, Z

XSLT 2.0 solution

    <xsl:for-each-group select="results/photograph" group-by="id">
          <xsl:value-of select="id"/>
          <xsl:value-of select="name"/>
          <xsl:value-of select="description"/>
          <xsl:value-of select="current-group()/subject" separator=", "/>

See <> how to achieve this using
XSLT 1.0 and the Muenchian Method.



Current Thread