Skip to content

Commit

Permalink
The second part of the attribute renaming had the wrong xpath
Browse files Browse the repository at this point in the history
When moving attributes the secondary rename action xpath was
'//LogilabXmldiffTmpAttr<attrib>' which is a tag specification.
Changed this to '//@LogilabXmldiffTmpAttr<attrib>', so an attribute
is specified.
  • Loading branch information
regebro committed Jun 20, 2018
1 parent dfb7f8f commit fa924f6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ CHANGES
1.1.1 (unreleased)
------------------

- Nothing changed yet.
- When moving attributes the secondary rename action xpath was
'//LogilabXmldiffTmpAttr<attrib>' which is a tag specification.
Changed this to '//@LogilabXmldiffTmpAttr<attrib>', so an attribute
is specified.


1.1.0 (2018-06-15)
Expand Down
2 changes: 1 addition & 1 deletion src/xmldiff/fmes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def process_trees(self, tree1, tree2):
self._fmes_step2(tree1, tree2)
# step 3: rename tmp attributes
for tmp_name, real_name in self._tmp_attrs_dict.items():
self.add_action(['rename', '//%s' % tmp_name, real_name])
self.add_action(['rename', '//@%s' % tmp_name, real_name])
# free mapping ref in C extensions
fmes_end()
self._formatter.end()
Expand Down
2 changes: 1 addition & 1 deletion tests/data/test08_result
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@ and improved
[remove, /Tests[1]/Test[5]/Five[1]/b[1]]
[remove, /Tests[1]/Test[6]/Six[1]/b[1]]
[remove, /Tests[1]/Test[9]/Nine[1]/b[2]]
[rename, //LogilabXmldiffTmpAttrtype, type]
[rename, //@LogilabXmldiffTmpAttrtype, type]
2 changes: 1 addition & 1 deletion tests/data/test10_ns_result
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ and improved
[remove, /Tests[1]/Test[5]/Six[1]/b[1]]
[remove, /Tests[1]/Test[8]/Nine[1]/b[1]/text()[2]]
[remove, /Tests[1]/Test[8]/Nine[1]/b[1]/LogilabXMLDIFFFAKETag[1]]
[rename, //LogilabXmldiffTmpAttrtype, type]
[rename, //@LogilabXmldiffTmpAttrtype, type]

0 comments on commit fa924f6

Please sign in to comment.