开发者

Information regarding XMLGregorianCalendar

I came across the class XMLGregorianCalendar today.

I searched in Google regarding its usage but did not find any satisfying answer.

Hence can anyone answer the following questions?

  1. What is XMLGregorianCalendar?
  2. What is the usage o开发者_高级运维f this class?
  3. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜