You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michele Vivoda (JIRA)" <xe...@xml.apache.org> on 2010/02/07 21:05:27 UTC

[jira] Commented: (XERCESJ-1418) XMLGregorianCalendarImpl should parse "24:00:00"

    [ https://issues.apache.org/jira/browse/XERCESJ-1418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12830761#action_12830761 ] 

Michele Vivoda commented on XERCESJ-1418:
-----------------------------------------

Ehm fix is wrong, add day does not consider leap years...

> XMLGregorianCalendarImpl should parse "24:00:00"
> ------------------------------------------------
>
>                 Key: XERCESJ-1418
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1418
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: JAXP (javax.xml.datatype)
>    Affects Versions: 2.9.1
>         Environment: any
>            Reporter: Michele Vivoda
>             Fix For: 2.10.0
>
>         Attachments: TestTime24.java, XMLGregorianCalendarImpl.java
>
>
> The lexical value of a xs:dateTime and a xs:time allow the
> time to be in the form "(24:00:00(\.0+)?)". In short if it is
> a xs:dateTime that lexical represents "00:00:00" of the day after
> while if is a xs:time it is the same as "00:00:00"
> References:
> http://www.w3.org/TR/xmlschema-2/#dateTime
> http://www.w3.org/TR/xmlschema11-2/#rf-lexicalMappings-datetime
> http://www.w3.org/TR/xpath-functions/#date-time-values
> Xerces reports "24:00:00" as unparsable, 
> internal.xerces (java4 & java6) parses it but then 
> the hour field is 24, that should not be correct.
> Probably related to 
> https://issues.apache.org/jira/browse/XERCESJ-683
> http://marc.info/?l=xerces-cvs&m=105578736117117&w=2
> The fix I propose is for XMLGregorianCalendarImpl.Parser#parse(), the flow is:
> -in parsing loop:
>   - possibly retain y,m,d to set them at the end
>   - possibly check if 24h is present, in case set flag and use 0 as hour.
> -at the end of loop:
>   - if 24h flag is set, check min,sec are zero
>   - if has date 
>    - Add one day if 24h flag set
>    - set date components

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org