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


> 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

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