When I try to parse any schema document from the Open Travel Alliance,
I get this error:

mammon:OpenTravel_2007B_PublicReview devin$ python generateDS.py -o
OTA_ErrorRS.py -s OTA_ErrorRSsubs.py OTA_ErrorRS.xsd
Traceback (most recent call last):
  File "generateDS.py", line 4007, in <module>
    main()
  File "generateDS.py", line 4003, in main
    processIncludes, superModule=superModule)
  File "generateDS.py", line 3917, in parseAndGenerate
    parser.parse(infile)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/xmlreader.py",
line 123, in parse
    self.feed(buffer)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 207, in feed
    self._parser.Parse(data, isFinal)
  File 
"/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/xml/sax/expatreader.py",
line 301, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "generateDS.py", line 917, in startElement
    self.stack[-1].attributeGroupNameList.append(attrs['ref'])
AttributeError: SimpleTypeElement instance has no attribute
'attributeGroupNameList'

Does anybody have any idea what this could be related to?


Below is one of the simplest schema documents I could find from the OTA:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns="http://www.opentravel.org/OTA/2003/05/beta";
targetNamespace="http://www.opentravel.org/OTA/2003/05/beta";
elementFormDefault="qualified" version="1.004" id="OTA2007A">
        <xs:include schemaLocation="OTA_CommonTypes.xsd"/>
        
        
        <xs:annotation>
                <xs:documentation xml:lang="en">All Schema files in the OTA
specification are made available according to the terms defined by the
OTA License Agreement at
http://www.opentravel.org/ota_downloads_form.cfm</xs:documentation>
        </xs:annotation>
        <xs:element name="OTA_ErrorRS">
                <xs:annotation>
                        <xs:documentation xml:lang="en">The standatd 
OTA_ErrorRS message is
designed to accommodate errors that result from the parser, or from
validation, before reaching the server. The set of errors that can use
this  error is constrained by its limited structure, to provide
structural stability.</xs:documentation>
                </xs:annotation>
                <xs:complexType>
                        <xs:attributeGroup ref="OTA_PayloadStdAttributes"/>
                        <xs:attribute name="Status" use="optional" 
default="NotProcessed">
                                <xs:annotation>
                                        <xs:documentation xml:lang="en">An 
indication of the processing
that was completed on the request message.  An error response may be
returned and no action taken on behalf of the request message, or
there may be some action taken, or the full action may have been
completed.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:restriction base="xs:NMTOKEN">
                                                <xs:enumeration 
value="NotProcessed">
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">The error occurred prior to
processing of the request (or if during the processing of the request,
before the intentions of the request were completed).
</xs:documentation>
                                                        </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration 
value="Incomplete">
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">The error occurred during
processing of the request. The request was partially
completed.</xs:documentation>
                                                        </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration 
value="Complete">
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">The error occurred after
successful processing of the request. The requested process was
completed.</xs:documentation>
                                                        </xs:annotation>
                                                </xs:enumeration>
                                                <xs:enumeration value="Unknown">
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">The status of the request is
unknown. </xs:documentation>
                                                        </xs:annotation>
                                                </xs:enumeration>
                                        </xs:restriction>
                                </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="ErrorCode" use="required">
                                <xs:annotation>
                                        <xs:documentation xml:lang="en">The 
ErrorCode attribute MUST be
present and is defined as free-text with a list of recommended
enumerated values, to indicate the error type. </xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:union>
                                                <xs:simpleType>
                                                        <xs:restriction 
base="xs:NMTOKEN">
                                                                <xs:enumeration 
value="SessionFailure-100">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">This value is used to
indicate that the request version is not supported</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="SessionFailure-101">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">This value is used to
indicate that the session has expired</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="SessionFailure-102">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">This value is used to
indicate that the session is already closed</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="SessionFailure-103">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">This value is used to
indicate that a parameter in the request is not
supported.</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="Unknown">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">indicates an unknown error.
Additional information may be provided within the textual part of the
element</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="Malformed">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">: indicates that the XML
message was not well-formed. Additional information may be provided
within the ErrorMessage attribute.</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="Validation">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">: indicates that a
well-formed XML message was sent, but did not pass the validation
check. Additional information may be provided within the ErrorMessage
attribute.</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="UnrecognizedRoot">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">Indicates an unrecognized
payload root element was received. Additional information may be
provided within the ErrorMessage attribute.</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                                <xs:enumeration 
value="UnrecognizedVersion">
                                                                        
<xs:annotation>
                                                                                
<xs:documentation xml:lang="en">Indicates that the version
attribute in the Schema element of the Manifest of the header is not
recognized. Additional information, such as version number(s)
supported, may be provided within the ErrorMessage
attribute.</xs:documentation>
                                                                        
</xs:annotation>
                                                                
</xs:enumeration>
                                                        </xs:restriction>
                                                </xs:simpleType>
                                                <xs:simpleType>
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">This is intended to be used
when the above enumeration list does not meet your needs.
</xs:documentation>
                                                        </xs:annotation>
                                                        <xs:restriction 
base="StringLength1to32"/>
                                                </xs:simpleType>
                                        </xs:union>
                                </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="Severity" type="StringLength1to64" 
use="optional">
                                <xs:annotation>
                                        <xs:documentation xml:lang="en">An 
optional indicator to reflect
the severity of this condition.</xs:documentation>
                                </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="ErrorMessage" use="optional">
                                <xs:annotation>
                                        <xs:documentation xml:lang="en">A 
textual description to provide
more information about the specific error.</xs:documentation>
                                </xs:annotation>
                                <xs:simpleType>
                                        <xs:union>
                                                <xs:simpleType>
                                                        <xs:restriction 
base="StringLength1to64">
                                                                <xs:enumeration 
value="OTA version not supported"/>
                                                                <xs:enumeration 
value="Session has expired"/>
                                                                <xs:enumeration 
value="Session already closed"/>
                                                                <xs:enumeration 
value="Parameter not supported"/>
                                                        </xs:restriction>
                                                </xs:simpleType>
                                                <xs:simpleType>
                                                        <xs:annotation>
                                                                
<xs:documentation xml:lang="en">This is intended to be used
when the above enumeration list does not meet your needs.
</xs:documentation>
                                                        </xs:annotation>
                                                        <xs:restriction 
base="xs:string"/>
                                                </xs:simpleType>
                                        </xs:union>
                                </xs:simpleType>
                        </xs:attribute>
                        <xs:attribute name="DocURL" type="xs:anyURI" 
use="optional">
                                <xs:annotation>
                                        <xs:documentation xml:lang="en">If 
present, this attribute refers
to an online description of the error that
occurred.</xs:documentation>
                                </xs:annotation>
                        </xs:attribute>
                </xs:complexType>
        </xs:element>
</xs:schema>

-------------------------------------------------------------------------
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

Reply via email to