Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 43057 invoked from network); 21 Feb 2008 12:25:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Feb 2008 12:25:57 -0000 Received: (qmail 47173 invoked by uid 500); 21 Feb 2008 12:25:51 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 47139 invoked by uid 500); 21 Feb 2008 12:25:50 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 47130 invoked by uid 99); 21 Feb 2008 12:25:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 04:25:50 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2008 12:25:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 85F52234C043 for ; Thu, 21 Feb 2008 04:25:19 -0800 (PST) Message-ID: <848523204.1203596719541.JavaMail.jira@brutus> Date: Thu, 21 Feb 2008 04:25:19 -0800 (PST) From: "Andrey Adamovich (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1386) Not full parsing of ISO8601 date/time format that may cause import of XML to fail In-Reply-To: <1767829.1202999232469.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrey Adamovich updated JCR-1386: ---------------------------------- Attachment: ImportDateHandling.patch Here is new patch. I have tried to preserve original formatting as much as possible. As to the logic I have introduced new method in ISO8601 class called relaxedParse. This method is only now used in StringValue and BufferedStringValue in order to adapt imported dates to JCR strict format. I wait your comments impatiently and it would be really good for my project if this patch would be included in some of the following jackrabbit releases (as it causes our import functionality to fail because of the fact that XML Schema has more relaxed date format definition). Any chances for that Jukka? If you see that this patch can be improved in some way, just tell me how and I will do that. > Not full parsing of ISO8601 date/time format that may cause import of XML to fail > --------------------------------------------------------------------------------- > > Key: JCR-1386 > URL: https://issues.apache.org/jira/browse/JCR-1386 > Project: Jackrabbit > Issue Type: New Feature > Components: jackrabbit-jcr-commons, xml > Affects Versions: 1.4 > Reporter: Andrey Adamovich > Priority: Minor > Attachments: ImportDateHandling.patch, ISO8601.java.patch, ISO8601Test.java > > > Currently Jackrabbit allows only strict string values for date fields. The weak point is at handling milliseconds. JR allows only strictly 3 digits, but according to ISO8601 and to XML Schema data types definition milliseconds can be any number of digits and it just defines fractional part of the second. > So, these are valid date strings which will not be validated by JackRabbit, but they are valid according to ISO8601 and also will be validated by XML Schema if selected data type is xs:dateTime: > 2008-01-01T00:00:00 > 2008-01-01T00:00:00.0 > 2008-01-01T00:00:00.00 > 2008-01-01T00:00:00.1234 > 2008-01-01T00:00:00.1111111 > Another weak point is that time part is not mandatory as well according to ISO8601, so, these dates are also valid ISO8601 and also will be validated by XML Schema if selected data type is xs:date; > 2008-01-01 > 2008-02-01 > 2008-03-01 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.