Return-Path: Delivered-To: apmail-incubator-ode-commits-archive@locus.apache.org Received: (qmail 38430 invoked from network); 15 Jun 2007 18:21:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Jun 2007 18:21:03 -0000 Received: (qmail 63614 invoked by uid 500); 15 Jun 2007 18:20:57 -0000 Delivered-To: apmail-incubator-ode-commits-archive@incubator.apache.org Received: (qmail 63599 invoked by uid 500); 15 Jun 2007 18:20:57 -0000 Mailing-List: contact ode-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ode-dev@incubator.apache.org Delivered-To: mailing list ode-commits@incubator.apache.org Received: (qmail 63586 invoked by uid 99); 15 Jun 2007 18:20:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2007 11:20:57 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Jun 2007 11:20:52 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D1AFE1A981C; Fri, 15 Jun 2007 11:20:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r547753 - in /incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang: xpath10/runtime/XPath10ExpressionRuntime.java xpath20/runtime/XPath20ExpressionRuntime.java Date: Fri, 15 Jun 2007 18:20:32 -0000 To: ode-commits@incubator.apache.org From: mriou@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070615182032.D1AFE1A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mriou Date: Fri Jun 15 11:20:31 2007 New Revision: 547753 URL: http://svn.apache.org/viewvc?view=rev&rev=547753 Log: Using ISO8601DateParser instead of XMLCaldendar to fix a bug in dates XPath evaluations. Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java?view=diff&rev=547753&r1=547752&r2=547753 ============================================================================== --- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java (original) +++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java Fri Jun 15 11:20:31 2007 @@ -18,6 +18,8 @@ */ package org.apache.ode.bpel.elang.xpath10.runtime; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.ode.bpel.common.FaultException; import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression; import org.apache.ode.bpel.explang.ConfigurationException; @@ -26,10 +28,8 @@ import org.apache.ode.bpel.explang.ExpressionLanguageRuntime; import org.apache.ode.bpel.o.OExpression; import org.apache.ode.utils.DOMUtils; +import org.apache.ode.utils.ISO8601DateParser; import org.apache.ode.utils.xsd.Duration; -import org.apache.ode.utils.xsd.XMLCalendar; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.jaxen.Context; import org.jaxen.ContextSupport; import org.jaxen.JaxenException; @@ -40,7 +40,11 @@ import org.w3c.dom.Node; import org.w3c.dom.Text; -import java.util.*; +import java.util.Calendar; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * XPath 1.0 Expression Language run-time subsytem. @@ -126,9 +130,8 @@ EvaluationException { String literal = evaluateAsString(cexp, context); - try { - return new XMLCalendar(literal); + return ISO8601DateParser.parseCal(literal); } catch (Exception ex) { String errmsg = "Invalid date: " + literal; __log.error(errmsg, ex); Modified: incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java?view=diff&rev=547753&r1=547752&r2=547753 ============================================================================== --- incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java (original) +++ incubator/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java Fri Jun 15 11:20:31 2007 @@ -32,8 +32,8 @@ import org.apache.ode.bpel.explang.ExpressionLanguageRuntime; import org.apache.ode.bpel.o.OExpression; import org.apache.ode.utils.DOMUtils; +import org.apache.ode.utils.ISO8601DateParser; import org.apache.ode.utils.xsd.Duration; -import org.apache.ode.utils.xsd.XMLCalendar; import org.apache.ode.utils.xsl.XslTransformHandler; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -137,11 +137,9 @@ } public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException { - String literal = evaluateAsString(cexp, context); - try { - return new XMLCalendar(literal); + return ISO8601DateParser.parseCal(literal); } catch (Exception ex) { String errmsg = "Invalid date: " + literal; __log.error(errmsg, ex);