Tim Couper has been working on the fpml (financial products markup language)
schema. (see http://fpml.org/)
It's quite large. But, with a few patches (and with the use of the -a flag),
we were able generate code from it.
I've attached a patch file for those changes. This patch file is a diff
against version generateDS-1.14c.
If anyone tries it and has problems, please let me know.
I'll release a new version that includes these patches in a few days.
- Dave
--
Dave Kuhlman
http://www.rexx.com/~dkuhlman
--- generateDS-1.14c/generateDS.py 2008-07-16 14:59:53.000000000 -0700
+++ generateDS.py 2008-08-14 15:45:07.000000000 -0700
@@ -1261,7 +1261,7 @@
elif child.getType() == DoubleType:
s1 = '%s showIndent(outfile, level)\n' % fill
outfile.write(s1)
- s1 = "%s outfile.write('<%%s%s>%%e</&%s%s>\\n' %% (namespace_, self.get%s(), namespace_))\n" % \
+ s1 = "%s outfile.write('<%%s%s>%%e</%%s%s>\\n' %% (namespace_, self.get%s(), namespace_))\n" % \
(fill, name, name, make_gs_name(cleanName))
outfile.write(s1)
else:
@@ -1924,8 +1924,8 @@
outfile.write(s1)
s1 = " nodeName_ == '%s':\n" % origName
outfile.write(s1)
- s1 = " childobj_ = %s%s.factory()\n" % \
- (prefix, cleanupName(mapName(childType)))
+ s1 = " childobj_ = %s%s.factory()\n" % (
+ prefix, cleanupName(mapName(childType)))
outfile.write(s1)
s1 = " childobj_.build(child_)\n"
outfile.write(s1)
@@ -1974,6 +1974,12 @@
headName = cleanupName(headChild.getName())
attrCount = len(child.getAttributeDefs())
childType = child.getType()
+ # name_type_problem
+ if not child.isComplex() and child.getSimpleType():
+ childType = child.getSimpleType()
+ childType = SimpleTypeDict[childType].getBase()
+ elif mappedName in ElementDict:
+ childType = ElementDict[mappedName].getType()
if attrCount == 0 and \
(childType in StringType or \
childType == TokenType or \
@@ -2125,8 +2131,8 @@
typeName = ElementDict[mappedName].getType()
else:
typeName = cleanupName(mapName(childType))
- s1 = " obj_ = %s%s.factory()\n" % \
- (prefix, typeName, )
+ s1 = " obj_ = %s%s.factory()\n" % (
+ prefix, cleanupName(mapName(typeName)), )
outfile.write(s1)
s1 = " obj_.build(child_)\n"
outfile.write(s1)
@@ -2657,7 +2663,7 @@
if base and base not in SimpleTypeDict:
s1 = 'class %s%s(%s):\n' % (prefix, name, base)
else:
- s1 = 'class %s%s:\n' % (prefix, name)
+ s1 = 'class %s%s(object):\n' % (prefix, name)
wrt(s1)
if UserMethodsModule:
generateMemberSpec(outfile, element)
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users