xsl-list
[Top] [All Lists]

RE: Using normalize-space to test for characters in text nodes

2004-11-03 02:41:23
Hi,

 
thus NO-BREAK SPACE is not whitespace.

So to return the third node from the following:

  <node> </node>
  <node>&#160;</node>
  <node>test</node>

I'm going to use: 

string(translate(., ' &#160;', ''))

Any improvements, suggestions on that?  I can't think of any other
whitespace (well, apparent whitespace) characters...

You can see the Unicode Character Database and find all the characters that 
have the White_Space property 
<http://www.unicode.org/Public/UNIDATA/UCD.html#White_Space> to populate the 
list.

Cheers,

Jarno