Re: [xsl] XSLT: check if value is whitespace(s)

Subject: Re: [xsl] XSLT: check if value is whitespace(s)
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Wed, 11 Aug 2004 07:50:37 -0600
I concede to the approach suggested by David Carlisle ... use his... much more efficient :)

I definitely need Coffee. Good morning all! ;)

<M:D/>

M. David Peterson wrote:

Off the top of my head it seems the easiest would be to use the translate function within the select attribute of a variable to convert spaces into non-spaces (nothing) and then use a simple boolean test to determine what to do next if it returns false... For example...

<xsl:variable name="testWhiteSpace" select="translate(foo/bar, ' ', '')" />

<xsl:if test="$testWhiteSpace">
...do something
</xsl:if>

Untested.

Hope this helps!

<M:D/>

Ralph Holz wrote:

Hi,

is there a way to check if a given value is whitespace(s) only? A function maybe?

Thanks,
Ralph

Current Thread