Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 07:51 PM
Registered User
 
Join Date: Mar 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default subtract times in XSLT

I am trying to subtract two times that are in the format 00:00:00. I see a function for just such a purpose in XPath 2.0 - subtract-times($arg1,$arg2). So far I have been using TestXSLT to make transformations or simply using TextEdit to edit, and then viewing the xml document with attached stylesheet in a browser such as Netscape 7.0.
Do these programs not support XPath 2.0? They fail when I try to use subtract-times. Is there any other way I can accomplish the subtraction?
thanks,
Nora Brown

 
Old April 19th, 2005, 03:43 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XPath 2.0 is still a working draft, and although there's an increasing number of implementations around (Saxon, Stylus Studio, XML Spy...) it will be a while before it makes it into the browsers. Perhaps it never will in the case of IE - Microsoft's enthusiasm for client-side XSLT seems to be waning.

Another point, although the Functions and Operators spec lists op:subtract-times() as if it were a function, it's actually an "internal" function, and is exposed to the user via the "-" (minus) operator.

Yet another point: the semantics of subtract-times() are hotly debated and could still change. If your time zone is New York, what would you expect as the result of 23:00:00-05:00 - 20:00:00-05:00?

Take a look at the EXSLT library (www.exslt.org) to see if there are functions there that meet your needs and are implemented on your chosen processor.



Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to subtract hours from sysdate in oracle mcmouli Oracle 4 January 7th, 2011 06:52 AM
Subtract date stealthdevil Access VBA 2 December 7th, 2007 03:58 PM
Automatically Subtract the Value deepcover1 Access 4 March 14th, 2006 08:33 AM
Can't subtract days from a date Please Help Arsi C# 1 January 6th, 2005 03:34 PM
Server times out chri74 Classic ASP Basics 4 September 17th, 2004 02:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.