• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

XMLGregorianCalender maps to xs:anySimpleType

 
Ranch Foreman
Posts: 1897
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MZ's version 5 notes, p 137, it says javax.xml.datatype.XMLGregorianCalender maps to xs:anySimpleType in a schema.
It says "It is (XMLGregorianCalender)statically mapped to xs:anySimpleType, the common schema type from which all XML schema calendar types are derived."

But why XMLGregorianCalender won't map to xs:datetime?
For me, it makes more sense to map the Calender object to datatime instead of anySimpleType.

 
Creator of Enthuware JWS+ V6
Posts: 3341
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the JAXB specifications for the reason?
 
Himai Minh
Ranch Foreman
Posts: 1897
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this site:
http://docs.oracle.com/cd/E19879-01/820-1072/ahihf/index.html
We have to annotation XMLGregorianCalender with @XmlSchemaType in order to map XMLGregorianCalender to xs:dateTime.

If we don't annotate it wit @XmlSchemaType, the schema type of the XMLGregorianCalender is not known until runtime. So, it can only be mapped to xs:anySimpleType.
This is from :http://markmail.org/message/bpplfv5ytvrtp7fp

So personally, I think it is more appropriate to annotate XMLGregorianCalender with @XmlSchemaType (name="dateTime").
I think it is not recommended not to annotate the Calendar object in Java, as it will be mapped by xs:anySimpleType.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic