[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re: distinct moves problem
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|