Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Adding leading zeros [Thread Next] Re: Adding leading zerosTo: NULL Date: 10/3/2005 8:00:00 PM HEM wrote: > I have a xml files that looks something like this: > <Customers> > <Customer> > <CustomerNo>123</CustomerNo> > <Balance>10.25</Balance> > </Customer> > </Customers> > > I would like to transform this into a flat file with fixed column lengths. > Positon 1-5 is customer no (5 characters) > Position 6-15 is balance. (10 characters) > The columns should have leading zeros or spaces to fill up the columns. Like > this: > 1230000010.25 (starting with 2 spaces) For the balance you could use e.g. format-number(Balance, '0000000.00') see the format-number function documentation: <http://www.w3.org/TR/xslt#function-format-number> Also see the FAQ sections <http://www.dpawson.co.uk/xsl/sect2/padding.html> and <http://www.dpawson.co.uk/xsl/sect2/N3751.html>. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
