Re: [xsl] Check for Element existence within a predicate

Subject: Re: [xsl] Check for Element existence within a predicate
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 27 Oct 2008 14:54:47 +0100
John Smith wrote:

Is it possible to check whether a node exist from within a predicate.
what I am trying to do is:

<xsl:if test="count(parent::aaa/preceding-sibling::bbb/ppp[@id = $pId
and not(exists(extraChildNode))]/zzz) &gt; count(yyy)">

So I want to count the "zzz" child elements of "ppp" but only for the
"ppp" element that does not have "extraChildNode" as a child.

As far as I can see that should work. Even doing not(extraChildNode) should suffice and have the advantage of working with XSLT 1.0.

--

	Martin Honnen
	http://JavaScript.FAQTs.com/

Current Thread