Here the value is a DOM element already, but it's in a micro implementation of DOM used by PyXB which doesn't support the toxml() method. You need to convert it from saxdom to minidom. This is done using the BindingDOMSupport class, which normally defaults to working with minidom.
The full details for converting a complex type instance into a DOM instance are here, but the code below handles the simple case for your example.
I am having an element like:
within a DOM using PyXB 1.2.6-DEV. Unfortunately I cannot find a way to access any possible XML content as a string from the DOM:
How can I get the content '<foo bar="baz"><spamm>eggs</spamm></foo>' of the element from the DOM in this case?
Thank you in advance and best regards.
Here the value is a DOM element already, but it's in a micro implementation of DOM used by PyXB which doesn't support the toxml() method. You need to convert it from saxdom to minidom. This is done using the BindingDOMSupport class, which normally defaults to working with minidom.
The full details for converting a complex type instance into a DOM instance are here, but the code below handles the simple case for your example.
which produces:
Thanks, this is exactly what I needed: