> Thanks a lot for your quick response!
>
> I forgot to tell you another issue I encountered yesterday. In
> vcloud schema, there're some extension types for vcenter (like
> \extension\vmwextensions.xsd). If I took this xsd as root xsd, I
> found the type in master.xsd would be generated as well. But seems
> the order of the output classes is not right. It reported
> "ResourceType" is not defined.
Jinquan,
I believe that I have fixes (see attached) for 2 of the 3 problems
you reported:
1. Issues with one-file-per-xsd -- Error occurred when the
include/import element referenced a schema on the Net (rather
than the local file system). Added support to read remote
content (in a way similar to what process_includes.py already
does).
2. Order of output classes not right -- generateDS.py was not
correctly handling anonymous xs:simpleType, which caused it to
believe that it had previously generating a class when it
actually had not.
I still do *not* have a fix for the following problem:
3. Some elements in "1.xml" are not serialized. e.g.
<NetworkConfigSection>, <LeaseSettingsSection>, etc. -- I'll work
on this one some more tomorrow. Several things might be involved,
including substitutionGroups and abstract super classes/types. I
have to track down which is causing this error.
A patch file is attached for issues 1 and 2, above. If you get a
chance to try it, please let me know whether these fixes work for
you.
I'll follow up with issue 3 above in a day or so, I hope.
Thanks for your help with this.
Dave
--
Dave Kuhlman
http://www.davekuhlman.org
diff -r e230b6d9ef12 generateDS.py
--- a/generateDS.py Mon Feb 10 15:25:08 2014 -0800
+++ b/generateDS.py Tue Mar 04 15:16:04 2014 -0800
@@ -177,7 +177,7 @@
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
-VERSION = '2.12b'
+VERSION = '2.12c'
##VERSION##
GenerateProperties = 0
@@ -541,11 +541,7 @@
s1 = '<"%s" SimpleTypeElement instance at 0x%x>' % \
(self.getName(), id(self))
return s1
-
- def __repr__(self):
- s1 = '<"%s" SimpleTypeElement instance at 0x%x>' % \
- (self.getName(), id(self))
- return s1
+ __repr__ = __str__
def resolve_list_type(self):
if self.isListType():
@@ -4190,8 +4186,7 @@
# If this element is an extension (has a base) and the base has
# not been generated, then postpone it.
if parentName:
- if (parentName not in AlreadyGenerated and
- parentName not in SimpleTypeDict):
+ if parentName not in AlreadyGenerated:
PostponedExtensions.append(element)
return
if mapName(element.getName()) in AlreadyGenerated:
@@ -5915,7 +5910,20 @@
roots = []
rootInfos = []
for path in rootPaths:
- rootFile = open(path, 'r')
+
+ if path.startswith('http:') or path.startswith('ftp:'):
+ try:
+ urlfile = urllib2.urlopen(path)
+ content = urlfile.read()
+ urlfile.close()
+ rootFile = StringIO.StringIO()
+ rootFile.write(content)
+ rootFile.seek(0)
+ except urllib2.HTTPError:
+ msg = "Can't find file %s." % (path, )
+ raise IOError(msg)
+ else:
+ rootFile = open(path, 'r')
parser = make_parser()
dh = XschemaHandler()
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users