#155 Namespace name assignment fails on xs:any type in certain circumstances

PyXB 1.1.5
closed
None
fixed
Binding model
major
PyXB 1.1.4
defect
2012-06-28
2012-06-28
No

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>

1 Attachments

Discussion

  • Harold Solbrig

    Harold Solbrig - 2012-06-28

    unittest to reproduce the probem. File also contains partial fix we've applied to get around it

     
  • Peter A. Bigot

    Peter A. Bigot - 2012-06-28
    • status changed from new to accepted
    • version changed from PyXB 1.1.3 to PyXB 1.1.4
    • milestone changed from PyXB 1.1.4 to PyXB 1.1.5

    Thanks; will look at this soon.

     
  • Peter A. Bigot

    Peter A. Bigot - 2012-06-28
    • status changed from accepted to closed
    • resolution set to fixed

    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

    trac/155: Namespace name assignment fails on xs:any type

    Namespace mappings should be preserved when a DOM object is being
    deep-cloned to convert it from one implementation to another. This patch
    also permits re-declaration of a namespace with the same prefix.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks