[xsl] xpath syntax error
Subject: [xsl] xpath syntax error|
From: Ruud Grosmann <r.grosmann@xxxxxx>
Date: Wed, 17 Dec 2008 15:39:34 +0100
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)' />
Error at xsl:template on line 14 of
XTSE0340: XSLT Pattern syntax error at char 5 on line 14 in
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]'/>?