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 September 21st, 2006, 04:34 AM
Authorized User
 
Join Date: Jul 2006
Posts: 54
Thanks: 0
Thanked 0 Times in 0 Posts
Default Comparing dates

Does anyone know what is wrong with the following coditional sentence?

<xsl:if test="op:dateTime-greater-than( xs:dateTime('2006-09-11T16:36:00+02:00') , xs:dateTime('2006-09-11T16:35:00+02:00') ) = true">

Thanks for the help.

Tomi.

 
Old September 21st, 2006, 04:45 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Functions prefixed "op:" in the XPath 2.0 specs are not for users to call directly, they are a formal device for specifying the behaviour of operators, in this case the > operator.

Also note that the constant "true" must be written "true()", though of course you don't need to write "a > b = true()", you can just write "a > b". So your condition becomes

test="xs:dateTime('2006-09-11T16:36:00+02:00') > xs:dateTime('2006-09-11T16:35:00+02:00')"/>

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
comparing dates help. warhero XSLT 1 July 5th, 2007 09:41 AM
Comparing Dates in XSLT kwilliams XSLT 7 December 1st, 2005 08:49 PM
Comparing Dates bennybee JSP Basics 1 April 3rd, 2005 09:31 PM
Help comparing dates Dave Brown Beginning PHP 3 December 20th, 2004 04:03 PM
Comparing Dates Issue tdaustin Classic ASP Basics 2 June 2nd, 2004 06:30 PM





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