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

RE: Date formatting using XSLT extensions functions

Subject: RE: Date formatting using XSLT extensions functions
From: "Kaine Varley" <kaine.varley@xxxxxxxxxxxxxxxxxx>
Date: Mon, 28 Apr 2003 15:04:10 +0100
xslt date functions
DaveP,

Thanks for the advice. It is looking more and more likely that I'll have
to become stricter with the initial date format being input. However, as
I mentioned, the date formats I described are all parsed and handled OK
through the VBScript Date functions, when used in ASP page or VB, so I
was hoping to access those functions through the use of an XSLT
extension function, as described below and in the original thread, since
I can, at least, guarantee the platform that it will be running on.
However, I have failed in my attempt to use the VBScript Date functions
as extensions. Any ideas?

Thanks again for the valuable input.


Kaine


(Code from original thread)
VBScript version:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:extra="urn:extra-functions">

	<msxml:script xmlns:msxml="urn:schemas-microsoft-com:xslt"
language="VBScript" implements-prefix="extra">
		Function DateFormat(InputDate)
			If IsDate(InputDate) Then
				DateFormat = Day(InputDate) & " " &
Month(InputDate)
			End If
		End Function
	</msxml:script>

	<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>



	<xsl:template name="format-date">
		<xsl:param name="date-to-format" />


		<xsl:value-of select="extra:DateFormat($date-to-format)"
/>
	</xsl:template>

</xsl:stylesheet>


 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.