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

Re: [xsl] XPath shorthand


Subject: Re: [xsl] XPath shorthand
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxxxxxxx>
Date: Wed, 22 Aug 2012 15:17:13 +0100

On Wed, Aug 22, 2012 at 3:02 PM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
>>> <xsl:variable name="names" select="('m__id', 'm__name',
>>> 'm__path'....)" as="xs:string+"/>
>>>
>>> with
>>>
>>> following-sibling::*[local-name() = $names]
>>>
>>
>> Yes I didn't think of this but there are two things.
>>
>> This won't work in a template match on XSLT 1.0 and it is hiding
>> multiple comparisons under the innocent looking equality general
>> comparison which may bite on large volumes.
>
> Ok that wasn't in the reqs... I just rewrote your code snippet.  An
> xslt 1.0/2.0 alternative is:
>

until yesterday evening I didn't know it was in the reqs either. it's
another one of these stupid platforms where they have disabled imports
and are using xslt 1.0.

> <xsl:apply-templates select="following-sibling::*" mode="my-filter"/>
>
> <xsl:template match="foo | bar | baz" mode="my-filter"/>
>

Prefer keys I avoid modes unless situation mandates.


Current Thread
Keywords