Solved

remove leading zeros

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 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