[xsl] xpath syntax error

Subject: [xsl] xpath syntax error
From: Ruud Grosmann <r.grosmann@xxxxxx>
Date: Wed, 17 Dec 2008 15:39:34 +0100
Hi group,

I was trying to find empty p or q elements in my xml (saxon 9B) with

<xsl:template match='(p|q)[count(node()) = 0]'/>

This gives me a syntax error. It seems as if the parentheses construct is disallowed anyway. If I try the following example from Martin Kay's XSLT bible (for xpath 2.0)

<xsl:template match='book/(chapter|appendix)' />

I get

Error at xsl:template on line 14 of file:/autofs/srv009bh/home/ruud/leeg.xsl:
XTSE0340: XSLT Pattern syntax error at char 5 on line 14 in {book/(chapter}:
Unexpected token in pattern, found "("

Why is that?
Do I really have to rewrite my xpath expression to

<xsl:template match='*[self::p or self::q][count(node()) = 0]'/>?

regards, Ruud

Current Thread