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

Re: Grouping

Subject: Re: Grouping
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Feb 2001 11:51:04 +0000
Re:  Grouping
Hi Chris,

> Many of the <item>s in my file have multiple <subject_ref> tags. I'm
> trying (with no success) to find a way to group them by
> subject_ref/@reference, but with no luck. I've gone through the
> archives, and found reference to a solution by Steve Muench
> involving the use of keys. I've (very unsuccessfully) tried to make
> the following work:
>
>          <xsl:key name="group" match="subject_ref" use="@reference"/>
>
>          [...]
>
>          <xsl:for-each 
> select="//subject_ref[generate-id(.)=generate-id(key('group', 
@reference)[1])]">>
>
>          [...]
>
> Do I have a problem because of the fact that I have more than one 
> <subject_ref > child for many of the <subjects> nodes in my xml?

The select expression that you're using:

   //subject_ref[generate-id() =
                 generate-id(key('group', @reference)[1])

looks fine for getting all the unique subject_refs in the document, so
the problem that you're experiencing is probably to do with some of
the code that you haven't included, in particular the content of the
xsl:for-each.  Remember that you're selecting subject_ref elements,
and you need to go up the tree to get from there to information about
the item itself.

If you show us more of your XSLT we might be more able to help.

Cheers,

Jeni

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



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


Current Thread
  • Grouping
    • Chris D'Iorio - Fri, 9 Feb 2001 23:06:20 -0500 (EST)
      • Jeni Tennison - Wed, 14 Feb 2001 06:52:12 -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.