1.1 --- a/CHANGES.txt Tue Jan 27 19:27:47 2009 +1000
1.2 +++ b/CHANGES.txt Fri Aug 28 09:01:00 2009 +1000
1.3 @@ -2,6 +2,12 @@
1.4 CHANGES
1.5 =======
1.6
1.7 +0.2.4 (2009-08-28)
1.8 +------------------
1.9 +
1.10 +- added missing built-in xml-schema data types. (but no parsing of
1.11 + these new types, they are simply treated as strings or integers)
1.12 +
1.13 0.2.3 (2009-01-27)
1.14 ------------------
1.15
2.1 --- a/setup.py Tue Jan 27 19:27:47 2009 +1000
2.2 +++ b/setup.py Fri Aug 28 09:01:00 2009 +1000
2.3 @@ -34,7 +34,7 @@
2.4 return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
2.5
2.6 setup(name = 'rsl.xsd',
2.7 - version = '0.2.3',
2.8 + version = '0.2.4',
2.9 package_dir={'': 'src'},
2.10 packages = find_packages('src', exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
2.11 include_package_data = True,
3.1 --- a/src/rsl/xsd/factories.py Tue Jan 27 19:27:47 2009 +1000
3.2 +++ b/src/rsl/xsd/factories.py Fri Aug 28 09:01:00 2009 +1000
3.3 @@ -14,11 +14,11 @@
3.4 # may be used to endorse or promote products derived from this software
3.5 # without specific prior written permission.
3.6 #
3.7 -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3.8 +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3.9 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3.10 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3.11 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
3.12 -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3.13 +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3.14 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3.15 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3.16 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3.17 @@ -58,6 +58,19 @@
3.18 xsd.types["date"] = DateType("date", xsd)
3.19 # could not find following types in 2001 spec, maybe its only 1999 data type?
3.20 xsd.types["timeInstant"] = xsd.types["dateTime"]
3.21 + # TODO: the following non-derived types need to be parsed by the user,
3.22 + # would be nice to have specific implementations for these types
3.23 + # converting between default python types.
3.24 + xsd.types['time'] = AnySimpleType('time', xsd)
3.25 + xsd.types["duration"] = AnySimpleType('duration', xsd)
3.26 + xsd.types['gYearMonth'] = AnySimpleType('gYearMonth', xsd)
3.27 + xsd.types['gYear'] = AnySimpleType('gYear', xsd)
3.28 + xsd.types['gMonthDay'] = AnySimpleType('gMonthDay', xsd)
3.29 + xsd.types['gDay'] = AnySimpleType('gDay', xsd)
3.30 + xsd.types['gMonth'] = AnySimpleType('gMonth', xsd)
3.31 + xsd.types['anyURI'] = AnySimpleType('anyURI', xsd)
3.32 + xsd.types['QName'] = AnySimpleType('QName', xsd)
3.33 + xsd.types['NOTATION'] = AnySimpleType('NOTATION', xsd)
3.34 # built-in derived types:
3.35 xsd.types["short"] = IntegerType("short", xsd)
3.36 xsd.types["int"] = IntegerType("int", xsd)
3.37 @@ -65,6 +78,28 @@
3.38 xsd.types["long"] = IntegerType("long", xsd)
3.39 xsd.types["unsignedLong"] = IntegerType("unsignedLong", xsd)
3.40 xsd.types["NMTOKEN"] = AnySimpleType("NMTOKEN", xsd)
3.41 + # TODO: the following derived types need to be parsed by the user,
3.42 + # would be nice to have specific implementations for these types
3.43 + # converting between default python types.
3.44 + xsd.types["normalizedString"] = AnySimpleType("normalizedString", xsd)
3.45 + xsd.types["token"] = AnySimpleType("token", xsd)
3.46 + xsd.types["language"] = AnySimpleType("language", xsd)
3.47 + xsd.types["NMTOKENS"] = AnySimpleType("NMTOKENS", xsd)
3.48 + xsd.types["Name"] = AnySimpleType("Name", xsd)
3.49 + xsd.types["NCName"] = AnySimpleType("NCName", xsd)
3.50 + xsd.types["ID"] = AnySimpleType("ID", xsd)
3.51 + xsd.types["IDREF"] = AnySimpleType("IDREF", xsd)
3.52 + xsd.types["IDREFS"] = AnySimpleType("IDREFS", xsd)
3.53 + xsd.types["ENTITY"] = AnySimpleType("ENTITY", xsd)
3.54 + xsd.types["ENTITIES"] = AnySimpleType("ENTITIES", xsd)
3.55 + xsd.types["nonPositiveInteger"] = IntegerType("nonPositiveInteger", xsd)
3.56 + xsd.types["negativeInteger"] = IntegerType("negativeInteger", xsd)
3.57 + xsd.types["byte"] = IntegerType("byte", xsd)
3.58 + xsd.types["nonNegativeInteger"] = IntegerType("nonNegativeInteger", xsd)
3.59 + xsd.types["unsignedInt"] = IntegerType("unsignedInt", xsd)
3.60 + xsd.types["unsignedShort"] = IntegerType("unsignedShort", xsd)
3.61 + xsd.types["unsignedByte"] = IntegerType("unsignedByte", xsd)
3.62 + xsd.types["positiveInteger"] = IntegerType("positiveInteger", xsd)
3.63 return xsd
3.64 directlyProvides(createXSD01Schema, ISchemaFactory)
3.65
3.66 @@ -87,6 +122,19 @@
3.67 xsd.types["date"] = DateType("date", xsd)
3.68 # could not find following types in 2001 spec, maybe its only 1999 data type?
3.69 xsd.types["timeInstant"] = xsd.types["dateTime"]
3.70 + # TODO: the following non-derived types need to be parsed by the user,
3.71 + # would be nice to have specific implementations for these types
3.72 + # converting between default python types.
3.73 + xsd.types['time'] = AnySimpleType('time', xsd)
3.74 + xsd.types["duration"] = AnySimpleType('duration', xsd)
3.75 + xsd.types['gYearMonth'] = AnySimpleType('gYearMonth', xsd)
3.76 + xsd.types['gYear'] = AnySimpleType('gYear', xsd)
3.77 + xsd.types['gMonthDay'] = AnySimpleType('gMonthDay', xsd)
3.78 + xsd.types['gDay'] = AnySimpleType('gDay', xsd)
3.79 + xsd.types['gMonth'] = AnySimpleType('gMonth', xsd)
3.80 + xsd.types['anyURI'] = AnySimpleType('anyURI', xsd)
3.81 + xsd.types['QName'] = AnySimpleType('QName', xsd)
3.82 + xsd.types['NOTATION'] = AnySimpleType('NOTATION', xsd)
3.83 # built-in derived types:
3.84 xsd.types["short"] = IntegerType("short", xsd)
3.85 xsd.types["int"] = IntegerType("int", xsd)
3.86 @@ -94,9 +142,31 @@
3.87 xsd.types["long"] = IntegerType("long", xsd)
3.88 xsd.types["unsignedLong"] = IntegerType("unsignedLong", xsd)
3.89 xsd.types["NMTOKEN"] = AnySimpleType("NMTOKEN", xsd)
3.90 + # TODO: the following derived types need to be parsed by the user,
3.91 + # would be nice to have specific implementations for these types
3.92 + # converting between default python types.
3.93 + xsd.types["normalizedString"] = AnySimpleType("normalizedString", xsd)
3.94 + xsd.types["token"] = AnySimpleType("token", xsd)
3.95 + xsd.types["language"] = AnySimpleType("language", xsd)
3.96 + xsd.types["NMTOKENS"] = AnySimpleType("NMTOKENS", xsd)
3.97 + xsd.types["Name"] = AnySimpleType("Name", xsd)
3.98 + xsd.types["NCName"] = AnySimpleType("NCName", xsd)
3.99 + xsd.types["ID"] = AnySimpleType("ID", xsd)
3.100 + xsd.types["IDREF"] = AnySimpleType("IDREF", xsd)
3.101 + xsd.types["IDREFS"] = AnySimpleType("IDREFS", xsd)
3.102 + xsd.types["ENTITY"] = AnySimpleType("ENTITY", xsd)
3.103 + xsd.types["ENTITIES"] = AnySimpleType("ENTITIES", xsd)
3.104 + xsd.types["nonPositiveInteger"] = IntegerType("nonPositiveInteger", xsd)
3.105 + xsd.types["negativeInteger"] = IntegerType("negativeInteger", xsd)
3.106 + xsd.types["byte"] = IntegerType("byte", xsd)
3.107 + xsd.types["nonNegativeInteger"] = IntegerType("nonNegativeInteger", xsd)
3.108 + xsd.types["unsignedInt"] = IntegerType("unsignedInt", xsd)
3.109 + xsd.types["unsignedShort"] = IntegerType("unsignedShort", xsd)
3.110 + xsd.types["unsignedByte"] = IntegerType("unsignedByte", xsd)
3.111 + xsd.types["positiveInteger"] = IntegerType("positiveInteger", xsd)
3.112 return xsd
3.113 directlyProvides(createXSD99Schema, ISchemaFactory)
3.114 -
3.115 +
3.116 def loadXMLSchema(schemaparent):
3.117 xmlschema = resource_stream(__name__, 'xsds/xml.xsd')
3.118 schema = XMLSchema(schemaparent)