[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: axes in XPath patterns

Subject: Re: axes in XPath patterns
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 Mar 2017 16:42:48 -0000
Re:  axes in XPath patterns
The pattern syntax in XSLT 1.0 and XSLT 2.0, for no good reason at all, allows
the "//" pseudo-operator but does not allow *explicit* use of the descendant
or descendant-or-self axes.

This is fixed in 3.0, which allows all the downward axes to be used.

Michael Kay
Saxonica

> On 1 Mar 2017, at 16:29, Birnbaum, David J djbpitt@xxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Dear XSL-list,
>
> If I9ve understood correctly, the only axes supported in an XPath pattern
> in XSLT 2.0 are the child and the attribute axes. For that reason, a
> construction like:
>
> 	<xsl:template match="paragraph/descendant::inner">
>
> should raise an error, as it does in <oXygen/>. But I was surprised to see
> that the following construction:
>
> 	<xsl:template match="paragraph//inner">
>
> does not raise an error in <oXygen/>. According to Michael Kay, p. 627,
> paragraph//inner should be equivalent to
> paragraph//descendant-or-self::node()/child::inner, so it does appear to
> use an axis other than the child or attribute axis.
>
> I don't know how to reconcile this discrepancy with the general
> prohibition against using axes other than child or attribute in an XPath
> pattern in XSLT 2.0. Shouldn't both of the patterns above raise the same
> type of error?
>
>
> Thanks,
>
> David

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.