Andrii, I believe that I have a fix for this, IFUICWITID (if I understand it correctly which I think I do). I've tested with both Python 2 and Python 3 and it does what I expect with both.
I used this schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="container" type="containerType"/> <xs:complexType name="containerType"> <xs:sequence> <xs:element name="field1" type="xs:string" minOccurs="0"/> <xs:element name="field2" type="xs:string" minOccurs="0"/> <xs:element name="field3" type="simpleStringType" minOccurs="0"/> <xs:element name="field4" type="simpleStringType" minOccurs="0"/> </xs:sequence> </xs:complexType> <xs:complexType name="simpleStringType"> <xs:simpleContent> <xs:extension base="xs:string"> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema> And, I used the following XML instance doc: <?xml version="1.0"?> <container> <field3>an ascii string</field3> <field4>Selçuk < > İstanbul</field4> </container> Am I testing against the correct problem? If so the fix is at Bitbucket: https://bitbucket.org/dkuhlman/generateds I'll also attach generateDS.py to a separate message. Let me know if it fixes things for you. Dave On Wed, Jan 11, 2017 at 05:00:36PM +0000, Andrii Iudin wrote: > Dear Dave, > > We have encountered the following issue: when an export generated for a > complex type element, it has the following: > outfile.write((quote_xml(self.valueOf_) if type(self.valueOf_) is str else > self.gds_encode(str(self.valueOf_)))) > > However, if this complex type element is a unicode string, then > str(self.valueOf_) results in UnicodeEncodeError. Please could you tell if > it would be possible to add a condition that, in addition to checking > whether type(self.valueOf_) is str, will check if type(self.valueOf_) is > unicode, and if so, then apply self.gds_encode directly to self.valueOf_? > Or, perhaps, there is a better solution to this? > > Many thanks and best regards, > Andrii -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users