xsl-list
[Top] [All Lists]

RE: [xsl] Default values of template parameters

2006-08-01 07:23:35
Thanks David & Michael

Had a feeling I was going to be out of luck with this one.  I think I'll
put my default values in my mapping file, keeps the users out of the
code.

Cheers
Julian

Julian Cox
BSI Development Engineer
Ultra Electronics Airport Systems
Web: www.ultra-as.com


-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: 01 August 2006 12:58
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] 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/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


________________________________________________________________________
"The information in this email and any attached files is confidential. It is 
intended solely for the use of the addressee. Any unauthorised disclosure or 
use is prohibited. If you are not the intended recipient of the message, please 
notify the sender immediately and do not disclose the contents to any other 
person, use it for any purpose, or store or copy the information in any medium. 
The views of the author may not necessarily reflect those of the company.
The contents of an attachment to this e-mail may contain software viruses which 
could damage your own computer system. While Ultra Electronics Limited has 
taken every reasonable precaution to minimise this risk, we cannot accept 
liability for any damage which you sustain as a result of software viruses. You 
should carry out your own virus checks before opening the attachment."

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>