[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: distinct moves problem

Subject: Re: Re: distinct moves problem
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 10 Jan 2002 05:25:03 -0800 (PST)
yacine 2006 yahoo.com
> 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 
>      23359 
>      23359 
>      23359 
>      23359 
>      23359 
>      23359 
>      23359 
>      293 
>      293 

Producing duplicates should not be possible with the latest solution presented.

Using the key:

>   <xsl:key name="kLocByCharacter" 
>            match="LOCATION_ID[not(. 
>                                   = 
>                                   ../preceding-sibling::DIRECT[1] 
>                                                 /LOCATION_ID) 
>                               ]" 
>            use="../CHARACTER_ID"/> 

excludes this possibility.

And the example, with which this was tested clearly showed that duplicates were
discarded.

Therefore, either:

        you didn't copy correctly the stylesheet.
or
        you're using a source xml with significantly different structure (e.g. some
DIRECT elements are not siblings.

or
        some values of LOCATION_ID contain whitespace.

In the last case the above key definition can be modified to ignore the whitespace
by using the normalize-space() function:

   <xsl:key name="kLocByCharacter" 
            match="LOCATION_ID[not(normalize-space() 
                                   = 
                                   normalize-space(../preceding-sibling::DIRECT[1]) 
                               ]" 
            use="../CHARACTER_ID"/> 



In case you send an example (the smallest and simplest possible) that reproduces the
problem) to my email address, I would be better able to determine the exact problem.

Cheers,
Dimitre Novatchev.


__________________________________________________
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.