Re: [xsl] XPath function for <xsl:apply-templates/>?

Subject: Re: [xsl] XPath function for <xsl:apply-templates/>?
From: Christian Mahnke <cmahnke.sub@xxxxxxxxxxxxxx>
Date: Mon, 18 Nov 2013 15:25:58 +0100
Ive noticed the problem with the dynamic mode setting as well. Maybe these
can be points for improvement in the next version of the XSLT specification:
* dynamic mode
* function like shortcut for apply-templetes


Am 18.11.2013 um 15:19 schrieb David Carlisle <davidc@xxxxxxxxx>:

> On 18/11/2013 14:11, Christian Mahnke wrote:
>> Hi,
>> might have been asked here before but is there some XPath function that
works like <xsl:apply-templates/>?
>> This would be good for readability. Ill give you an example, currently I
do this:
>>                         <xsl:variable name="content">
>>                             <xsl:apply-templates mode="filter"/>
>>                         </xsl:variable>
>>                         <xsl:copy-of select="a18:field('place',
>> What Iam asking for would look like this:
>>                         <xsl:copy-of select="a18:field('place',
>> Any thoughts?
>> There is probably an extension for this.
>> Best,
>> Christian
> xmlns:f="data:,f"
> well making mode a parameter in general is harder as it's a compile time
constant in the normal syntax, but for a fixed mode you can doe
> <xsl:function name="f:apply-templates-filter">
>  <xsl:param name="seq"/>
>  <xsl:apply-templates mode="filter" select="$seq"/>
> </xsl:function>
>    <xsl:copy-of select="a18:field('place',
> Note you can't have an implicit default context in user defined functions so
you need to pass in the sequence node() explicitly.
> David

Current Thread