[XSLT 2.0] Union operator in patterns

This was originally raised at

http://lists.w3.org/Archives/Member/w3c-xsl-wg/2003Nov/0016.html
(member-only URL)

(Note that is comment is against XSLT match patterns only, it doesn't
affect XPath or XQuery)

We currently allow the union operator in a pattern to be written either
as
"|" or as "union". I'm inclined to disallow the "union" synonym. This is
because it doesn't work with "/" as one of the operands. Writing

/ union *

gives you a parse error because "union" after "/" is interpreted as a
QName.
Unlike XPath, we don't have the opportunity to disambiguate it by
writing
(/) union *, because we don't allow parentheses in a pattern.

/ union /*

is even worse because it doesn't give you a parse error, it just matches
the
wrong nodes. 

Adding the synonym doesn't provide any extra functionality or usability
and
only introduces a potential problem.

Michael Kay

Received on Friday, 6 February 2004 05:02:47 UTC