Solved

remove leading zeros

Posted on 2013-06-18
3
317 Views
Last Modified: 2013-06-18
I have the following input XML

<root>
      <Envelope>
            <Body>
                  <TravelRS SequenceNmbr="1">
                        <CustomerInfos>
                              <PersonName>
                                    <Extensions>
                                          <NameNumber Number="01.01"/>
                                    </Extensions>
                              </PersonName>
                        </CustomerInfos>
                  </TravelRS>
            </Body>
      </Envelope>
</root>


I have the following code
<xsl:variable name="OTSeatId" select="Envelope/Body/TravelRS/CustomerInfos/PersonName/Extensions/NameNumber/@Number" />


 I'd like to remove leading zeros, before and after decimal.
So 01.01 becomes 1.1


Please assist.
0
Comment
Question by:badtz7229
[X]
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
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 39257526
<xsl:value-of select="concat(number(substring-before($OTSeatId, '.')), '.', number(substring-after($OTSeatId, '.')))"/>

by splitting in two parts and calling the number function on each parts, the zeroes will go away
0
 

Author Closing Comment

by:badtz7229
ID: 39257588
: Gertone
thx so much. that worked.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39257596
welcome
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
Suggested Courses

617 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