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

Re: Testing if an attribute name is in a list of names

Subject: Re: Testing if an attribute name is in a list of names
From: "Paul A. Hoadley" <paulh@xxxxxxxxxxxxxx>
Date: Fri, 20 May 2005 13:06:29 +0930
Re:  Testing if an attribute name is in a list of names
Hi Kevin,

On Thu, May 19, 2005 at 03:26:11PM +0100, Kevin Jones wrote:
> On Thursday 19 May 2005 14:08, Paul A. Hoadley wrote:
> >
> > > I suppose you could use keys for faster access, but I don't know
> > > how that would affect total transform time.
> >
> > You're right, I guess the question is "does this affect the
> > transform time?"  Even the nested for-each constructs don't seem
> > to, probably because the input is only of the order of hundreds or
> > a few thousand rows in my case.  I was just wondering whether
> > there is an idiom in XSL that is analogous to my pseudocode above.
> > I can't seem to hit on it myself.
> 
> Using key() is the easy way to get O(n). You can also solve this via
> contains() against a string built up from the attribute names with
> delimiters but that is less flexible although possibly quicker for
> some datasets, i.e.  not many attribute names to match against or
> few tests to perform.

I'll have to get my XSLT textbook out to work out a solution with
key().  I completely overlooked the contains() function, though, which
is pretty much what I was initially envisaging.


-- 
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/

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.