|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping duplicate elements under one element
Uslu, Cihan Y (MED) wrote:
Hi, 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>Beware, untested. J.Pietschmann XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








