xsl-list
[Top] [All Lists]

Re: XSLT grouping without Muenchen Method

2004-08-30 19:06:15
Hi Ismael,

oops... I see my output is not entirely correct

object1;object3;Instance0;2004-08-30 15:00:00
object4;object6;Instance1;2004-08-30 15:00:00
object2;Instance0;2004-08-30 15:30:00
object5;Instance1;2004-08-30 15:30:00

You want a ',' between objects, not a ';'

Replace my <xsl:template match="object" mode="write"> with:

 <xsl:template match="object" mode="write">
  <xsl:variable name="interval" select="@interval"/>
  <xsl:variable name="instance" select="@instance"/>
  <xsl:value-of select="@name"/>
  <xsl:choose>
   <xsl:when test="following-sibling::object[(_at_)interval=$interval and 
@instance=$instance]">,</xsl:when>
   <xsl:otherwise>;</xsl:otherwise>
  </xsl:choose>
 </xsl:template>

Greetings
Anton Triest