Solved

remove leading zeros

Posted on 2013-06-18
3
308 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

707 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

13 Experts available now in Live!

Get 1:1 Help Now