Eugene, Thanks for reporting and explaining this problem. Give me a little time to study it and to look at your pull request at Bitbucket (thanks for that, too).
The problems with includes and imports does not surprise me. Although generateDS does process all included and imported files, it does not keep their namespaces straight. It should, however, at least export the document with the correct namespace definitions and namespace prefixes. I'll take a look and will report back. Dave On Wed, Sep 27, 2017 at 05:09:24AM +0300, Eugene Petkevich wrote: > Dear generateDS team, > > I've tried to work on solve several issues regarding XML output by > generateDS and need some help. Here are the issues: > > (1) Export of content with mixed="True". > I noticed that elements with mixed="True" are not exported at all, both > their children and text value are missing in XML files. I've managed to > change the code that is working, but not sure whether I fully understand > everything related to mixed element implementation in generateDS. I've made > a pull request for that change: > https://bitbucket.org/dkuhlman/generateds/pull-requests/26/fix-for-exporting-elements-with-mixed-true/diff > > (2) Namespace prefixes are not preserved when using includes and imports. > Here I noticed that all export functions for all elements are generated with > the target namespace of the input schema. Even if it includes or imports > another schemas with different target namespaces. Thus, in the resulting > XML every element has the same namespace, even if they are supposed to have > different namespaces. I've tried to check the code and see that includes and > imports are preprocessed, and original namespaces are not preserved in both > generateDS code and generated code. I've tried to implement the fix in > generateDS, but didn't manage yet. Maybe you have an advice on how to > approath the issue? > > (3) When exporting subtyped elemetns, 'xsi:type=...' attribute is not > exported. > What is missing in generated code is the only assignment: > self.extensionType_ = '<type>' > or calling extensionType='<type>' in constructor of the class. But again > I'm not sure where in generateDS should I put that. > > Currently all three issues make it impossible to export a corrent XML (that > is validated against the corresponding schema); while it reads XMLs > correctly, generating corresponding classes, and reading children elements > and mixed text. > > A temporary solution to the issues was to use a combination of Mix-in > classes and edits in the generated code. > > Best regards, > Eugene > > ------------------------------------------------------------------------------ > 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 -- 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