[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Shorthand.

Subject: RE: Shorthand.
From: "Angela Williams" <Angela.Williams@xxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Jul 2007 11:56:27 -0500
RE:  Shorthand.
Since you are only using passed parameters and not current context, you
could turn this into a function in XSL 2.0.
(That's also one of the considerations for choosing functions over named
templates - verbosity).

(Not tested)
<xsl:function name="my:ajax-link">
  <xsl:param name="href" select="'x'"/>
  <xsl:param name="text" select="'y'"/>
  <a href="{$href}" onClick="showData('{$href}');return
false;"><xsl:value-of select="$text" /></a>

</xsl:function>

<value-of select="my:ajax-link($href, $text)"/>

I'm not very familiar with the ins and outs of 1.0 , but I don't know of
a less verbose way to call a named template in either version....


Thanks!
Angela

-----Original Message-----
From: Steve [mailto:subsume@xxxxxxxxx]
Sent: Wednesday, July 25, 2007 11:41 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Shorthand.

Hey there, I have a template for creating ajax links:

<xsl:template name="a">
	<xsl:with-param name="href" />
	<xsl:with-param name="text" />
	<a href="{$href}" onClick="showData('{$href}');return
false;"><xsl:value-of select="$text" /></a> </xsl:template>

is there some shorter way to use this (XSL 1.0) template than...

<xsl:call-template name="a">
   <xs:param name="href" select="'x'"/>
   <xs:param name="text" select="'y'"/>
</xsl:call-template>

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.