Exemple #1
0
def init():
    global _dateTimeRE, _dateRE, _timeRE
    _dateTimeRE = xstime.xstime(xstime.dateTimePat).compiled_re
    _dateRE = xstime.xstime(xstime.datePat).compiled_re
    _timeRE = xstime.xstime(xstime.timePat).compiled_re
    urSimpleType = AbInitio(None)
    urSimpleType.basetype = Type.urType
    urSimpleType.rootName = urSimpleType.name = AST
    Type.urSimpleType = urSimpleType
    AbInitio.basetype = urSimpleType
    abInitioTypes.extend(
        [
            ("boolean", BooleanST),
            ("string", StringST),
            ("float", FloatST),
            ("double", DoubleST),
            ("decimal", DecimalST),
            ("pDecimal", pDecimalST),
            ("precisionDecimal", precisionDecimalST),
            ("duration", TimeDurationST),
            ("dateTime", DateTimeST),
            ("time", TimeST),
            ("date", DateST),
            ("gYearMonth", gYearMonthST),
            ("gYear", gYearST),
            ("gMonthDay", gMonthDayST),
            ("gDay", gDayST),
            ("gMonth", gMonthST),
            ("base64Binary", Base64BinaryST),
            ("hexBinary", HexBinaryST),
            ("anyURI", URIReferenceST),
            ("NOTATION", NOTATIONST),
            ("QName", QNameST),
        ]
    )
Exemple #2
0
 def convertToValue(self, s, item):
     tv = xstime.xstime(_dateRE)
     tv.install(s)
     if tv.tz is not None:
         tv.hour = tv.minute = tv.second = 0
         tv.normalize()
     tv.isDate = 1
     return tv
Exemple #3
0
 def convertToValue(self, str, item):
     tv = xstime.xstime(_timeRE)
     tv.install(str)
     tv.year = tv.month = tv.day = 1
     tv.normalize()
     return tv
Exemple #4
0
 def convertToValue(self, str, item):
     tv = xstime.xstime(_dateTimeRE)
     tv.install(str)
     tv.normalize()
     return tv