PyXB说AttributeError:'module'对象

时间:2012-11-15 09:43:27

标签: python xml binding wsdl

我在使用PyXB为WSDL文件创建python绑定时遇到问题。我这样做:

我得到“AttributeError:'module'对象没有属性'CreateFromDOM'”并且没有生成代码。对于另一个WSDL文档,我得到了同样的错误。

有人能给我一些线索吗? 谢谢!

完整堆栈跟踪:

ERROR: Unable to convert DOM node {http://www.w3.org/2001/XMLSchema}schema to Python instance
Traceback (most recent call last):
  File "/home/boehlke/.virtualenvs/env/local/lib/python2.7/site-packages/pyxb/binding/basis.py", line 2047, in append
    value = mr.module().CreateFromDOM(node)
AttributeError: 'module' object has no attribute 'CreateFromDOM'

1 个答案:

答案 0 :(得分:0)

原来,“AttributeError:'module'object ...”是预期的错误。我在源代码中发现了这个注释,其中发生了错误: - )

                                # The module holding XMLSchema bindings
                                # does not have a CreateFromDOM method,
                                # and shouldn't since we need to convert
                                # schema instances to DOM more carefully.
                                # Other namespaces won't have a module if
                                # the bindings were not imported; this is
                                # probably worth a warning.