Removing white space and ctrl chars from an element with XSLT

I have xml elements that look like

<name>Mr Jones  </name>

<name>Mr       Jones  </name>

<name>Mr  
  Jones  </name>

Is there a way in XSLT to remove the white spaces and ctrl chars so that the result always looks like
<name>Mr Jones</name>

I only wish to have 1 space between 'Mr' and 'Jones'

Thanks
MolkoAsked:
Who is Participating?
 
MolkoConnect With a Mentor Author Commented:
I ended up using the normalize-space function.

Seems to work ok
0
 
MolkoAuthor Commented:
normalize-space function.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.