RE: Default values for missing elements

Subject: RE: Default values for missing elements
From: "John Hall" <JHALL@xxxxxxxxxxxxx>
Date: Tue, 28 Nov 2000 12:47:20 +0100

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


Current Thread