Subject: Re: [xsl] monotonous nbsp coding From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx> Date: Wed, 13 Nov 2002 15:06:00 -0700 |
<td> <xsl:choose> <xsl:when test="string-length() > 0"><xsl:value-of select="." /></xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </td>
This gets monotonous after a while. It would be nice if <xsl:value-of> could take an attribute which would provide a default value if the select produces an empty result!
Make a template that does just that. <xsl:template name="monotonous"> <xsl:param name="str" select="." /> <xsl:value-of select="$str" /> <xsl:if test="string-length() = 0"> <xsl:text> </xsl:text> </xsl:if> </xsl:call-template>
<td> <xsl:call-template name="monotonous" /> </td>
Greg Faron Integre Technical Publishing Co.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] monotonous nbsp coding, Vasu Chakkera | Thread | Re: [xsl] monotonous nbsp coding, Roger Glover |
Re: [xsl] monotonous nbsp coding, Joerg Heinicke | Date | [xsl] key using a number of sibling, FranklinChen |
Month |