[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Removing white space from XML file

Subject: Re: Removing white space from XML file
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Wed, 11 Apr 2007 20:21:49 -0500
Re:  Removing white space from XML file
Hi, Chad,

XSLT has a function to handle at least part of the problem: xsl:normalize-space.

normalize-space removes leading and trailing spaces and reduces any spaces within the value it receives to one space. So, " one two " becomes "one two".

HTH

Jay Bryant
Bryant Communication Services

----- Original Message ----- From: "Chad Chelius" <cchelius@xxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, April 11, 2007 7:25 PM
Subject: Removing white space from XML file



I am being supplied an XML file that contains white space in both the value of elements and also in the general structure of the XML file. Most often in the value of each element there are several spaces but sometimes there are other spaces as well. Is there an easy way to remove these? Also, within the value of each element, there needs to be one space instead of several. I know this can be accomplished with a find change in many programs, but it would be great if I could remove these extra spaces using an XSLT.

chad

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.