xsl-list
[Top] [All Lists]

Re: [xsl] XPath shorthand

2012-08-22 09:17:30
On Wed, Aug 22, 2012 at 3:02 PM, Andrew Welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 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.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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