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

Re: Passing empty parameters discard parameters defaul

Subject: Re: Passing empty parameters discard parameters default value
From: Thijs Janssen <thijs.janssen@xxxxxxxxx>
Date: Wed, 16 Jun 2004 21:05:22 +0200
thijs janssen
I'm sorry, I should've tested this *before* replying ;-)  

Apparantly you cannot specify an <xsl:if> inside a call-template. The
only solution I can come up with this quickly is putting the entire
call-template call inside an <xsl:if> but thats not really a solution
if there's going to be more than one parameter.

On Wed, 16 Jun 2004 20:51:20 +0200, Thijs Janssen
<thijs.janssen@xxxxxxxxx> wrote:
> 
> Hi Michal,
> 
> The problem is that you ARE passing a parameter to mytemplate_impl. It
> might eventually be empty, but it still counts as a parameter, and
> thus no default value is used... (after all, one can imagine cases
> where passing an empty nodeset as a parameter has a semantical
> meaning)
> 
> A possible work-around is:
> 
> <xsl:template name="mytemplate">
>   <xsl:param name="p"/>
>   <xsl:call-template name="mytemplate_impl">
>     // parameter is not passed if its empty
>     <xsl:if test="$p">
>       <xsl:with-param name="p" select="$p"/>
>     </xsl:if>
>   </xsl:call-template>
> </xsl:template>
> 
> regards,
> Thijs Janssen
> 
>

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.