xsl-list
[Top] [All Lists]

RE: select="if (subelement) then subelement else 'string'"

2005-02-03 01:58:46

I often write select="(pages, 0)[1]"

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Kevin Rodgers [mailto:kevin(_dot_)rodgers(_at_)ihs(_dot_)com] 
Sent: 03 February 2005 00:24
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] select="if (subelement) then subelement else 'string'"

Currently I call a template with this parameter:

    <xsl:with-param name="page-count"
       select="if (pages) then pages else '0'"/>

Is there a simpler or more efficient way to provide '0' when the
pages subelement isn't present (or 0, since the template outputs
it via xsl:value-of)?

Thanks,
-- 
Kevin Rodgers


--~------------------------------------------------------------------
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>
--~--



--~------------------------------------------------------------------
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>
--~--