views:

304

answers:

1

<xsl:template match="element[child]">
The above works. What is the real syntax for the following pseudo-syntax? :
<xsl:template match="element[child1 AND child2]">

In the place on AND:

  • and doesn't work
  • & doesn't work
  • , doesn't work

What is it?

Thanks.

+2  A: 

Try

element[child1][child2]

From Michael Kay's latest XSLT/XPath 2.0 reference:

Each predicate is applied to the sequence in turn; only those items in the sequence for which the predicate is true pass through to the next stage. The final result consists of those items in the original sequence that satisfy eadh of the predicates, retaining their original order.

(Page 638)

Jim Garrison
Thanks, it worked.
Mk12
I also had to do `priority="1"` to give it precedence over `element[child1]` and `element[child2]`.
Mk12