#114 .toxml() fails when <any namespace="##other" processContents="lax" maxOccurs="unbounded"/> is used

PyXB 1.1.4
Binding model
PyXB 1.1.3

A schema defines an extension point with " <any namespace="##other" processContents="lax" maxOccurs="unbounded"/>".

I create a document containing such an extension with CreateFromDocument(xml). This document cannot be toxml()'ed. The toxml() call fails with

AttributeError: 'Document' object has no attribute 'removeChild'

In reality this is happening with the SAML2 Protocol schema but I have created a simplified example to easily reproduce the problem.

The example contains 5 files:

  • a.py: generated by 'pyxbgen namespace_other_issue.xsd -m a'
  • namespace_other_issue.xml: xml file using the wildcard
  • namespace_other_issue.xsd: schema defining the wildcard
  • namespace_other_issue_support.xsd: not really needed but makes xml schema valid
  • test.py: crashes when executed
5 Attachments


  • Sebastian Annies

  • Peter A. Bigot

    Peter A. Bigot - 2012-01-03
    • status changed from new to closed
    • resolution set to fixed

    Fixed on next branch in commit 5bb94cd. This fix depends on the previous commit which ensures the namespaceURI attribute is correctly set in the DOM instance.

  • Sebastian Annies

    Thank you for the prompt fix!

  • Peter A. Bigot

    Peter A. Bigot - 2012-01-03

    You're welcome; hold on a bit, though, the patch was incomplete when attributes are cloned and I need to update the test before pushing the fix.

  • Peter A. Bigot

    Peter A. Bigot - 2012-01-03

    OK, that should work better. Please open a new ticket if you find something else wrong.


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

Sign up for the SourceForge newsletter:

No, thanks