Hi all,
please find attach a patch for generateDS 1.13a that fix an issue with the
child nodes of a base class in an extension class. The extension class used to
not check for the super class child node if it has children of his own.
I saw James fix for supposingly the same bug but I chose to fix the issue in
the exportfn instate that in the generatebuildfn
Cheers,
Guillaume Morin
--- old_generateDS.py 2008-05-26 15:04:35.000000000 -0400
+++ generateDS.py 2008-05-29 13:28:53.000000000 -0400
@@ -1308,25 +1308,18 @@
outfile.write(s1)
s1 = ' showIndent(outfile, level)\n'
outfile.write(s1)
+ s1 = " outfile.write('<%s%s' % (namespace_, name_))\n"
+ outfile.write(s1)
if len(element.getAttributeDefs()) > 0 or element.getAnyAttribute():
- s1 = " outfile.write('<%s%s' % (namespace_, name_))\n"
- outfile.write(s1)
-
s1 = " self.exportAttributes(outfile, level, name_='%s', namespace_='%s')\n" % \
(element.getName(), namespace)
outfile.write(s1)
- if element.isMixed() or childCount == 0:
- s1 = " outfile.write('>')\n"
- else:
- s1 = " outfile.write('>\\n')\n"
- outfile.write(s1)
+ if element.isMixed() or childCount == 0:
+ s1 = " outfile.write('>')\n"
else:
- if element.isMixed() or childCount == 0:
- s1 = " outfile.write('<%s%s>' % (namespace_, name_))\n"
- else:
- s1 = " outfile.write('<%s%s>\\n' % (namespace_, name_))\n"
- outfile.write(s1)
-
+ s1 = " outfile.write('>\\n')\n"
+ outfile.write(s1)
+
s1 = " self.exportChildren(outfile, level + 1, name_, namespace_)\n"
outfile.write(s1)
if element.isMixed() or childCount == 0:
@@ -2158,6 +2151,13 @@
parent = ElementDict[base]
s1 = " %s.buildChildren(self, child_, nodeName_)\n" % (base, )
outfile.write(s1)
+ else:
+ if base and base in ElementDict and base not in SimpleTypeDict:
+ parent = ElementDict[base]
+ s1 = " elif child_.nodeType == Node.ELEMENT_NODE:\n"
+ outfile.write(s1)
+ s1 = " %s.buildChildren(self, child_, nodeName_)\n" % (base, )
+ outfile.write(s1)
# end generateBuildFn
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users