Hi,
I was attempting to use generateDS.py 1.10a against a collection of
.xsds with alot of complexTypes and xs:imports and ran into some
troubles. Basically all the child elements are deemed to be string
types so in the export() method, quote_xml() is being called on all
the children instead of child.export(etc..). I thought it had
something to do with my particular .xsd, however I'm having the same
problem with Demos/Xmlbehaviour/po.xsd.
When I run generateDS.py 1.10a against Demos/Xmlbehaviour/po.xsd the
resulting po.py doesn't match the one (which works) bundled in
generateDS-1.10a.tar.gz
I debugged a bit and it seems like as the .xsd is parsed none of the
referenced types are found in 'ElementDict' so they are assumed to be
of type string. Type typs in ElementDict don't have any namespace
prefix
from generateDS.py
380 def resolve_type(self):
381 self.complex = 0
382 # If it has any attributes, then it's complex.
383 attrDefs = self.getAttributeDefs()
384 if len(attrDefs) > 0:
385 self.complex = 1
386 # type_val = ''
387 type_val = self.resolve_type_1()
388 if type_val:
389 if type_val in ElementDict: <--- is always false
..for e.g. when parsing the definition for the "purchase-order" type
in po.xsd, the type can't be found for the <customer> child element..
..from po.xsd
<xs:element name="purchase-order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="po:customer"/>
..etc..
<xs:complexType name="customer">
..etc..
..in resolve_type()
388 type_val = self.resolve_type_1()
389 if type_val:
390 -> if type_val in ElementDict:
(Pdb) type_val
u'po:customer'
(Pdb) ElementDict.keys()
['', u'purchase-order', u'line-item', u'customer', u'shipper']
type_val has the name of the type with the namespace prefix however
the name in ElementDict has no prefix so type isn't found and is
assumed to a string.
I've tried this on older system with python 2.3 w/PyXml and on a
system with python 2.5 (no PyXML) with the same result. Is this a
known problem ? What system was the po.py that's in
generateDS-1.10a.tar.gz generated on ?
- David
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
generateds-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/generateds-users