Re: [xsl] template match syntax - possible bug in MSXML XPath

Subject: Re: [xsl] template match syntax - possible bug in MSXML XPath
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Sat, 22 Sep 2001 01:09:58 -0700
At 23:20 21-09-2001, Julian Reschke wrote:
<xsl:template match="(xsl:transform|xsl:stylesheet)/@version">

1) MSXML's XSLT engine executes it, reporting no error (and printing "1.0"
when applied to an XSLT source).

2) Both Saxon and Xalan report errors when parsing the second template
(Saxon: Error in expression (xsl:transform|xsl:stylesheet)/@version:
Unexpected token
in pattern, found "(").

Now I realize that if Saxon (and Xalan) complain, they are probably right.

So:

a) Is this a conformance bug in Microsoft's implementation?

b) What's the most compact way to write the match in a syntax which is
actually allowed in XPath?

This is definitely a(nother) MSXML bug. Which version of MSXML are you using?


The XSLT grammar does not allow (expression|expression)/expression as a [1] Pattern.

Patterns can be Patterns separated by '|', which this is not, or they can be [2] LocationPathPatterns, which means they start with '/', '//', or 'id', or are [4] RelativePathPatterns. RelativePathPatterns can only be [5] StepPatterns separated by '/' or '//', and parentheses aren't allowed at the top of a StepPattern.

This is a valid XPath [14] Expr, which may explain MSXML's behavior, but it's not a valid [1] LocationPath for similar reasons to why it's not a LocationPathPattern.

-Chris
--
Christopher R. Maden, Principal Consultant, HMM Consulting Int'l, Inc.
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://www.hmmci.com/ > <URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA


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



Current Thread