remapNamespacePrefix: Preserve prefix of attribute names (#255)
Preserve prefix of attribute names when copying them over to the new node. This fixes an unintentional rewrite of `xml:space` to `space` that also caused scour to strip whitespace that should have been preserved. Closes: #239 Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
cc11ef3d5e
commit
9a1286132f
3 changed files with 12 additions and 2 deletions
|
|
@ -3445,7 +3445,7 @@ def remapNamespacePrefix(node, oldprefix, newprefix):
|
|||
attrList = node.attributes
|
||||
for i in range(attrList.length):
|
||||
attr = attrList.item(i)
|
||||
newNode.setAttributeNS(attr.namespaceURI, attr.localName, attr.nodeValue)
|
||||
newNode.setAttributeNS(attr.namespaceURI, attr.name, attr.nodeValue)
|
||||
|
||||
# clone and add all the child nodes
|
||||
for child in node.childNodes:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue