xsl-list
[Top] [All Lists]

RE: substring

2005-02-25 15:09:29
I put it like this. if RxNum is 23. it just gives 23 and transformation
does not work properly
<RxNbr>
<xsl:value-of
select='format-number(rx:RefillRenewalRequest/rx:RxInfo/@RxNum,"0000000"
)'/>
</RxNbr>

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Friday, February 25, 2005 4:18 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] substring


How can i pad an attribute value with (zeros) if the lenght 
is less that a fixed length
suppose i have
<Rx rxNum="1234"> but when transforming it should be 10 
digits with left padded 000 like
<Rx rxNum="0000001234">
but sometimes we may just get <Rx rxNum="23"/>

format-number(@rxNum, "0000000000")

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>