Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1364

XSDateTime#getXMLGregorianCalendar() incorrectly reports no time zone as time zone "Z".

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 2.9.1
    • None
    • XML Schema API
    • None
    • Linux.

    Description

      I got an instance of XSDateTime (which you would normally get through PSVI DOM).

      I was expecting to be able to use the javax.xml.datatype.XMLGregorianCalendar.compare(XMLGregorianCalendar) to determine if dates are comparable as per the spec, but it goes wrong. This appears to be because the result of org.apache.xerces.xs.datatypes.XSDateTime.getXMLGregorianCalendar() doesn't reflect whether the time zone was actually specified.

      See http://www.w3.org/TR/xmlschema-2/#dateTime-order

      I'll attach a test case shortly.

      Attachments

        1. TestXercesXSDateTime.java
          1 kB
          Chris Simmons

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            cps@decisionsoft.com Chris Simmons
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: