XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Ulrik BalslevSubject: Newbie question on XSLT: function call
Author: Ulrik Balslev
Date: 07 Feb 2007 06:07 PM
Hi all
I am new to XSLT. This a really newbie question, sorry :-) . I am transforming an XML document using XSL. I want to insert date/time of the transformation into the HTML output, and have been trying to insert a call to the current-DateTime() function. In both IE7 and FireFox, the function is appearently unknown which results in an browser error, that prevents the HTML to be generated. When removing the function call output is OK. The Saxon XSLT engine does not generate this error. Is there a problem with the namespace?

Thanks for any input

/ulrik

Postnext
Ivan PedruzziSubject: Newbie question on XSLT: function call
Author: Ivan Pedruzzi
Date: 07 Feb 2007 11:19 PM
Hi Ulrik,

current-DateTime() is XSLT/XPath 2.0, IE7 and Firefox support only XSLT/XPath 1.0.

You may want to change your design and pass the current date-time as parameter.


Ivan Pedruzzi
Stylus Studio Team
http://www.stylusstudio.com/xml_download.html

Postnext
George PillsSubject: Newbie question on XSLT: function call
Author: George Pills
Date: 02 Apr 2007 06:58 AM
Hi Ivan.
I am in the same situation as Ulrik (he's probably moved on by now...). I'm a newbie who is trying to map some xml and I'd like to get the current date and time into the output xml. I cannot find any suitable functions for it in xslt, but I do see some in xQuery (tested them - they work fine). Question: I'm restricted to using xslt - what is the better approach: calling xquery from xslt (if so, how can that be done) or implementing specific extensions that provides the nescessary date-time functions (how)?

Thanks,
George P.

Postnext
(Deleted User) Subject: Newbie question on XSLT: function call
Author: (Deleted User)
Date: 02 Apr 2007 10:54 AM
Hi George,
current-dateTime is available also in XSLT, but only starting with version 2.0; so be sure to specify version="2.0" in the xsl:stylesheet element, and select Saxon 8 as processor.

Hope this helps,
Alberto

Posttop
Ivan PedruzziSubject: Newbie question on XSLT: function call
Author: Ivan Pedruzzi
Date: 02 Apr 2007 11:16 AM
George,

If you are restricted to use XSLT 1.0 it's unlikely that you will be able to call-out XQuery.

The only product I am aware of capable to mix XSLT and XQuery is Saxon 8.

I suggest to either pass the date as parameter or use a script extension.

The attached example use JScript to get the current date and works with all Microsoft XSLT processors: MSXML, XslTransform and XslCompiledTransform.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team
http://www.stylusstudio.com/xml_download.html


DocumentTodayIs.xsl

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.