The export functions output the attributes and children of the derived
classes before those of the base class, where the XSL spec specifies
that the base class elements are earlier than derived elements in a
sequence. The attached patch corrects the generation order.
--- generateDS-1.13a.py 2008-05-27 14:45:28.000000000 -0400
+++ generateDS.py 2008-05-28 12:41:44.000000000 -0400
@@ -1341,12 +1341,12 @@
(element.getName(), namespace)
outfile.write(s1)
hasAttributes = 0
- hasAttributes = generateExportAttributes(outfile, element, hasAttributes)
if base and base not in SimpleTypeDict:
hasAttributes += 1
s1 = " %s.exportAttributes(self, outfile, level, name_='%s', namespace_='%s')\n" % \
(base, element.getName(), namespace)
outfile.write(s1)
+ hasAttributes += generateExportAttributes(outfile, element, hasAttributes)
if hasAttributes == 0:
s1 = " pass\n"
outfile.write(s1)
@@ -1357,11 +1357,11 @@
(element.getName(), namespace)
outfile.write(s1)
hasChildren = 0
- hasChildren = generateExportChildren(outfile, element, hasChildren, namespace)
if base and base not in SimpleTypeDict:
hasChildren += 1
s1 = " %s.exportChildren(self, outfile, level, name_, namespace_)\n" % (base, )
outfile.write(s1)
+ hasChildren += generateExportChildren(outfile, element, hasChildren, namespace)
if childCount == 0:
s1 = " outfile.write(quote_xml(self.valueOf_))\n"
outfile.write(s1)
@@ -1534,6 +1534,10 @@
outfile.write(s1)
s1 = " def exportLiteralChildren(self, outfile, level, name_):\n"
outfile.write(s1)
+ if base and base not in SimpleTypeDict:
+ s1 = " %s.exportLiteralChildren(self, outfile, level, name_)\n" % \
+ (base, )
+ outfile.write(s1)
for child in element.getChildren():
name = child.getName()
name = cleanupName(name)
@@ -1577,10 +1581,6 @@
outfile.write(s1)
s1 = " outfile.write('valueOf_ = \"%s\",\\n' % (self.valueOf_,))\n"
outfile.write(s1)
- if base and base not in SimpleTypeDict:
- s1 = " %s.exportLiteralChildren(self, outfile, level, name_)\n" % \
- (base, )
- outfile.write(s1)
#s1 = " level -= 1\n"
#outfile.write(s1)
# end generateExportLiteralFn
@@ -2186,11 +2186,11 @@
def buildCtorArgs_multilevel_aux(addedArgs, add, element):
- buildCtorArgs_aux(addedArgs, add, element)
base = element.getBase()
if base and base in ElementDict:
parent = ElementDict[base]
buildCtorArgs_multilevel_aux(addedArgs, add, parent)
+ buildCtorArgs_aux(addedArgs, add, element)
def buildCtorArgs_aux(addedArgs, add, element):
@@ -3343,6 +3343,10 @@
def buildCtorParams_aux(add, element):
+ base = element.getBase()
+ if base and base in ElementDict:
+ parent = ElementDict[base]
+ buildCtorParams_aux(add, parent)
attrDefs = element.getAttributeDefs()
for key in attrDefs:
attrDef = attrDefs[key]
@@ -3351,10 +3355,6 @@
add(', %s' % cleanName)
for child in element.getChildren():
add(', %s' % child.getCleanName())
- base = element.getBase()
- if base and base in ElementDict:
- parent = ElementDict[base]
- buildCtorParams_aux(add, parent)
def get_class_behavior_args(classBehavior):
-------------------------------------------------------------------------
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