PYXB - 名称空间组的生成需要生成到文件

时间:2014-09-26 09:11:06

标签: python pyxb

PYXB - 在运行时生成类定义时,iam面临以下期望

import pyxb.binding.generate

path = "E:/schema/schema.xsd"
code = pyxb.binding.generate.GeneratePython(schema_location=path)
rv = compile(code, 'test', 'exec')
xsd = eval(rv)

上面的代码给出了这个错误

raise pyxb.BindingGenerationError('Generation of namespace groups requires generate-to-files')
pyxb.exceptions_.BindingGenerationError: Generation of namespace groups requires generate-to-file

1 个答案:

答案 0 :(得分:0)

请见the PyXB help forum,有人巧合地同时问同一个问题。奇