Very sorry about that. I won’t post generic xslt/xpath questions here again. And thanks for your reply – I couldn’t find any document detailing the definition of a “pattern”.
This list is for questions about the Saxon product - questions about the XSLT language belong elsewhere, for example the xsl-list at mulberrytech.com.
But this one is very easily answered by looking at the language spec or at any tutorial or reference book. The match attribute is NOT an XPath expression, it is a "pattern", which accepts a subset of the syntax of XPath expressions.
You can achieve what you want using
match="*[not(self::Person or self::Cat)]"
or more usually, by having a higher priority template rule to match Person and Cat elements. In fact the default priorities handle it:
From: Stephen Caffo [mailto:firstname.lastname@example.org]
Sent: 05 November 2008 20:11
Subject: [saxon] template match syntax vs. select syntax
Can somebody please explain the difference between the syntax used for the match attribute in an xsl:template, and the select attribute used in xsl:apply-templates?
I can’t understand the difference – I thought they were both XPath expressions, with the same syntax. Is match defined as a predicate only? And how can one use the “except” keyword in a match pattern?
<xsl:template match="@* | node()">
<xsl:apply-templates select="@* | (node() except (mstns:Person, mstns:Cat))"/>
<!--This does not work-->
<xsl:template match="@* | (node() except (mstns:Person, mstns:Cat))">
<xsl:apply-templates select="@* | node()"/>