[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Semantics of "match"


Subject: Re: [xsl] Semantics of "match"
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Mon, 3 Feb 2014 15:37:34 +0000

On 3 Feb 2014, at 14:58, Wendell Piez <wapiez@xxxxxxxxxxxxxxx> wrote:

> Hi,
>
> On Sun, Feb 2, 2014 at 10:54 PM, Graydon <graydon@xxxxxxxxx> wrote:
>> 3.0 allows more axis references in template matches than 2.0 did; 2.0 is
>> child and attribute only, 3.0 allows descendant.  (I think it allows all
>> ForwardAxis axises.)
>>
>> So
>>
>> <xsl:template match="descendant::*"/>
>>
>> is a legal match attribute value.
>>
>> Leaving any use of except or intersect or union out of it for now just
>> what does that match mean?

descendant::* matches any element that is a descendant of anything. Which is
not very useful.

But section/descendant::text()[1] matches the first descendant text node of a
section element, which starts to look quite handy.
>
>
> If this holds for 3.0 (and mind you it doesn't, quite), then
> match="following-sibling::li" would match every 'li' in your document
> except first children of their respective parents.
>

We're not allowing the sibling axes in patterns, only the complete set of
downward axes.

Michael Kay
Saxonica


Current Thread