Does pyxb provide the ability to create class definitions in memory, at runtime, from XSD?
Thanks
Yes. Do something like the following; see many examples in the tests/trac directory where this is commonly done.
{{{ import pyxb.binding.generate code = pyxb.binding.generate.GeneratePython(schema_text=xsd) rv = compile(code, 'test', 'exec') eval(rv) instance = CreateFromDocument(xml) }}}
Log in to post a comment.
Does pyxb provide the ability to create class definitions in memory, at runtime, from XSD?
Thanks
Yes. Do something like the following; see many examples in the tests/trac directory where this is commonly done.
{{{
import pyxb.binding.generate
code = pyxb.binding.generate.GeneratePython(schema_text=xsd)
rv = compile(code, 'test', 'exec')
eval(rv)
instance = CreateFromDocument(xml)
}}}