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

Re: duplicate removal

Subject: Re: duplicate removal
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 19 Nov 2001 12:48:37 +0000
duplicate removal
Hi Dave,

> This finds all the duplicate cat-num entries. The processing model
> doesn't however, allow me to identify if the first one has different
> bibno child to the others, which is what I need.
>
> Any suggestions for an alternative to the apply-templates above,
> which would allow me to check if each one had the same bibno child
> as the first?

Well, you could find all the rs with unique cat-nums, iterate through
them and for each of them get all the rs with that cat-num:

  <xsl:for-each select="r[cat-num and
                          generate-id() =
                          generate-id(key('multiBooks',cat-num))]">
    <xsl:sort select="cat-num" />
    <xsl:variable name="bibno" select="bibno" />
    <xsl:variable name="rs" select="key('multiBooks', cat-num)" />
    ...
  </xsl:for-each>

Then you can find those rs with the same cat-num whose bibno is not
the same as the bibno of the first one with::

  $rs[bibno != $bibno]

(Of course you might get several rs with the same bibno returned by
this, but you said you just wanted to know whether they were different
from the first one, so I guess that's what you want. Otherwise, you
need to do multiple-grouping.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • duplicate removal
    • DPawson - Thu, 15 Nov 2001 08:55:42 -0500 (EST)
      • Jeni Tennison - Mon, 19 Nov 2001 07:48:07 -0500 (EST) <=

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.