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

Re: Beware the count method with Muenchian grouping (w

Subject: Re: Beware the count method with Muenchian grouping (was: Testing by counting or positional predicate)
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Sun, 14 Jan 2001 22:38:07 +0000
Re:  Beware the count method with Muenchian grouping (w

Daniel Bowen wrote:
...
> 
> 
> So that's why you need the same filter as used in the "match" on the key to
> be there if you do it the count way:
> <xsl:variable
>   name="primary-textures"
>   select="//Texture
>         [0=count(preceding-sibling::Texture[1])]
>         [1=count(.|key('key-texture', concat(@texture, ':', @u, ':',
> @v))[1])]"
> />
> 
> Without the filter used in the "match" on the key, the count method will
> give you the nodes that are part of a key (the first one of each unique
> combination), plus all the other nodes matched by the XPath that aren't part
> of the key.
> 
Yes. Interesting. I didn't think through the implications of having a
predicate on the match attribute of your xsl:key. 

At the risk of stating the obvious, have you tried

<xsl:key
  name="all-texture"
  match="Texture"
  use="concat(@texture, ':', @u, ':', @v)" />
<xsl:variable
  name="primary-textures"
  select="//Texture[count(. | (key('all-texture', concat(@texture, ':',
@u, ':', @v))[1]) = 1]"
  />

- I'd really be interested in the result.

Francis.

 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.