07 January 2010

XPath normalize-space() doesn't just trim !

Yes, It is true, the normalize-space function do more just trimming your text.
so:

<xsl:value-of select=" ABC DEF G " />

Will return :
"AB DEF G"
So,Its real function is "Removes leading and trailing spaces from the specified string, and replaces all internal sequences of white space with one and returns the result"
So, be-careful when using it.

3 comments:

black jack 21 online said...

thanks for the info chief!

mhewedy said...

@black jack,
You are mostly welcome :)

Anonymous said...

That's why its called normalize-space and not trim.