This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: select containing nested hard brackets?
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] select containing nested hard brackets?
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Sat, 21 Apr 2001 01:09:23 +0100
- References: <20010420234620.49655.qmail@web12606.mail.yahoo.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Has anyone used a select statement with nested hard brackets:
yes
but not
select="something/[somethingA[somethingB]]"
can't have [ after [ need
select="something/*[somethingA[somethingB]]"
actually that is the same as
select="something/*[somethingA/somethingB]"
in this case.
The former asks for all eleemnt children of something fro which the the
XPath
somethingA[somethingB] returns true (ie is non empty)
this is true if there is any somethingA for which the selection
somethingB is non empty.
That in turn is true just if somethingA/somethingB from the original
node will return a non empty node set, which leads to the second form I
give above.
To understand the nested [] forget you are inside any number of []
and just evaluate th eXpath expression as a boolean. Node set
expressions
will be coerced to boolean depending on whether the selected node set is
empty (false) or non empty (true)
so xsl:if test="a[b] and c[d[e]]"
is true if there's an a child that has a b child, and a c child that has
a d child that has an e child.
David
_____________________________________________________________________
This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list