Namespace name assignment fails on xs:any type in certain circumstances
Brought to you by:
pabigot
Temporary namespace identifiers don't get recorded for
<core:v xmlns="http://www.w3.org/1999/xhtml">
<ul>
<li>entry1</li>
<li>entry2</li>
</ul>
</core:v>
should produce a toxml() of:
<core:v xmlns:ns1="http://www.w3.org/1999/xhtml">
<ns1:ul>
<li>entry1</li>
<li>entry2</li></ns1:ul>
</core:v>
instead, it produces:
<core:v xmlns:ns3="http://www.w3.org/1999/xhtml">
<ns1:ul>
<ns2:li>entry1</ns2:li>
<ns3:li>entry2</ns3:li></ns1:ul>
</core:v>
The attached file reproduces the problem and contains a "fix" that gets us at least part way towards the above, by producing:
<core:v xmlns:ns1="http://www.w3.org/1999/xhtml">
<ns1:ul>
<ns1:li>entry1</ns1:li>
<ns1:li>entry2</ns1:li></ns1:ul>
</core:v>
unittest to reproduce the probem. File also contains partial fix we've applied to get around it
Thanks; will look at this soon.
Fixed in commit below. In fact, the output of your test case is the correct output; your "should produce" is missing the namespace qualifier on the inner elements (since PyXB does not preserve the default namespace declaration that was in the original element).
Thanks for the example.
commit 8986944ebe482e48caedfea4bc8adfcd53724438
Author: Peter A. Bigot <pabigot@‌>
Date: Thu Jun 28 06:50:36 2012 -0500