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

RE: Default values of template parameters

Subject: RE: Default values of template parameters
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 1 Aug 2006 12:58:26 +0100
RE:  Default values of template parameters
> Is there a way to pass the parameter if the tested attribute 
> exists and not pass anything, not even an empty string, if it 
> does not?

No: the only way to get the default value is to omit the xsl:with-param
entirely.

It seems you need a different mechanism here, instead of

<xsl:param name="p" select="default"/>

you want

<xsl:param name="p" select="()"/>
<xsl:variable name="p1" select="if ($p) then $p else default"/>

That's 2.0 syntax of course but the principle is the same.

Michael Kay
http://www.saxonica.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-2011 All Rights Reserved.