Re: [Simple-support] Transforming XML schema xs:dateTime type
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-08-02 09:44:15
|
You need to write a Transformer to handle this as an attribute. There are examples in the tutorial and in the test cases. --- On Mon, 1/8/11, Courtney, Phil <Phi...@sr...> wrote: From: Courtney, Phil <Phi...@sr...> Subject: [Simple-support] Transforming XML schema xs:dateTime type To: sim...@li... Received: Monday, 1 August, 2011, 10:25 AM 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 -----Inline Attachment Follows----- ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos & much more. Register early & save! http://p.sf.net/sfu/rim-blackberry-1 -----Inline Attachment Follows----- _______________________________________________ Simple-support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simple-support |