Solved

Removing white space and ctrl chars from an element with XSLT

Posted on 2010-09-16
3
380 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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:

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now