|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Designs for XSLT functions (Was: Re: RE: syntax su
I worked on a similar implementation for calling SQL stored procedures. To
do that I had to support mutiple output parameters as well as multiple
inputs. I think this is useful functionality to have in general...
First, using unabbreviated form and seriously pumping up xsl:call-template
syntax (I am sorry to admit that I lost track of whether the function
proposal is still being considered on top of xsl:call-template, or as a
separate entity)
<xsl:template match="*">
<xsl:bound-variable name="ret"/>
<xsl:call-function name="f">
<xsl:with-param name="input1">5</xsl:with-param>
<xsl:bind-output-variable name="output1" bound-name="r"/>
</xsl:call-function>
<xsl:value-of select="$ret"/>
</xsl:template>
<xsl:function name="f">
<xsl:param name="input1"/>
<xsl:output-variable name="output1">
<xsl:value-of select="$input1"/>
</xsl:output-variable>
</xsl:template>
I'm sure better naming conventions could be chosen, but I hope the idea is
clear.
In abbreviated form, someone suggested var := value syntax for input
parameters; I think this is a great idea, and for output parameters, var =:
bound-name makes sense...
xf:call('f', 'input1 := 5', 'ret =: output1')
For return value, in my simple case (SQL cannot return nodesets), I just
took one of the output variables and said I'll use it as return value
(another , but I don't have a preference on how to do it...
Just a thought.
- Eugene
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








