Re: [xsl] Variable containing unique values

Subject: Re: [xsl] Variable containing unique values
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Wed, 21 May 2008 22:57:56 +0530
On Wed, May 21, 2008 at 10:28 PM, Hesselberth, Jan
>        <xsl:variable name="unique-dates">
>                <xsl:for-each
>                select
>
> ="REPORT/Rollover/RolloverForecast/summaryAccount/element[generate-id()=
> generate-id(key('e',rolloverDate)[1])]">
>                        <xsl:sort select="."/>
>                        <xsl:value-of select="." /><xsl:if
> test="position() != last()">,</xsl:if>
>                </xsl:for-each>
>        </xsl:variable>

I suspect your key definition is wrong. As per your code, it should be:

<xsl:key name="e" match="element" use="rolloverDate" />

In your code, you do:

 <xsl:value-of select="." /><xsl:if test="position() != last()">,</xsl:if>

It seems, you should do:

<xsl:value-of select="rolloverDate" /><xsl:if test="position() !=
last()">,</xsl:if>


>                        <xsl:for-each
> select="xalan:nodeset($unique-dates)">

Your code has:

<fo:table-body> ...

It seems you are displaying the unique dates in a table (or something
like that). It looks to me, you shouldn't store the dates in a
variable (with comma separation) and later iterate from the variable.
You can directly generate table contents from the source position
itself.


-- 
Regards,
Mukul Gandhi

Current Thread