This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Include files
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Include files
- From: "Nanto, Dan" <dnanto at solant dot com>
- Date: Tue, 19 Dec 2000 11:35:57 -0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
We had a similar problem here, but we used templates to solve it, rather
than java script. The way that we got around it was to have a specific set
of templates for formatting dates, amounts etc.
<!-- This template will print out a formated date -->
<xsl:template name="formatedDate">
<xsl:param name="month"/>
<xsl:param name="day"/>
<xsl:param name="year"/>
<xsl:value-of select="$month"/> <xsl:value-of
select="$day"/>, <xsl:value-of select="$year"/>
</xsl:template>
Then we would call those templates passing in the data that needed to be
formatted.
<xsl:call-template name="formatedDate">
<xsl:with-param name="month"><xsl:value-of
select="dateMade/monthName"/></xsl:with-param>
<xsl:with-param name="day"><xsl:value-of
select="dateMade/dayOfMonth"/></xsl:with-param>
<xsl:with-param name="year"><xsl:value-of
select="dateMade/longYear"/></xsl:with-param>
</xsl:call-template>
-----Original Message-----
From: Steve Reynolds [mailto:sreynolds@matra.co.uk]
Sent: Tuesday, December 19, 2000 10:24 AM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] Include files
I have a number of XSL files that format lots of different XML documents
that contain "result sets/recordsets" from stored procedures.
The result set in the XML doc has certain formatting issues (dates, currency
symbols etc).
I want to use some Java script to format the dates, numbers etc. However, I
want to have a common file that contains the java script for all these
functions (so I have only one place to make code changes). How do I include
the java script file in my XSL files so that I can call the functions in the
java script file from the XSL file?.
Thanks
Steve
Steven Reynolds
Technical Consultant
MATRA Systems (UK) Ltd
Home Farm, Leigh Road
Eastleigh, Hants SO50 9EU
Registered in Cardiff No. 2642797
Tel: (+44) (0)2380 684 700
Fax: (+44) (0)2380 619 828
Help desk: (+44) (0)2380 684 701
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list