diff --git a/README b/README index 09731fd322c3db22e85fe2eaaf01b0695f69bcf6..3c2805e1ca61a549504486c2b0543cc87467fffb 100644 --- a/README +++ b/README @@ -155,6 +155,9 @@ Version 2.24b (01/02/2017) this. - Modified the Django support (in ./django/) so that it will run under Python 3. Thanks to Shane Rigby for reporting this problem. +- Fixed an error in encoding unicode valueOf_ for <xs:complexType + <xs:simpleContent> <xs:extension base="xs:string">. Thanks to + Andrii Iudin for catching this. Version 2.24a (11/16/2016) diff --git a/generateDS.html b/generateDS.html index b7128f5458ab23affb143987e5f16daf81811cd5..257e460dd4c4f1414e95c3e432898eb1333ead60 100644 --- a/generateDS.html +++ b/generateDS.html @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">January 05, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">January 16, 2017</td> </tr> </tbody> </table> @@ -3184,7 +3184,7 @@ following among others:</p> <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateDS.txt">View document source</a>. -Generated on: 2017-01-05 20:00 UTC. +Generated on: 2017-01-17 00:01 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/generateDS.py b/generateDS.py index 00d97cd35c1c49fb52853c4dfff74e3f45b94673..f836d1ca74e36f6bfba8617d82382375800bb00a 100755 --- a/generateDS.py +++ b/generateDS.py @@ -2867,10 +2867,8 @@ def generateExportFn(wrt, prefix, element, namespace, nameSpacesDef): if element.getSimpleContent(): wrt(" outfile.write('>')\n") if not element.isMixed(): - wrt(" outfile.write((quote_xml(self.valueOf_) " - "if type(self.valueOf_) is str else " - "self.gds_encode(str(self.valueOf_))))\n" - ) + wrt(" outfile.write(self.convert_unicode(" + "self.valueOf_))\n") else: wrt(" outfile.write('>%s' % (eol_, ))\n") wrt(" self.exportChildren(outfile, level + 1, " @@ -5334,6 +5332,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/generateds_gui_notes.html b/generateds_gui_notes.html index d95f9600eaac6f08778bfa7aee7c47c6103d3fa8..5593b50a61e34502e1b0fa39494eef95cd51c282 100644 --- a/generateds_gui_notes.html +++ b/generateds_gui_notes.html @@ -229,7 +229,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">January 05, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">January 16, 2017</td> </tr> </tbody> </table> @@ -401,7 +401,7 @@ $ mv generateds_gui.mo locale/ru/LC_MESSAGES/ <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_gui_notes.txt">View document source</a>. -Generated on: 2017-01-05 20:00 UTC. +Generated on: 2017-01-17 00:01 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/librarytemplate_howto.html b/librarytemplate_howto.html index 9fcc10e6ba0947a90cc59e6228ea2204f4176b40..47bc84a0441bff6c533b9ac6e41d4c615005092a 100644 --- a/librarytemplate_howto.html +++ b/librarytemplate_howto.html @@ -226,7 +226,7 @@ dkuhlman (at) davekuhlman (dot) org <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">January 05, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">January 16, 2017</td> </tr> </tbody> </table> @@ -380,7 +380,7 @@ this command for your needs. For example, you may need to use <div class="footer"> <hr class="footer" /> <a class="reference external" href="librarytemplate_howto.txt">View document source</a>. -Generated on: 2017-01-05 20:00 UTC. +Generated on: 2017-01-17 00:01 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/tests/OnePer/oneperType00_2One.py b/tests/OnePer/oneperType00_2One.py index 1f3eab9ffeb486240321d4d37459bc5c91862465..55efc429269260f458d0db4e700fa266fcab4498 100644 --- a/tests/OnePer/oneperType00_2One.py +++ b/tests/OnePer/oneperType00_2One.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/OnePer/oneperType01_2One.py b/tests/OnePer/oneperType01_2One.py index 3c0ff827dbc0b77bd8aaa0fc8f59ed608dc30e0f..efbcc68d3c7d168c4503e03c96c6b09c93d5c3c8 100644 --- a/tests/OnePer/oneperType01_2One.py +++ b/tests/OnePer/oneperType01_2One.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/OnePer/oneperType02_2One.py b/tests/OnePer/oneperType02_2One.py index d3cad9d74d2ebce350832ea2538bace20a4fcc17..04ac805c27db1b624ec2d72a25e0b7d9ed2a8e9f 100644 --- a/tests/OnePer/oneperType02_2One.py +++ b/tests/OnePer/oneperType02_2One.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/OnePer/oneperType03_2One.py b/tests/OnePer/oneperType03_2One.py index a1d363720e92e0814e00b33f83c148e994aee32e..2af439092f95e07bf0b78b5526e2de7d25381913 100644 --- a/tests/OnePer/oneperType03_2One.py +++ b/tests/OnePer/oneperType03_2One.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/abstract_type1_sup.py b/tests/abstract_type1_sup.py index 791999744a40a4d94e04a20603525754eb920847..47ddb5561ff62856d3ab8eb6009a0f43e4540165 100644 --- a/tests/abstract_type1_sup.py +++ b/tests/abstract_type1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/annotations1_sup.py b/tests/annotations1_sup.py index 492423d9485e752b2c21fbec97958dfe1849dd9b..d9ef298dbde1ae40ea4710df1f01f380f7122096 100644 --- a/tests/annotations1_sup.py +++ b/tests/annotations1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/anonymous_type1_sup.py b/tests/anonymous_type1_sup.py index 50667a54dd398879ed4f698c4d4771ac03ee38fd..15998f8dd86ccf3a6c2b05391714efb82d12defc 100644 --- a/tests/anonymous_type1_sup.py +++ b/tests/anonymous_type1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/anysimpletype1_sup.py b/tests/anysimpletype1_sup.py index fd90c17b39f6c86380ad916afca8321e0ffb5874..8fc85d5a511d0df710228af622c0d909d0582079 100644 --- a/tests/anysimpletype1_sup.py +++ b/tests/anysimpletype1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -779,7 +788,7 @@ class cimAnySimpleType(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='cimAnySimpleType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='cimAnySimpleType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/anywildcard1_sup.py b/tests/anywildcard1_sup.py index 955f65665f5c5bc513bf12d5afc6fcd5af59f74d..76cc49ab147c7230afcaa589facbdca593089452 100644 --- a/tests/anywildcard1_sup.py +++ b/tests/anywildcard1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/attr_groups1_sup.py b/tests/attr_groups1_sup.py index 17fff17a10a18a74e34f309d7787b88f6c3df5be..085a6e1d89abd358915cdf0ea07683b010c41bab 100644 --- a/tests/attr_groups1_sup.py +++ b/tests/attr_groups1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/catalogtest1_sup.py b/tests/catalogtest1_sup.py index 3d948ca227b0b56bc9d80bba46ee7e8d7df7fcc8..a8dcc9af29ca7327b7cac56674982c81aa47b46e 100644 --- a/tests/catalogtest1_sup.py +++ b/tests/catalogtest1_sup.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/cdata1_sup.py b/tests/cdata1_sup.py index 408e2306b6e3725501ce46402ace8c406f623771..3c95e191094cf8eae4bbe3ab7c4eaca548a257c6 100644 --- a/tests/cdata1_sup.py +++ b/tests/cdata1_sup.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/cleanupname1_sup.py b/tests/cleanupname1_sup.py index 9638243aaa348c3b09bc4ffa0f4d37d016675623..0217e3568d824a3958d18e052832e957a88c2374 100644 --- a/tests/cleanupname1_sup.py +++ b/tests/cleanupname1_sup.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/defaults_cases1_sup.py b/tests/defaults_cases1_sup.py index 16925d850b166351927b9a67e210735444576bdd..29d55ed60d12f4060ac7bd035563e214bcbe5919 100644 --- a/tests/defaults_cases1_sup.py +++ b/tests/defaults_cases1_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/defaults_coverage1_sup.py b/tests/defaults_coverage1_sup.py index 641b237fd0cf868def586bf5af1dddcbb1273a30..291585ff94788fa53d99761ee102870f93e79c0e 100644 --- a/tests/defaults_coverage1_sup.py +++ b/tests/defaults_coverage1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/extensions1_sup.py b/tests/extensions1_sup.py index 75907f8d9b5a2454be7f2ca0f9ebb7798bf71c25..16f648c6c47bd7c4391d9dd0e38e1bdef06e9d39 100644 --- a/tests/extensions1_sup.py +++ b/tests/extensions1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -697,7 +706,7 @@ class SpecialDate(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='SpecialDate') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='SpecialDate', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -772,7 +781,7 @@ class ExtremeDate(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtremeDate') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='ExtremeDate', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -847,7 +856,7 @@ class singleExtremeDate(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='singleExtremeDate') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='singleExtremeDate', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1253,7 +1262,7 @@ class BaseType(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='BaseType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='BaseType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1349,7 +1358,7 @@ class DerivedType(BaseType): self.exportAttributes(outfile, level, already_processed, namespace_, name_='DerivedType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='DerivedType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1434,7 +1443,7 @@ class MyInteger(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyInteger') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='MyInteger', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1509,7 +1518,7 @@ class MyBoolean(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyBoolean') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='MyBoolean', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1584,7 +1593,7 @@ class MyFloat(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyFloat') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='MyFloat', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -1659,7 +1668,7 @@ class MyDouble(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='MyDouble') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='MyDouble', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/ipo1_sup.py b/tests/ipo1_sup.py index f5e8822bd61d42b4df88fad73a3da2d2b0b8a53d..5ff55611f6244ed4da01cc7074ca724ea202d046 100644 --- a/tests/ipo1_sup.py +++ b/tests/ipo1_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/ipo2_sup.py b/tests/ipo2_sup.py index f5e8822bd61d42b4df88fad73a3da2d2b0b8a53d..5ff55611f6244ed4da01cc7074ca724ea202d046 100644 --- a/tests/ipo2_sup.py +++ b/tests/ipo2_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/mapcleanname1_sup.py b/tests/mapcleanname1_sup.py index a596dcfc41ee6ea545c110bdcb62a8aea898c14d..8a714741cfea0f6a1b7b211daa41eb781cb9f4ff 100644 --- a/tests/mapcleanname1_sup.py +++ b/tests/mapcleanname1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/nested_def1_sup.py b/tests/nested_def1_sup.py index 17b3c3956d53342a2e5e7afe2b406f7accc073e2..3a3dda95a1894cc1298dd5c50015fd3f5ebaab4c 100644 --- a/tests/nested_def1_sup.py +++ b/tests/nested_def1_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/out1_sup.py b/tests/out1_sup.py index f542a3852d80a1026aa1f96c5a2044ba1d89b38e..f0074d3211e984f38eaec1f7b3b54d2eaaea0b0b 100644 --- a/tests/out1_sup.py +++ b/tests/out1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -1984,7 +1993,7 @@ class param(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='param') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='param', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/people_procincl1_sup.py b/tests/people_procincl1_sup.py index 159c8e8b5c74957d2f0ae95ac1dd49dc406100e2..58f687e9fcfdb898fb5225865a5ba0ffb0b1900d 100644 --- a/tests/people_procincl1_sup.py +++ b/tests/people_procincl1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -1300,7 +1309,7 @@ class param(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='param') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='param', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/prefix_classname1_sup.py b/tests/prefix_classname1_sup.py index 7e77a9707ec09d451ae76a7486a7aaf0a40053b1..1f9b3c00a534f1c274ac5d256633b43acfd05cb5 100644 --- a/tests/prefix_classname1_sup.py +++ b/tests/prefix_classname1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -1565,7 +1574,7 @@ class tomato_param(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='param') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='param', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/recursive_simpletype1_sup.py b/tests/recursive_simpletype1_sup.py index 0b0a9e510df04963ec6764823044884e7d99d126..9f04ae7f15e01b0bdc900fb7c6057a69333dcc1b 100644 --- a/tests/recursive_simpletype1_sup.py +++ b/tests/recursive_simpletype1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/reference_simpletype1_sup.py b/tests/reference_simpletype1_sup.py index 7e784fedf5079b127431d241f9491be8da46c827..136024a9bf936a6bcdde43fb581c90346bde3691 100644 --- a/tests/reference_simpletype1_sup.py +++ b/tests/reference_simpletype1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/rem_dup_elems1_sup.py b/tests/rem_dup_elems1_sup.py index 2d38d44be8d9890f8876e1eb45bf37e0169152be..e654b499e3a094b6019f7ed1c7769a1f0b8928dd 100644 --- a/tests/rem_dup_elems1_sup.py +++ b/tests/rem_dup_elems1_sup.py @@ -370,6 +370,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/simplecontent_restriction1_sup.py b/tests/simplecontent_restriction1_sup.py index afb69f9ade182c3047a3fe646d420cab9cc3d60c..b3e7b314e197ed9d8ed8de71bf0a9fa65ff15deb 100644 --- a/tests/simplecontent_restriction1_sup.py +++ b/tests/simplecontent_restriction1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -724,7 +733,7 @@ class IdentifierType(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='IdentifierType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='IdentifierType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -847,7 +856,7 @@ class BillOfResourcesIDType(IdentifierType): self.exportAttributes(outfile, level, already_processed, namespace_, name_='BillOfResourcesIDType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='BillOfResourcesIDType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -916,7 +925,7 @@ class BillOfMaterialIDType(IdentifierType): self.exportAttributes(outfile, level, already_processed, namespace_, name_='BillOfMaterialIDType') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='', name_='BillOfMaterialIDType', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/simpletype_memberspecs1_sup.py b/tests/simpletype_memberspecs1_sup.py index cc12dd5b2db3d0dbcb7efca46faac4a0668e50e4..3d978815565c9db99e609f10b6e3864edfb86c2b 100644 --- a/tests/simpletype_memberspecs1_sup.py +++ b/tests/simpletype_memberspecs1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' @@ -697,7 +706,7 @@ class SpecialDate(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='SpecialDate') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='pl:', name_='SpecialDate', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: @@ -772,7 +781,7 @@ class ExtremeDate(GeneratedsSuper): self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExtremeDate') if self.hasContent_(): outfile.write('>') - outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else self.gds_encode(str(self.valueOf_)))) + outfile.write(self.convert_unicode(self.valueOf_)) self.exportChildren(outfile, level + 1, namespace_='pl:', name_='ExtremeDate', pretty_print=pretty_print) outfile.write('</%s%s>%s' % (namespace_, name_, eol_)) else: diff --git a/tests/simpletypes_other1_sup.py b/tests/simpletypes_other1_sup.py index e1a21b76e9ba60f0aa074a8e786d23c0440ff35a..6f146c36cefcfe20f81b35af938acabed18e882c 100644 --- a/tests/simpletypes_other1_sup.py +++ b/tests/simpletypes_other1_sup.py @@ -369,6 +369,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/to_etree1_sup.py b/tests/to_etree1_sup.py index f6eb789c45217dbacdcce5749ec7c2ffd0f939c7..231d243ddc60c2da05d03acd1f3e3bd642cbc67b 100644 --- a/tests/to_etree1_sup.py +++ b/tests/to_etree1_sup.py @@ -371,6 +371,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/validate_simpletypes1_sup.py b/tests/validate_simpletypes1_sup.py index d122552287f2937f1713a8c31e00ac423a8e09b4..f3ec19f7ed4effc4be8d38061f0d44fb199da836 100644 --- a/tests/validate_simpletypes1_sup.py +++ b/tests/validate_simpletypes1_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tests/validate_simpletypes1_warnings.txt b/tests/validate_simpletypes1_warnings.txt index 26b47be4ef189f68b2a1787003bc5b564b29ec1e..0c0f47550ee76946f473860303d774cd86e24ec8 100644 --- a/tests/validate_simpletypes1_warnings.txt +++ b/tests/validate_simpletypes1_warnings.txt @@ -1,60 +1,60 @@ -tests/validate_simpletypes2_sup.py:981: UserWarning: Value "2" does not match xsd minExclusive restriction on integer_range_1_st +tests/validate_simpletypes2_sup.py:990: UserWarning: Value "2" does not match xsd minExclusive restriction on integer_range_1_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on integer_range_1_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:991: UserWarning: Value "mmaaa1234mnopzzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1000: UserWarning: Value "mmaaa1234mnopzzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1004: UserWarning: Value "floatxx" does not match xsd enumeration restriction on token_enum_st +tests/validate_simpletypes2_sup.py:1013: UserWarning: Value "floatxx" does not match xsd enumeration restriction on token_enum_st warnings_.warn('Value "%(value)s" does not match xsd enumeration restriction on token_enum_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1011: UserWarning: Value "22" does not match xsd maxInclusive restriction on integer_range_incl_st +tests/validate_simpletypes2_sup.py:1020: UserWarning: Value "22" does not match xsd maxInclusive restriction on integer_range_incl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on integer_range_incl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1016: UserWarning: Value "-40" does not match xsd minExclusive restriction on integer_range_excl_st +tests/validate_simpletypes2_sup.py:1025: UserWarning: Value "-40" does not match xsd minExclusive restriction on integer_range_excl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on integer_range_excl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1025: UserWarning: Value "mno pqr" does not match xsd minLength restriction on min_max_length_st +tests/validate_simpletypes2_sup.py:1034: UserWarning: Value "mno pqr" does not match xsd minLength restriction on min_max_length_st warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on min_max_length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1030: UserWarning: Value "012345" does not match xsd length restriction on length_st +tests/validate_simpletypes2_sup.py:1039: UserWarning: Value "012345" does not match xsd length restriction on length_st warnings_.warn('Value "%(value)s" does not match xsd length restriction on length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1107: UserWarning: Value "0.2" does not match xsd minInclusive restriction on anonymous_float_valueType +tests/validate_simpletypes2_sup.py:1116: UserWarning: Value "0.2" does not match xsd minInclusive restriction on anonymous_float_valueType warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on anonymous_float_valueType' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1101: UserWarning: Value "efgh" does not match xsd pattern restrictions: [['^abcd$|^ef\\|gh$']] +tests/validate_simpletypes2_sup.py:1110: UserWarning: Value "efgh" does not match xsd pattern restrictions: [['^abcd$|^ef\\|gh$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_vbar_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:983: UserWarning: Value "9" does not match xsd maxExclusive restriction on integer_range_1_st +tests/validate_simpletypes2_sup.py:992: UserWarning: Value "9" does not match xsd maxExclusive restriction on integer_range_1_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on integer_range_1_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:991: UserWarning: Value "aaa1234mnopzzzbcd" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1000: UserWarning: Value "aaa1234mnopzzzbcd" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1009: UserWarning: Value "-50" does not match xsd minInclusive restriction on integer_range_incl_st +tests/validate_simpletypes2_sup.py:1018: UserWarning: Value "-50" does not match xsd minInclusive restriction on integer_range_incl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on integer_range_incl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1023: UserWarning: Value "asdf asdf asdf asdf asdf asdf" does not match xsd maxLength restriction on min_max_length_st +tests/validate_simpletypes2_sup.py:1032: UserWarning: Value "asdf asdf asdf asdf asdf asdf" does not match xsd maxLength restriction on min_max_length_st warnings_.warn('Value "%(value)s" does not match xsd maxLength restriction on min_max_length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1030: UserWarning: Value "01234567890" does not match xsd length restriction on length_st +tests/validate_simpletypes2_sup.py:1039: UserWarning: Value "01234567890" does not match xsd length restriction on length_st warnings_.warn('Value "%(value)s" does not match xsd length restriction on length_st' % {"value" : value.encode("utf-8")} ) -tests/validate_simpletypes2_sup.py:1040: UserWarning: Value "2015-05-01" does not match xsd minInclusive restriction on date_minincl_st +tests/validate_simpletypes2_sup.py:1049: UserWarning: Value "2015-05-01" does not match xsd minInclusive restriction on date_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on date_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1045: UserWarning: Value "2015-11-01" does not match xsd maxInclusive restriction on date_maxincl_st +tests/validate_simpletypes2_sup.py:1054: UserWarning: Value "2015-11-01" does not match xsd maxInclusive restriction on date_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on date_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1050: UserWarning: Value "2015-05-01" does not match xsd minExclusive restriction on date_minexcl_st +tests/validate_simpletypes2_sup.py:1059: UserWarning: Value "2015-05-01" does not match xsd minExclusive restriction on date_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on date_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1055: UserWarning: Value "2015-11-01" does not match xsd maxExclusive restriction on date_maxexcl_st +tests/validate_simpletypes2_sup.py:1064: UserWarning: Value "2015-11-01" does not match xsd maxExclusive restriction on date_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on date_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1060: UserWarning: Value "13:30:00" does not match xsd minInclusive restriction on time_minincl_st +tests/validate_simpletypes2_sup.py:1069: UserWarning: Value "13:30:00" does not match xsd minInclusive restriction on time_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on time_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1065: UserWarning: Value "17:00:00" does not match xsd maxInclusive restriction on time_maxincl_st +tests/validate_simpletypes2_sup.py:1074: UserWarning: Value "17:00:00" does not match xsd maxInclusive restriction on time_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on time_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1070: UserWarning: Value "13:30:00" does not match xsd minExclusive restriction on time_minexcl_st +tests/validate_simpletypes2_sup.py:1079: UserWarning: Value "13:30:00" does not match xsd minExclusive restriction on time_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on time_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1075: UserWarning: Value "17:00:00" does not match xsd maxExclusive restriction on time_maxexcl_st +tests/validate_simpletypes2_sup.py:1084: UserWarning: Value "17:00:00" does not match xsd maxExclusive restriction on time_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on time_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1080: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minInclusive restriction on datetime_minincl_st +tests/validate_simpletypes2_sup.py:1089: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minInclusive restriction on datetime_minincl_st warnings_.warn('Value "%(value)s" does not match xsd minInclusive restriction on datetime_minincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1085: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxInclusive restriction on datetime_maxincl_st +tests/validate_simpletypes2_sup.py:1094: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxInclusive restriction on datetime_maxincl_st warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on datetime_maxincl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1090: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minExclusive restriction on datetime_minexcl_st +tests/validate_simpletypes2_sup.py:1099: UserWarning: Value "2015-06-01 13:20:10" does not match xsd minExclusive restriction on datetime_minexcl_st warnings_.warn('Value "%(value)s" does not match xsd minExclusive restriction on datetime_minexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1095: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxExclusive restriction on datetime_maxexcl_st +tests/validate_simpletypes2_sup.py:1104: UserWarning: Value "2015-11-01 14:20:10" does not match xsd maxExclusive restriction on datetime_maxexcl_st warnings_.warn('Value "%(value)s" does not match xsd maxExclusive restriction on datetime_maxexcl_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:1109: UserWarning: Value "6.6" does not match xsd maxInclusive restriction on anonymous_float_valueType +tests/validate_simpletypes2_sup.py:1118: UserWarning: Value "6.6" does not match xsd maxInclusive restriction on anonymous_float_valueType warnings_.warn('Value "%(value)s" does not match xsd maxInclusive restriction on anonymous_float_valueType' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:988: UserWarning: Value "aaa12zzz" does not match xsd minLength restriction on pattern_st +tests/validate_simpletypes2_sup.py:997: UserWarning: Value "aaa12zzz" does not match xsd minLength restriction on pattern_st warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on pattern_st' % {"value" : value} ) -tests/validate_simpletypes2_sup.py:991: UserWarning: Value "aaa12zzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] +tests/validate_simpletypes2_sup.py:1000: UserWarning: Value "aaa12zzz" does not match xsd pattern restrictions: [['^aaa.*zzz$', '^bbb.*xxx$'], ['^.*123.*$', '^.*456.*$']] warnings_.warn('Value "%s" does not match xsd pattern restrictions: %s' % (value.encode('utf-8'), self.validate_pattern_st_patterns_, )) -tests/validate_simpletypes2_sup.py:1521: UserWarning: Value "pqrst" does not match xsd minLength restriction on simpleTwoElementTwoType +tests/validate_simpletypes2_sup.py:1530: UserWarning: Value "pqrst" does not match xsd minLength restriction on simpleTwoElementTwoType warnings_.warn('Value "%(value)s" does not match xsd minLength restriction on simpleTwoElementTwoType' % {"value" : value.encode("utf-8")} ) diff --git a/tests/validate_simpletypes2_sup.py b/tests/validate_simpletypes2_sup.py index d122552287f2937f1713a8c31e00ac423a8e09b4..f3ec19f7ed4effc4be8d38061f0d44fb199da836 100644 --- a/tests/validate_simpletypes2_sup.py +++ b/tests/validate_simpletypes2_sup.py @@ -368,6 +368,15 @@ except ImportError as exp: return instring.encode(ExternalEncoding) else: return instring + @staticmethod + def convert_unicode(instring): + if (type(instring) is str or + (sys.version_info.major == 2 + and type(instring) == unicode)): + result = quote_xml(instring) + else: + result = GeneratedsSuper.gds_encode(str(instring)) + return result def getSubclassFromModule_(module, class_): '''Get the subclass of a class from a specific module.''' diff --git a/tutorial/generateds_tutorial.html b/tutorial/generateds_tutorial.html index 5b3babb11cf845d20d174a2c46375081d07df6b1..d4945ecac5e7e32c7ccf4ab748f84b0ac762085a 100644 --- a/tutorial/generateds_tutorial.html +++ b/tutorial/generateds_tutorial.html @@ -228,7 +228,7 @@ They are used by updateversion.py. --> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> -<tr class="field"><th class="field-name">date:</th><td class="field-body">January 05, 2017</td> +<tr class="field"><th class="field-name">date:</th><td class="field-body">January 16, 2017</td> </tr> </tbody> </table> @@ -1210,7 +1210,7 @@ named <tt class="docutils literal">garden_api.py</tt>, you can create an instanc <div class="footer"> <hr class="footer" /> <a class="reference external" href="generateds_tutorial.txt">View document source</a>. -Generated on: 2017-01-05 20:00 UTC. +Generated on: 2017-01-17 00:01 UTC. Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. </div> diff --git a/tutorial/generateds_tutorial.zip b/tutorial/generateds_tutorial.zip index d1c0bf8d114c2b41a331363e8a35f6c5b4c2d8fb..09649363daf7cb1b00b3b67705d890bd0aac6ec8 100644 Binary files a/tutorial/generateds_tutorial.zip and b/tutorial/generateds_tutorial.zip differ