Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 15th, 2008, 06:34 AM
Authorized User
Join Date: Nov 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to remove numbers in XML files using xsl


I am translating xml files with xsl...

Input XML file:

<sec><title>1 Introduction</title>
<sec><title>1.1 XY Leo</title>

I want to convert output xml file like below:

Output XML file:

<sec><title>XY Leo</title>

Thanks in Advance,
S. Rajamuthukumar

Reply With Quote
  #2 (permalink)  
Old April 15th, 2008, 06:43 AM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts

Write a template for 'title' elements that removes the leading numbers e.g. with XSLT 2.0
  <xsl:template match="title">
      <xsl:value-of select="replace(., '^[\d\.]+', '')"/>
  Martin Honnen
  Microsoft MVP - XML
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove numbers from cell EricB123 Excel VBA 25 August 6th, 2014 01:55 PM
display directories and files using only xsl/xml.. eteune XSLT 1 January 2nd, 2007 07:01 PM
adding up 2 numbers in xsl umair.aziz XSLT 3 July 14th, 2006 09:24 AM
Getting data from xml and xsl files combined hema_latha7 General .NET 0 May 19th, 2006 08:27 AM
Remove letters from numbers Corey Access 7 December 18th, 2005 09:09 PM

All times are GMT -4. The time now is 09:51 PM.

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