0

我在使用 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'
4

1 回答 1

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.
于 2012-11-16T08:27:04.927 回答