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
- Subject: RE: Default values for missing elements
- From: "John Hall" <JHALL at sairgroup dot com>
- Date: Tue, 28 Nov 2000 12:47:20 +0100
- Reply-To: xsl-list at mulberrytech dot com
In response to my request for help for a faster way of outputting default values
in place of missing input elements Mike Kay suggested:
>You can try:
>concat( optional-element,
substring(default-value, boolean(optional-element)*1000000))
>but I've no idea if it's faster.
to be used instead of my current construct:
<xsl:choose>
<xsl:when test="optional-element">
<xsl:value-of select="optional-element"/>
</xsl:when>
<xsl:otherwise>default-value</xsl:otherwise>
</xsl:choose>
Thanks for the suggestion. It worked, and is a neater solution than mine, but
did not work faster (at least with Xalan 1.0)
Regards,
John
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list