Subject: RE: [xsl] How to implement common functionality From: "Oleg Tkachenko" <ost@xxxxxxxxxxxxxxxxx> Date: Thu, 26 Jul 2001 16:50:33 +0200 |
Hello Suraiya ! What about named template like this one ? <xsl:template name="convertToDecimal"> <xsl:param name="string"/> <xsl:value-of select="format-number(substring($string,2) div 100, '00.00')"/> </xsl:template> ... <xsl:call-template name="convertToDecimal"> <xsl:with-param name="string" select="@DOLLARAMT"/> </xsl:call-template> --- Oleg Tkachenko Multiconn International > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Haque, > Suraiya > Sent: Thursday, July 26, 2001 3:35 PM > To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx' > Subject: [xsl] How to implement common functionality > > > I have to do some text formatting in multiple XSL files using the > same format. I would like to define this once in a central file > and reuse it > in the XSL files. Right now I have the formatting implemented for each > field. > > In my XML, 10.00 is specified as +000000001000 > and I format it to 10.00 by using > > <xsl:value-of > select="format-number((number(substring(@DOLLARAMT,2)))div 100, > '00.00')"/> > > I would like to define the formatting command in a central place so > that I can do something like this: > > <xsl:value-of select="convertToDecimal(@DOLLARAMT)"/> > > Is there a way to do this? Can I do this in a css file? > > Thanks, > Suraiya > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to implement common f, Daniel Newman | Thread | AW: [xsl] XSLT with XML-Spy, Mengel Andre (FV/SLM |
[xsl] copying child nodes n-level , Ram Anantha | Date | RE: [xsl] hard core xlt ;-), Oliver Becker |
Month |