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

Re: One nodeset, multiple branches

Subject: Re: One nodeset, multiple branches
From: Eric Vitiello <xsl-list@xxxxxxxxxxxx>
Date: Wed, 19 Dec 2001 11:55:20 -0500
multiple bra
-- Wendell Piez [Wed, 19 Dec 2001 11:30:37 -0500]:

><xsl:variable name="usergroups"
>select="user[@username='evitiello']//group/@name"/>
>Gets the @name attributes on the groups belonging to your user (you)
>into a
>variable.

>Combining these two XPaths does everything you need except de-
>duplicating
>the list. To do that, I'm afraid you'll have to iterate over the
>node-sets
>and check each node's preceding:: or following:: axis. This will get
>expensive if your data set is large.
>
>Another approach, potentially much more efficient, is to use keys
>... and
>that will let you de-duplicate as well (maybe I'll tackle that later
>if
>Jeni doesn't first ;-).

excellent.  in the past while I'd gotten to the point of adding a variable, and getting the rights for the groups in that nodeset, but I am completely stumped now on combining the two resulting sets.

>I don't think this XPath is over your head; it's just a bit hard to
>see around corners until you learn to use other features of the language
>(node-sets bound to variables; keys) as mirrors.

I try to keep the term "over-my-head" as a very time-based term.  Keeping in my head that I can do whatever I put my mind to always helps... so this is only "over-my-head" for the period of time that I am stumped on it, or finally break down and ask others for help =)

I try to never let anything be permanently over my head... If I were to do that, why even bother to learn a new language to begin with? :)

oh, and using the // moniker in the middle of the XPath is something I hadn't thought of for some reason.  it does make long XPaths much simpler.  I wonder what the actual processing time cost is.

keys on the other hand is something I've not even messed with yet.  I'll have to start reading!

maybe Jeni will pop in and explain the deduplication process!

Thanks for the help!

---
Eric Vitiello
Perceive Designs
<www.perceive.net>


 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.