Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.GregorianYear.fromstring,
}, # [-][Y*]YYYY
{
'name': XSD_GYEAR_MONTH,
'python_type': (unicode_type, str, datatypes.GregorianYearMonth),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.GregorianYearMonth.fromstring,
}, # [-][Y*]YYYY-MM
# --- Datetime derived types (XSD 1.1) ---
{
'name': XSD_DATE_TIME_STAMP,
'python_type': (unicode_type, str),
'base_type': XSD_DATETIME,
'to_python': datatypes.DateTime.fromstring,
'facets': [etree_element(XSD_EXPLICIT_TIMEZONE, value='required')],
}, # [-][Y*]YYYY-MM-DD[Thh:mm:ss] with required timezone
{
'name': XSD_DAY_TIME_DURATION,
'python_type': (unicode_type, str),
'base_type': XSD_DURATION,
'to_python': datatypes.DayTimeDuration.fromstring,
}, # PnYnMnDTnHnMnS with month an year equal to 0
{
'name': XSD_YEAR_MONTH_DURATION,
'python_type': (unicode_type, str),
'base_type': XSD_DURATION,
'to_python': datatypes.YearMonthDuration.fromstring,
}, # PnYnMnDTnHnMnS with day and time equals to 0
# --- xs:error primitive type (XSD 1.1) ---
{
'to_python': datatypes.GregorianYear10.fromstring,
}, # [-][Y*]YYYY
{
'name': XSD_GYEAR_MONTH,
'python_type': (unicode_type, str, datatypes.GregorianYearMonth10),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.GregorianYearMonth10.fromstring,
}, # [-][Y*]YYYY-MM
)
XSD_11_BUILTIN_TYPES = XSD_COMMON_BUILTIN_TYPES + (
# --- Year related primitive types (year 0 allowed and mapped to 1 BCE) ---
{
'name': XSD_DATETIME,
'python_type': (unicode_type, str, datatypes.DateTime),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.DateTime.fromstring,
}, # [-][Y*]YYYY-MM-DD[Thh:mm:ss]
{
'name': XSD_DATE,
'python_type': (unicode_type, str, datatypes.Date),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],
'to_python': datatypes.Date.fromstring,
}, # [-][Y*]YYYY-MM-DD
{
'name': XSD_GYEAR,
'python_type': (unicode_type, str, datatypes.GregorianYear),
'admitted_facets': DATETIME_FACETS,
'facets': [COLLAPSE_WHITE_SPACE_ELEMENT],