[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

Subject: RE: Designs for XSLT functions (Was: Re: RE: syntax sugar for call-template)
From: "Kaganovich, Yevgeniy (Eugene)" <ykaganovich@xxxxxxxxxxx>
Date: Tue, 20 Feb 2001 14:38:11 -0800
xslt call function
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.