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

Re: Shorthand.

Subject: Re: Shorthand.
From: Steve <subsume@xxxxxxxxx>
Date: Wed, 25 Jul 2007 13:28:42 -0400
Re:  Shorthand.
No, not context. Passed manually...

On 7/25/07, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
On 7/25/07, Steve <subsume@xxxxxxxxx> wrote:
> 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>

It depends...

If x and y are selected from the current node, then you can just go:

<xsl:call-template name="a"/>

and

<xsl:template name="a">
  <a href="{@x}" .....>
    <xsl:value-of select="y"/>
  </a>
</xsl:template>

...as the current node is the same within the named template as it is
when you call the named template.

(if not then that's the correct way.)

cheers
andrew
--
http://andrewjwelch.com

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.