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

RE: Problems selecting the right nodes.

Subject: RE: Problems selecting the right nodes.
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 25 Sep 2003 23:49:33 +0100
run through the xml recursive
This needs just a minor variation on Muenchian grouping. Define a key on
service/@id, and run through all the service elements, outputting the
element if (a) it is the first one with that key value (standard
Muenchian test) and (b) count(key(...)) != count(/*/branch).

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Adam van den Hoven
> Sent: 25 September 2003 17:26
> To: XSL Mailing List
> Subject:  Problems selecting the right nodes. 
> I have a nodeset or arbitrary length that contains a set of 
> tags which 
> look something like:
> <branch id="br1">
>    <service id="service1" />
>    <service id="service2" />
>    <service id="service3" />
> </branch>
> <branch id="br2">
>     <service id="service1" />
>     <service id="service4" />
> </branch>
> Now what I want is a nodeset that contains (uniquely) all the 
> services 
> that do not occur in all the branches. In this case I want 
> service 2, 3 
> and 4 but not 1
> My original solution was iffy. I ended up creating a tokenized string 
> ("Service2|Service3|Service4" in this case) which I then ran 
> through a 
> recursive named template which did a lot of substring-before and 
> substring-after. Since what I cared about are the ids, that was fine. 
> However, the input file is occasionally very large so this can take a 
> very long time. I want to find a better solution.
> If possible, I think I'd like to avoid using extension 
> functions, unless 
> there is an obvious performance boost.
> Any thoughts?
> Adam
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

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

Current Thread


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.
First Name
Last Name
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.