This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: RE: syntax sugar for call-template
- To: "Clark C. Evans" <cce at clarkevans dot com>
- Subject: Re: [xsl] RE: syntax sugar for call-template
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Mon, 19 Feb 2001 09:16:18 +0000
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <Pine.LNX.4.21.0102182050000.19650-100000@clarkevans.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Clark,
> There are two seperate items:
>
> (a) making a way to define 'xpath' functions
> from within XSLT (thus it must be a function
> and support boolean, string, node-set, and
> number data types)
>
> (b) a less verbose call-template syntax
>
> I'm after the latter, while it appears many on this list are
> designing the former.
But the former will go some way to achieving the latter, so hopefully
make everyone more content :) Rather than:
<xsl:call-template name="func">
<xsl:with-param name="arg" select="val" />
</xsl:call-template>
or:
<xf:func arg="val" />
you will be able to do:
<xsl:copy-of select="func(val)" />
or possibly:
<xsl:copy-of select="exsl:call('func', 'arg', val)" />
Admittedly, it doesn't meet all your requirements, specifically
because it looks as though it's likely that you won't be able to call
existing templates with it - if you can call a template with a
function call then you can't call it with xsl:call-template.
I don't think anyone's objecting to you using your shorter syntax and
then doing a pre-pass on the stylesheet to create something that runs.
In XSLT 2.0 it looks as though you should be able to define your own
extension elements that will make your shorter syntax very easy to
use (see Requirement 2.10).
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list