XMLGregorianCalendar Information

Today I met the XMLGregorianCalendar class.
I searched on Google about its use, but did not find a satisfactory answer.

Therefore, can anyone answer the following questions?

  • What is XMLGregorianCalendar ?
  • What is the use of this class?
  • How is it different from GregorianCalendar or are both of them related?
+4
source share
2 answers

The XML Schema standard defines very precise rules about the functionality and presentation of dates in XML. These rules do not exactly match what the Javas Calendar (or GregorianCalendar ) uses.

Therefore, the XMLGregorianCalendar class was introduced, which follows the rules specified by the XML specification.

+4
source

This is the date / time data field in XML defined by w3c:

View for W3C 1.0 XML Schema date / time. In particular, these date / time data types dateTime, time, date, gYearMonth, gMonthDay, gYear gMonth and gDay are defined in the XML namespace "Http://www.w3.org/2001/XMLSchema". These data types are normative 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
source

Source: https://habr.com/ru/post/1348051/


All Articles