[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] or predicates


Subject: RE: [xsl] or predicates
From: Jarno.Elovirta@xxxxxxxxx
Date: Wed, 6 Feb 2002 17:19:02 +0200


> -----Original Message-----
> From: ext bernwardhanssen@xxxxxx [mailto:bernwardhanssen@xxxxxx]
> Sent: 06. February 2002 16:42
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] or predicates
> 
> 
> Hi
> 
> I try to put a | inside a predicate but it doesn't work.
> <xsl:apply-templates select="doc[N1='xxx' | N2='yyy']"/>
> 
> Putting | outside the predicate works. 
> <xsl:apply-templates select="doc[N1='xxx'] | doc[N2='yyy']"/>
> 
> Why is there a difference?

Because "|" is used in UnionExpr <http://www.w3.org/TR/xpath#NT-UnionExpr>, not in OrExpr <http://www.w3.org/TR/xpath#NT-OrExpr> - use "or", i.e.

<xsl:apply-templates select="doc[N1='xxx' or N2='yyy']"/>

Santtu

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread