Subject: Re: [xsl] Grouping duplicate elements under one element From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Wed, 22 May 2002 00:37:44 +0200 |
Hi,
I have the following XML fragment, and I want to group duplicate course
elements under one course element. WHat is the best way of doing it? Cihan
It's again the old trusty spell named Muenchean grouping, just invoked three times in the last few hours.
<xsl:key name="course" match="course" use="LOCAL_CRSE_CD"/> <xsl:template match="courses"> <courses> <xsl:for-each select="course[generate-id()= generate-id(key('course',LOCAL_CRSE_CD)[1])]"> <course> <xsl:copy-of select="LOCAL_CRSE_CD"/> <xsl:for-each select="key('course',LOCAL_CRSE_CD)"> <xsl:copy-of select="*[not(self::LOCAL_CRSE_CD)]"/> </xsl:for-each> </course> </xsl:for-each> </courses> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Grouping duplicate elements u, Uslu, Cihan Y (MED) | Thread | [xsl] searching string! Need your h, normbishop1 |
[xsl] Grouping duplicate elements u, Uslu, Cihan Y (MED) | Date | Re: Rephrasing the problem [was Re:, Wendell Piez |
Month |