Subject: Re: [xsl] Concatenate and unique values From: Geert Josten <Geert.Josten@xxxxxxxxxxx> Date: Fri, 12 Nov 2004 16:23:52 +0100 |
(top level) <xsl:key name="diseases" match="Disease" use="concat(SymptomNum, '-', Pulse, '-', HeartBeat)" />
Grtz, Geert
Hi All
SymptomNum is sequential from 0 till the number of rows of data. Each row has SymptomNum, Pulse and Heart-beat. Across all the SymptomNum, I want to find the unqiue combinations of Pulse and Heart-beat existing in the data. There may be repitions, so I want to ignore them.
<xsl:for-each select="//Health/Disease[(./SymptomNum)>=0]">
<xsl:variable name="current-sym-num" select="./SymptomNum"/>
<xsl:variable name="pulse-val" select="./Pulse"/>
<xsl:variable name="heart-beat-val" select="./HeartBeat"/>
<xsl:variable name="sym-summary" select="concat($pulse-val, ' ', $heart-beat-val)"/>
<!-- Display all unique combinations of pulse-val and heart-beat-val -->
<xsl:if test="$pulse-val and $heart-beat-val">
How do i find that this current combination of pulse-val and heart-beat-val is unique?
</xsl:if>
</xsl:for-each>
I have been using this logic to get unique values of pulse values:
<xsl:variable name="unique-pulse-num" select="//Health/Disease/Pulse[not(.=following::Pulse)]" />
<xsl:for-each select="$unique-pulse-num">
<xsl:value-of select="." />,
</xsl:for-each>
Can this logic be extended to multiple attributes of an element? Can anyone help me with this logic? Thanks in advance,
Pragyan
-- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Zoetermeer (NL)
http://www.daidalos.nl/ tel:+31-(0)79-3316961 fax:+31-(0)79-3316464
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Concatenate and unique values, pnayak | Thread | [xsl] Generating XSLT, James Cummings |
Re: [xsl] xsl and toc.hhc (was xml , Geert Josten | Date | Re: [xsl] xsl and toc.hhc (was xml , Geert Josten |
Month |