On Tue, Jun 16, 2015 at 11:44:39AM +0800, Nan Huang wrote: > Hi, Dave, > > Sorry for the late reply, I finally got a chance to have lxml and latest > genereateDS installed. > > But still, I have no luck in getting the right schema binding > generated(still missing get_NavigationProperty under TEntityType class) > > Attached my XSDs and generated python code for your reference. > > The command I used to generate it is: > $ python generateDS.py -o edmx.py Microsoft.Data.Entity.Design.Edmx_3.xsd >
Nan, Thank you for sending the XML schema. That helped me figure out what's wrong. The problem is that this schema contains multiple definitions of TEntityType. Because those definitions are in different namespaces, that is legal for XML schema. But, generateDS.py cannot handle those different definitions of the same name in separate namespaces. And, in this case, some of those definitions of complexType TEntityType contain element NavigationProperty, and some do not. generateDS.py is picking and using one of those definitions (maybe the first one it sees, maybe the last; don't know for sure), and that definition, I'm guessing, does not define NavigationProperty. Handling this situation would require a very different approach by generateDS.py. generateDS.py generates all the classes from a schema in a single Python namespace, specifically a Python module. To handle these multiple definitions in separate namespaces, generateDS.py would have to generate multiple Python modules from a single schema, or would have to generate nested classes (possibly classes nested inside classes, I suppose). Sorry I can't be of more help with this. I've looking into this issue before, but the required changes always seemed very difficult and the result would be quite difficult to use (multiple modules with import statements from a main module?). I am trying to figure out how to solve this problem. But, I've been trying for a long time now and have not made much progress. So, it's not something (fix, new feature, ...) you should wait for. Let me know if you have any ideas or suggestions about this, or if there is something I can do to help. Dave > > -----Original Message----- > From: Dave Kuhlman [mailto:dkuhl...@davekuhlman.org] > Sent: Tuesday, June 09, 2015 12:19 AM > To: Huang, Nan > Subject: Re: Error in generated python code by generateDS > > On Sun, Jun 07, 2015 at 01:47:10AM +0800, Huang, Nan wrote: > > Nan, > > Here are those attached files. > > Dave > -- > > Dave Kuhlman > http://www.davekuhlman.org -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users