[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to implement common functionality

Subject: RE: How to implement common functionality
From: "Daniel Newman" <daniel.newman@xxxxxxxxxxx>
Date: Thu, 26 Jul 2001 15:12:16 +0100
converttodecimal
Have a template in a common file.
define it at the top of your style sheet: <xsl:include
href="CommonFunctions.xsl" />

Call it using:

<xsl:call-template name="ConvertToDecimal">
	<xsl:with-param name="Number" select="@DOLLARAMT" />
</xsl:call-template>

And ConvertToDecimal will be:

<xsl:template name="ConvertToDecimal">
	<xsl:param name="Number" select="100" />
	<xsl:value-of select="format-number((number(substring($Number,2)))div 100,
'00.00')" />
</xsl:template>


-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Haque,
Suraiya
Sent: 26 July 2001 14:35
To: 'XSL-List@xxxxxxxxxxxxxxxxxxxxxx'
Subject:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.