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

Re: Multiple elements condition

Subject: Re: Multiple elements condition
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 31 Aug 2007 14:37:25 -0400
Re:  Multiple elements condition
Hi,

At 05:56 AM 8/31/2007, David replied to Andrew:
> I think there might be a rule here of "code the obvious"

yes actually I need the construct quite often in the day  job and what
we seem to have mostly is

foo[2] and not(foo[3])

which I think is reasonably clear and likely to be as efficient as
anything.

I agree this is preferable if only for reasons of clarity, and am glad to hear no one complain that it is unacceptably inefficient. :->


In XSLT 2.0 I'm starting to use exists(foo[2]) just since in my experience so many beginners just stumble over the nodeset-as-boolean test for existence. (And so many maintenance programmers are beginners! Tell me why that is.) So I might just excuse myself for "exists(foo[2]) and not(foo[3])", even though a beginner would probably guess what it does correctly and be wrong about why.

Of Abel's menagerie of equivalents -- all I can say is to agree with how remarkable the range of alternatives is. (As for the brain-teaser -- when would it ever select anything?)

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

Current Thread

Back To School Sale!

Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop.

Offer ends August 31, 2008.

Coupon Code
TRTY-C4JV-OFF

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-2007 All Rights Reserved.