Solved

remove leading zeros

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
get multiple images to align right 5 44
Convert XML to excel12book 5 25
Error in page 3 46
compact pure CSS Read More Toggle 4 22
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

920 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

12 Experts available now in Live!

Get 1:1 Help Now