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

Re: Grouping with Xt

Subject: Re: Grouping with Xt
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 14 Nov 2001 14:30:49 +0000
Re:  Grouping with Xt
Hi Brian,

> Is this going to do what I *want* it to do?  8^)
>
> Specifically, pick all the Items that have the same PartNumber as
> the current node? (see inner comments)

Yes, I think so. Since when you're processing the Items they're in
PartNumber order, you could do it slightly more efficiently (I think)
with:

  <xsl:for-each select="xt:node-set($sorted)/Items
                          [preceding-sibling::Items[1]/@PartNumber !=
                           @PartNumber]">
    <!-- this is done once per unique value -->
    ...
    <xsl:for-each select="following-sibling::Items
                            [@PartNumber = current()/@PartNumber]">
      <!-- this is done for each Items element in the group -->
      ...
    </xsl:for-each>
    ...
  </xsl:for-each>

This should be more efficient because it only checks the
immediately-preceding sibling of each Items element to see if the
Items element starts (rather than ends) a new group. Plus it only
looks at the following siblings to find other Items with the same
PartNumber value, rather than *all* the Items elements in the sorted
list.

> I'm sure I'm not the only one forced to use Xt and required to do
> grouping. :-)

Out of interest, why are you being forced to use xt?

Cheers,

Jeni

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


 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.