Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: JiBX 1.1.5
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Environment:mac osx w/ Java 1.5
-
Testcase included:yes
-
Number of attachments :
Description
according to w3c xml schema spec, date formats can be defined as 'YYYY-MM-DD-hh:mm".
When attempting to deserialize this format using the org.jibx.runtime.Utility deserializeDate method, a jibxexception is thrown upon validation.
Below is a simple testcase showing this.... I poked around the source and found that the validateDate method does not recognize this format as a valid date format.
package foo.test.jibx;
import junit.framework.TestCase;
import org.jibx.runtime.Utility;
import org.jibx.runtime.JiBXException;
import java.util.Date;
public class JibxDateFormatTest extends TestCase
{
public void testDateSerializationWithTimeZone() throws Exception
{
String dateStr = "1950-10-01-02:00";
try
catch (JiBXException ex)
{ ex.printStackTrace(); assertTrue(false); } }
}
Activity
Dennis Sosnoski
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Resolution | Won't Fix [ 2 ] | |
| Assignee | Dennis Sosnoski [ dsosnoski ] |
Dennis Sosnoski
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
The schema specification gives the dateTime format as CCYY-MM-DDThh:mm:ss, and says "The CCYY field must have at least four digits, the MM, DD, SS, hh, mm and ss fields exactly two digits each (not counting fractional seconds); leading zeroes must be used if the field would otherwise have too few digits." Your sample is missing the required seconds component.