xsl-list
[Top] [All Lists]

Re: [xsl] Grouping in match patterns

2020-07-14 11:02:13
Am 14.07.2020 um 17:33 schrieb Wendell Piez wapiez(_at_)wendellpiez(_dot_)com:
XSL-List friends,

Is there anything special I should know about a match pattern such as
"a / (b|c)" -- which gives me an error (in oXygen and running Saxon)?

<xsl:template match="a / (b | c)"/>

Wouldn't it be permitted by the grammar given at
https://www.w3.org/TR/xslt-30/#pattern-syntax? Production [11] would
seem to permit a parenthetical expression as a discrete step. Is there
something I am missing here?

It seems the spec indeed allows this.

Furthermore, Saxon-JS 2 doesn't complain: https://martin-honnen.github.io/xslt3fiddle/?xslt=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22utf-8%22%3F%3E%0D%0A%3Cxsl%3Astylesheet+xmlns%3Axsl%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2FXSL%2FTransform%22%0D%0A++version%3D%223.0%22%0D%0A++xmlns%3Axs%3D%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%22%0D%0A++exclude-result-prefixes%3D%22%23all%22%0D%0A++expand-text%3D%22yes%22%3E%0D%0A%0D%0A++%3Cxsl%3Amode+on-no-match%3D%22shallow-copy%22%2F%3E%0D%0A++%0D%0A++%0D%0A++%3Cxsl%3Atemplate+match%3D%22a+%2F+%28b+%7C+c%29%22%2F%3E%0D%0A%0D%0A%0D%0A++%3Cxsl%3Atemplate+match%3D%22%2F%22+name%3D%22xsl%3Ainitial-template%22%3E%0D%0A++++%3Cxsl%3Anext-match%2F%3E%0D%0A++++%3Cxsl%3Acomment%3ERun+with+%7Bsystem-property%28%27xsl%3Aproduct-name%27%29%7D+%7Bsystem-property%28%27xsl%3Aproduct-version%27%29%7D%3C%2Fxsl%3Acomment%3E%0D%0A++%3C%2Fxsl%3Atemplate%3E%0D%0A++%0D%0A%3C%2Fxsl%3Astylesheet%3E%0D%0A&input=%3Croot%3E%0D%0A++%3Ca%2F%3E%0D%0A++%3Ca%3E%3Ce%2F%3E%3C%2Fa%3E%0D%0A++%3Ca%3E%3Cb%2F%!
3E%3C%2Fa%3E%0D%0A++%3Ca%3E%3Cc%2F%3E%3C%2Fa%3E%0D%0A%3C%2Froot%3E%0D%0A&input-type=XML

Will need to check whether I still have that other XSLT 3 processor Exselt and what it says.

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>