This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Default values for missing elements
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Default values for missing elements
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Fri, 24 Nov 2000 10:19:23 -0000
- Reply-To: xsl-list at mulberrytech dot com
> The construct I am using (in about 20 places in my transformation) is:
>
> <xsl:choose>
> <xsl:when test="optional-element"><xsl:value-of
> select="optional-element"/></xsl:when>
> <xsl:otherwise>default-value</xsl:otherwise>
> </xsl:choose>
>
> This works, but seems to run slowly. I am using Xalan 1.0.
You can try:
concat( optional-element,
substring(default-value, boolean(optional-element)*1000000))
but I've no idea if it's faster.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list