Validating throws exception on correct xs:datetime values representing a leap
second
------------------------------------------------------------------------------------
Key: XERCESJ-1379
URL: https://issues.apache.org/jira/browse/XERCESJ-1379
Project: Xerces2-J
Issue Type: Bug
Components: JAXP (javax.xml.validation)
Affects Versions: 2.9.1
Environment: Java-SE-6u13 and u14
Reporter: Gerhard Kozuschek
W3C and ISO-8601 explicitely names and allows the value 60 for seconds, when
the datetime defines a leap second.
Xerces'
"org.apache.xerces.impl.dv.xs.AbstractDateTimeDV.validateDateTime(DateTimeData
data)" rejects such datetime values.
My test XML schema is:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element name="leapSecond" type="xs:dateTime"/>
</xs:schema>
My test XML document is:
<?xml version="1.0" encoding="UTF-8"?>
<leapSecond xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="usingLeapSecond.xsd"
>2008-12-31T23:59:60.000000Z</leapSecond>
Variants ending with "...59:60Z" or "...59:60.000Z" are also rejected.
"DocumentTracer.java" prints:
MS-WiXP>java -jar DocumentTracer.jar -v -s -f ..\src\sample_60.000000Z.xml
setDocumentLocator(locator=org.apache.xerces.parsers.abstractsaxparser$locatorpr...@19efb05)
startDocument()
startPrefixMapping(prefix="xsi",uri="http://www.w3.org/2001/XMLSchema-instance")
startElement(uri="",localName="leapSecond",qname="leapSecond",attributes={{uri="http://www.w3.org/2001/XMLSchema-instance",localName="noNamespaceSchemaLocation",qname="xsi:noNamespaceSchemaLocation",
type="CDATA",value="usingLeapSecond.xsd"}})
characters(text="2008-12-31T23:59:60.000000Z")
[Error] sample_60.000000Z.xml:4:43: cvc-datatype-valid.1.2.1:
'2008-12-31T23:59:60.000000Z' is not a valid value for 'dateTime'.
[Error] sample_60.000000Z.xml:4:43: cvc-type.3.1.3: The value
'2008-12-31T23:59:60.000000Z' of element 'leapSecond' is not valid.
endElement(uri="",localName="leapSecond",qname="leapSecond")
endPrefixMapping(prefix="xsi")
endDocument()
Leap seconds are very important for us. We are not randomely using them, but in
fact naming them in our XML documents. Therefore, this exception when
validating is a BLOCKER for us.
--
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: [email protected]
For additional commands, e-mail: [email protected]