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

Re: optional children

Subject: Re: optional children
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 21 Oct 2002 14:18:45 +0100
Re:  optional children
Hi Andrew,

> <xsl:if test="b and not(*[not(self::c or self::d)])">
>   <foo />
> </xsl:if>
>
> Ok so here you are using not() within a not() to exclude nodes from
> the list of excluded nodes... this doesnt work for me but I get the
> logic behind it. Does it fail because not(*[...]) will evaluate to
> false before it even gets to the predicates (because <b> must exist
> already)?? Or will the first predicate always be evaluated if there
> is one?

Sorry, I think it's because I missed self::b from the list:

  b and not(*[not(self::b or self::c or self::d)])

should work better.

Oleg's solution is neater anyway though, as long as it's unlikely that
there'll be hordes of children of a (because if there were lots of
children then doing count()s would involve a lot of node visits which
would take time).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 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.