>From: Thomas Nichols >Sent: Thursday, September 15, 2011 6:44 PM > > Hi Dave, > > Looking for a little help - I'm using your handy GenerateDS tool to > generate python classes from a complex schema. For some reason, > generateDS is creating references to a class (eitc_UidType), but > never creates the class definition. However other types in the same > XSD are generated correctly. I can't seem to figure out what the > problem is, was hoping you could help. > > $ python EiPayloads.py ../examples/eiCreateEvent.xml > Traceback (most recent call last): > ... > File "EiPayloads.py", line 20085, in buildChildren > obj_ = eitc_UidType.factory() > NameError: global name 'eitc_UidType' is not defined > > > The schemas are attached, I'm using generateDS by calling > $ generateDS.py -o EiPayloads.py EiPayloads.xsd > > (Note that there's also a syntax error in the generated > EiPayloads.py output due to an xsd:annotation that ends in a double- > quote char " but that's easy enough to fix.) > > Also attached is a simple test input file. > > Thanks in advance. >
Thomas - I generated Python bindings using the following: $ generateDS.py -o tmp1sup.py EiPayloads.xsd The result (tmp1sup.py) is almost exactly the same as yours (EiPayloads.py), so I'm assuming that's what you did, too. The schema EiPayloads.xsd imports schemas from the Internet (which may import other schemas from the Net etc). My guess is that one of those schema declares a child element with something like this: <xs:complexType name="EventDescriptorType"> <xs:sequence> <xs:element name="eventID" type="eitc_UidType" /> o o o </xs:sequence> </xs:complexType> But, either the type eitc_UidType is not defined in any of those schemas that are imported or the schema that defines eitc_UidType is not being imported. Wait. The reason it is not defined is because generateDS.py is converting a type defined as eitc:UidType into eitc_UidType. So, the type *is* defined, but generateDS.py is confused about it's correct name. It might be a bit more complex than that, but at least I've got a clue. More tomorrow when I've figured out a little more. Thanks for reporting this. - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users