[Simple-support] Transforming XML schema xs:dateTime type
Brought to you by:
niallg
|
From: Courtney, P. <Phi...@sr...> - 2011-08-01 17:26:03
|
We have been using JAXB on workstations and servers to read and write
XML documents. We are now trying to use the Simple Framework to read the
same XML documents from an Android application (since JAXB is not
supported on Android).
In JAXB, a XML xs: dateTime type attribute is transformed with a
XMLGregorianCalendar class. When I try to use the XMLGregorianCalendar
class with the Simple Framework as shown below:
@Attribute(required = true)
protected XMLGregorianCalendar lastModified;
I get the following error:
Cannot use @org.simpleframework.xml.Attribute(empty=, name=,
required=true) to represent field 'lastModified' protected
javax.xml.datatype.XMLGregorianCalendar.
How can I use the Simple Framework to work with a xs:dateTime attribute?
Since this is one of the built-in types, it seems like it should be
straightforward. I tried using GregorianCalendar, but that class could
not parse the time part.
Thanks,
Phil
|