Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2009, 03:27 PM
Authorized User
 
Join Date: Jul 2009
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default xsl remove fwd and trailing spaces

Hi,

Can anyone let me know how to remove forward and trailing spaces for all nodes in xml.Can it be generic

<a>
<b> rrrtyy</b>
<c>kkkkk </c>
</a>

Thanks all in advance
 
Old December 7th, 2009, 04:17 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Use an XSLT identity transformation with the rule

Code:
<xsl:template match="text()">
  <xsl:value-of select="normalize-space(.)"/>
</xsl:template>
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old December 7th, 2009, 10:19 PM
Authorized User
 
Join Date: Jul 2009
Posts: 25
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks a lot kay ,you are the best





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove remove elements deep using xsl Prabeen XSLT 1 May 5th, 2009 12:55 AM
remove spaces between strings javaguy1007 XSLT 2 April 8th, 2009 03:03 AM
Remove Leading and Trailing Zeros lene_wee SQL Server 2000 3 April 1st, 2008 08:23 AM
Remove the trailing whitespace ksskumar XSLT 1 October 13th, 2006 06:23 AM
Printing leading and trailing blank spaces chakravarthy_vr Reporting Services 0 May 5th, 2006 01:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.