ObjectifiedElement.__setitem__ doesn't honor empty namespace

Bug #1402432 reported by KT
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxml
New
Undecided
Unassigned

Bug Description

Assignment to a non-namespaced element inside a namespaced element doesn't seem to work:

XML:

    <aaa:Parent xmlns:aaa="urn:aaa">
     <Child>foo</Child>
    </aaa:Parent>

Code:

    root['{}Child'] = 'bar'

Expected result:

    <aaa:Parent xmlns:aaa="urn:aaa">
      <Child>bar</Child>
    </aaa:Parent>

Actual result:

    <aaa:Parent xmlns:aaa="urn:aaa">
      <Child>foo</Child>
      <aaa:Child>bar</aaa:Child>
    </aaa:Parent>

Python : (2, 7, 6, 0)
lxml.etree : (3, 4, 1, 0)
libxml used : (2, 9, 0)
libxml compiled : (2, 9, 0)
libxslt used : (1, 1, 28)
libxslt compiled : (1, 1, 28)

KT (bintoro)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.