Commit 51c6c3e6 authored by Nicolas Delaby's avatar Nicolas Delaby

Root element was missing in generated Xpath expressions

parent 301152fe
......@@ -67,7 +67,7 @@ class ERP5Diff:
# Declarative interfaces
zope.interface.implements(IERP5Diff,)
__version__ = 0.5
__version__ = 0.6
def __init__(self):
"""
......@@ -511,14 +511,16 @@ class ERP5Diff:
self._result = etree.Element('{%s}modifications' % self._ns, nsmap={'xupdate':self._ns})
self._result.set('version', '1.0')
if self._testElements(old_root_element, new_root_element):
self._testAttributes(old_root_element, new_root_element, '/')
self._compareChildNodes(old_root_element, new_root_element, '/')
qname = old_root_element.xpath('name()')
self._testAttributes(old_root_element, new_root_element, '/%s' % qname)
self._compareChildNodes(old_root_element, new_root_element, '/%s' % qname)
else:
# These XML documents seem to be completely different...
if old_root_element.tag != new_root_element.tag:
self._xupdateRenameElement(new_root_element.tag, '/')
self._testAttributes(old_root_element, new_root_element, '/')
self._xupdateUpdateElement(new_root_element, '/')
self._xupdateRenameElement(new_root_element.xpath('name()'), '/%s' % old_root_element.xpath('name()'))
qname = new_root_element.xpath('name()')
self._testAttributes(old_root_element, new_root_element, '/%s' % qname)
self._compareChildNodes(old_root_element, new_root_element, '/%s' % qname)
finally:
del old_doc
del new_doc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment