Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Removing white space and ctrl chars from an element with XSLT

Posted on 2010-09-16
3
384 Views
Last Modified: 2012-05-10
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
0
Comment
Question by:Molko
  • 2
3 Comments
 
LVL 92

Expert Comment

by:objects
ID: 33697220
0
 

Accepted Solution

by:
Molko earned 0 total points
ID: 33708099
I ended up using the normalize-space function.

Seems to work ok
0
 

Author Comment

by:Molko
ID: 33818225
normalize-space function.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question