[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Output a default value for an empty node


Subject: RE: [xsl] Output a default value for an empty node
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 16:57:07 +0100

> test="string-length(member_name)=0"
>
> is probably fractionally better written as
>
> test="string(member_name)"
[snip]
> Or perhaps best of all is to directly code in xpath what you
> said in English, that there is no text child (rather than
> saying the effective string value is the empty string) that would be
>
> test="not(member_name/text())"


I thought the usual answer to this kind of query was to use
normalize-space():

<xsl:if test="normalize-space(member_name)">

Has this changed or is this a different case?


Current Thread
Keywords