xsl-list
[Top] [All Lists]

Re: [xsl] Variable containing unique values

2008-05-21 10:28:25
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--