PyXB randomly adds/removes xmlns="http://www.w3.org/1999/xhtml"

79 Views Asked by At

I have an issue where I create a xml string from a schema using PyXB and in some cases when the string is created the namespace xmlns="http://www.w3.org/1999/xhtml" is added. When I recreate the string it is removed. How can it be that it sometimes adds the namespace and sometimes it is not adding it?

An example of how it looks when it is added

<ns1:Testdoc xmlns="http://www.w3.org/1999/xhtml" xmlns:ns1="http://schema.test.com/time/1"><ns1:id>e1a1ba3a-8e5f-417c-8156-23ae80809522</ns1:id></ns1:Testdoc>

An example when it isn't added

<ns1:Testdoc xmlns:ns1="http://schema.test.com/time/1"><ns1:id>e1a1ba3a-8e5f-417c-8156-23ae80809522</ns1:id></ns1:Testdoc>
0

There are 0 best solutions below