This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: Re: distinct moves problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]