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

RE: templates with optional paramters

Subject: RE: templates with optional paramters
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Fri, 22 Mar 2002 10:57:48 -0000
call xsl template with paramters
The only way you can determine whether a parameter was actually supplied on
the call is by testing whether the value is different from the default
value. If the caller supplied the default value, you can't tell whether it
was supplied explicitly or defaulted. For example you can define

<xsl:param name="p1" select="'## default ##'/>

and then test
<xsl:if test="$p1='## default ##'">

but you can't tell whether it has this value because the parameter wasn't
supplied, or because the caller supplied this value.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> robert.soesemann@xxxxxx
> Sent: 22 March 2002 10:10
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  templates with optional paramters
>
>
> I have an xslt template with 2 paramter. One of them must not
> be specified.
> How can I find out if one or two params where specified? Do I
> need two versions of the template with mode? Or can I check with =''?
>
> <xsl:template name="foo">
>   one mandatory paramter
>   one optional paramter
> ...do things...
> </xsl:template>
>
> One can call it by:
>
> <xsl:call-template name="foo">
>   <xsl:with-param name=="bar_mandatory" select="$whatever" />
>   <xsl:with-param name="bar_optional" select="$whatever" />
> </xsl:call-template>
>
> OR
>
> <xsl:call-template name="foo">
>   <xsl:with-param name=="bar_mandatory" select="$whatever" />
> </xsl:call-template>
>
>
> Rob
> ______________________________________________________________
> ________________
> Darf es ein bisschen mehr sein? Mehr Speicher, mehr Mail,
> mehr Erlebnis,
> mehr Leistung, mehr Prämie unter http://club.web.de/?mc=021102
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.