Information regarding XMLGregorianCalendar
I came across the class XMLGregorianCalendar
today.
Hence can anyone answer the following questions?
- What is
XMLGregorianCalendar
? - What is the usage o开发者_高级运维f this class?
- How it is different from
GregorianCalendar
or both of them are related?
The XML Schema standard specifies very precise rules about the functionality and representation of dates in XML. Those rules don't match exactly what Javas Calendar
(or GregorianCalendar
) uses.
Therefore the XMLGregorianCalendar
class was introduced, which follows the rules specified by the XML spec.
It is for date/time datafields within XML, defined by the w3c:
Representation for W3C XML Schema 1.0 date/time datatypes. Specifically, these date/time datatypes are dateTime, time, date, gYearMonth, gMonthDay, gYear gMonth and gDay defined in the XML Namespace "http://www.w3.org/2001/XMLSchema". These datatypes are normatively defined in W3C XML Schema 1.0 Part 2, Section 3.2.7-14.
via http://download.oracle.com/javase/1.5.0/docs/api/javax/xml/datatype/XMLGregorianCalendar.html
精彩评论