xsl-list
[Top] [All Lists]

RE: [xsl] Default values of template parameters

2006-08-01 04:58:48
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>
--~--

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