Subject: [xsl] $variables with xsl:key() From: Steve <subsume@xxxxxxxxx> Date: Mon, 24 Jul 2006 13:41:48 -0400 |
Cognitive --- 26 Hearing --- 17 *type3* --- X
X = times which a disability of type=type3 appears in $vP2/Records/Record as disabPrimary
My understanding of key breaks down somewhere. If you see what I am doing wrong, please let me know.
------------------------------------------------------- XSL version = 1.0
<xsl:template match="/" > <xsl:apply-templates select="document('../../Consumer.xml')/disabilities" /> <table> <xsl:for-each select="document('../../Consumer.xml')/disabilities/option[generate-id(.)=generate-id(key('options',@type)[1])]"> <xsl:sort select="@type"/> <xsl:apply-templates mode="x" select="$vP2/Records"> <xsl:with-param name="type" select="@type" /> </xsl:apply-templates> </xsl:for-each> </table> </xsl:template>
<xsl:template match="Records" mode="x"> <xsl:param name="type" /> <tr> <td> <xsl:value-of select="$type" /> </td> <td> <xsl:value-of select="count(key('oldID',Record))" /> </td> </tr> </xsl:template>
<Records> <Record> <disabPrimary>101</disabPrimary> </Record> <Record> <disabPrimary>201</disabPrimary> </Record> <Record> <disabPrimary>151</disabPrimary> </Record>
<option oldID="413" type="Physical" name="Cancer"/> <option oldID="400" type="Cognitive" name="Cerebral Palsy"/> <option oldID="410" type="Physical" name="Chronic Fatigue Syndrome"/> <option oldID="305" type="Cognitive" name="Cognitive-Other"/>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] listing elements & sub-el, cknell | Thread | Re: [xsl] $variables with xsl:key(), Wendell Piez |
Re: [xsl] building a hierarchical c, Mukul Gandhi | Date | [xsl] forcing non breaking spaces?, Steve |
Month |