Menu

#263 annotation IndexError

v2.1
closed-fixed
wstools (22)
5
2009-02-10
2009-02-10
No

If a schema item has one child "annotation", get IndexError because it assumes there is more items available ( like model group ).

$ wsdl2py -x test.xsd
Error loading test.xsd:
list index out of range
Traceback (most recent call last):
File "build/bdist.linux-i686/egg/ZSI/generate/commands.py", line 135, in wsdl2py
wsdl = load(location)
File "build/bdist.linux-i686/egg/ZSI/wstools/XMLSchema.py", line 151, in loadFromFile
schema = self.loadFromStream(file, filename)
File "build/bdist.linux-i686/egg/ZSI/wstools/XMLSchema.py", line 115, in loadFromStream
schema.load(reader)
File "build/bdist.linux-i686/egg/ZSI/wstools/XMLSchema.py", line 1286, in load
tp.fromDom(childNode)
File "build/bdist.linux-i686/egg/ZSI/wstools/XMLSchema.py", line 2474, in fromDom
component = SplitQName(contents[indx].getTagName())[1]
IndexError: list index out of range
boverhof@greece:~/LorenaCarlo/bug$ cat test.xsd
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:test" >

<xsd:complexType name="Result">
<xsd:annotation>
<xsd:documentation>broke</xsd:documentation>
</xsd:annotation>
</xsd:complexType>

</xsd:schema>

Discussion

  • Joshua Boverhof

    Joshua Boverhof - 2009-02-10

    Fixed, Committed in revision 1481

    # svn diff
    Index: XMLSchema.py
    ===================================================================
    --- XMLSchema.py (revision 1480)
    +++ XMLSchema.py (working copy)
    @@ -2471,7 +2471,8 @@
    self.annotation = Annotation(self)
    self.annotation.fromDom(contents[indx])
    indx += 1
    - component = SplitQName(contents[indx].getTagName())[1]
    + if indx < num:
    + component = SplitQName(contents[indx].getTagName())[1]

    self.content = None
    if component == 'simpleContent':

     
  • Joshua Boverhof

    Joshua Boverhof - 2009-02-10
    • status: open --> closed-fixed
     

Log in to post a comment.