This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Default values for missing elements




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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]