This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Re: Re: distinct moves problem
- From: Dimitre Novatchev <dnovatchev at yahoo dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 10 Jan 2002 12:10:21 -0800 (PST)
- Subject: [xsl] Re: Re: Re: distinct moves problem
- Reply-to: xsl-list at lists dot mulberrytech dot com
Ahmad J Reeves <ahmad at dcs dot qmul dot ac dot uk> wrote:
> Hi Dimitre,
>
> Many thanks for that, indeed it does give the accurate
> number of moves of each character. The only slight difficulty
> is that it also produces duplicates, e.g.
>
> Character_ID: 18815 :
> 48984
> 5050
> 293
> 293
> 293
Hi Ahmad,
I finally seem to understand the problem.
To solve it, please, replace the end of the stylesheet with the following:
<xsl:for-each select="$vUniqueCharactersSending">
<xsl:value-of select="concat('Character_ID: ',
CHARACTER_ID,
':',
$NL
)"/>
<xsl:for-each
select="/LOG/DIRECT/CHARACTER_ID
[. = current()/CHARACTER_ID]">
<xsl:if test="not(../LOCATION_ID
= ../preceding-sibling::DIRECT
[CHARACTER_ID = current()]/LOCATION_ID)">
<xsl:value-of select="concat(' ', ../LOCATION_ID, $NL)"/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Now the transformation does not produce duplicate rooms for a character.
Cheers,
Dimitre.
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list