On Thu, Aug 07, 2014 at 01:09:49PM -0700, Dave Kuhlman wrote: > > Hi, > > > > I am generating python classes for xml schema which contains > > abstract substitutionGroup. And have problems with references to > > such elements with maxOccurance="1". Here is short example with > > difficulties i have: > > Leonid, > > Thanks for this patch. > > However, give me time to work with this a bit. The reason that the > mappedName, which you changed, is used is to prevent conflicts with > element names that are the same as Python keywords. For example, we > could generate code like this: > > elif nodeName_ == 'with': > obj_ = boosterType.factory() > obj_.build(child_) > self.with = obj_ > obj_.original_tagname_ = 'with' > > instead of this: > > elif nodeName_ == 'with': > obj_ = boosterType.factory() > obj_.build(child_) > self.with_ = obj_ > obj_.original_tagname_ = 'with' > > Because "with" is a Python keyword, "self.with" produces an error. > > I had forgotten about this, but one of my tests revealed it. > > So, I'll investigate to see if I can adapt your fix so that it works > with both your test and mine. > > Thanks for providing that test case. It will make my work easier. >
Leonid, I believe that I've been able to fix this in a way that fixes your bug *and* preserves the mapping of Python keywords. I have not yet uploaded a new release. However, this fix is in the current version in the Bitbucket repository. If you try it, please let me know how it goes. You can find it here: https://bitbucket.org/dkuhlman/generateds Dave [snip] -- Dave Kuhlman http://www.davekuhlman.org ------------------------------------------------------------------------------ _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users