[Erp5-report] r30175 - /erp5/trunk/products/ERP5SyncML/Conduit/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 30 17:50:36 CET 2009


Author: nicolas
Date: Fri Oct 30 17:50:33 2009
New Revision: 30175

URL: http://svn.erp5.org?rev=30175&view=rev
Log:
If there is multiple attributes to update, only the last one was consider. This fix this issue

Modified:
    erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
    erp5/trunk/products/ERP5SyncML/Conduit/ERP5DocumentConduit.py

Modified: erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py?rev=30175&r1=30174&r2=30175&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py [utf8] (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/ERP5Conduit.py [utf8] Fri Oct 30 17:50:33 2009
@@ -792,7 +792,7 @@
   security.declareProtected(Permissions.AccessContentsInformation,'getElementFromXupdate')
   def getElementFromXupdate(self, xml):
     """
-    from a xupdate:element returns the element as xml
+    return a fragment node with applied xupdate
     """
     if xml.xpath('name()') in self.XUPDATE_ELEMENT:
       new_node = Element(xml.attrib.get('name'), nsmap=xml.nsmap)

Modified: erp5/trunk/products/ERP5SyncML/Conduit/ERP5DocumentConduit.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5SyncML/Conduit/ERP5DocumentConduit.py?rev=30175&r1=30174&r2=30175&view=diff
==============================================================================
--- erp5/trunk/products/ERP5SyncML/Conduit/ERP5DocumentConduit.py [utf8] (original)
+++ erp5/trunk/products/ERP5SyncML/Conduit/ERP5DocumentConduit.py [utf8] Fri Oct 30 17:50:33 2009
@@ -127,12 +127,12 @@
               for element in self.getXupdateElementList(subnode):
                 name_element = element.attrib.get('name', None)
                 if name_element:
+                  attrib_dict = {}
                   for sub_element in element:
                     if sub_element.xpath('name()') in 'xupdate:attribute':
-                      name_attribute = sub_element.attrib.get('name')
-                      value_attribute = sub_element.text
+                      attrib_dict[sub_element.attrib.get('name')] = sub_element.text
                   block = etree.SubElement(xml, name_element)
-                  block.set(name_attribute, value_attribute)
+                  block.attrib.update(attrib_dict)
                   #change structure in xupdate because is bad formed
                   value = etree.tostring(element).split('</')[1].split('>')[1]
                   block.text = value




More information about the Erp5-report mailing list