Hi Peter, Indeed dates are a pain in xml and java and are a constant source of problems so I feel your pain :). Here is the general strategy we have come up when mappings dates from xml to java and back:
xsd:date -> java.sql.Date xsd:time -> java.sql.Time xsd:datetime -> java.sql.Timestamp xsd:datetime -> java.util.Date Though looking at the xml bindings they should be changes to mirror this. Thought I did this... guess not. Scheduling another task. http://jira.codehaus.org/browse/GEOT-1449 Regardless... the parser is able to convert between the types it needs so its not always a problem if they dont line up perfectly. As for taking the types generated by the jaxp generator I would agree with you. Use them as a proposal... and change as need be. As shown here sometimes the mapping between xml schema types and java types is far from perfect. And indeed this is the same strategy that I used for generating beans (with emf) from the wfs schema. The types generated out of the box were not perfect so I had to change them. -Justin Bolla Péter wrote: > Hi Justin, > > I have some time again, to work on the gpx parser, and found a problem. > There is a date field (actually there are more of them, > type="{http://www.w3.org/2001/XMLSchema}dateTime"), which the jaxp > translated to XMLGregorianCalendar attributes. The problem is, that the > XML parser returns GregorianCalendar. This raises the question, that > should I treat the jaxp generated beans as a "proposal", and adjust the > types as I need (e.g. int or double instead of BigDecimal)? Or do I have > to leave that code alone, as I can't change the XSD either? > > Thank you, > Peter > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Geotools-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > > !DSPAM:4007,46cafdb698381439371379! > -- Justin Deoliveira The Open Planning Project http://topp.openplans.org ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
