parameters: (self, document=None, xml=None, previous_xml=None, **kw)
return_statement: return conflict_list
docstring: This method is called in updateNode and allows to work on the update of
        elements.
docstring_summary: This method is called in updateNode and allows to work on the update of
        elements.
docstring_tokens: This method is called in updateNode and allows to work on the update of elements .
function: def _updateXupdateUpdate(self, document=None, xml=None, previous_xml=None, **kw):
      """
        This method is called in updateNode and allows to work on the update of
        elements.
      """
      conflict_list = []
      xpath_expression = xml.get('select')
      tag = xpath_expression.split('/')[-1]
      new_value = xml.text
  
      # retrieve the previous xml etree through xpath
      previous_xml = previous_xml.xpath(xpath_expression)
      try:
        previous_value = previous_xml[0].text
      except IndexError:
        raise ValueError(
          'Too little or too many value, only one is required for %s'
          % previous_xml
        )
  
      if isinstance(previous_value, unicode):
        previous_value = previous_value.encode('utf-8')
      if isinstance(new_value, unicode):
        new_value = new_value.encode('utf-8')
  
      # check if it'a work on product or on categories
      if tag.split('[')[0] == 'category':
        # call the method which allows to work on a specific part, the update of
        # categories
        conflict_list += self._updateCategory(document, xml, previous_value, signature=kw['signature'])
      else:
        # getter used to retrieve the current values and to check conflicts
        property_list = ['sale_price', 'purchase_price', 'ean13']
        getter_value_dict = dict(zip(
          property_list, [
            getattr(document, prop, None)
            for prop in property_list
          ]
        ))
  
        # create and fill a conflict when the integration site value, the erp5
        # value and the previous value are differents
        current_value = getter_value_dict[tag]
        if isinstance(current_value, float):
          current_value = '%.6f' % current_value
        if isinstance(current_value, unicode):
          current_value = current_value.encode('utf-8')
        if current_value not in [new_value, previous_value]:
          conflict_list.append(self._generateConflict(path=document.getPhysicalPath(),
                                        tag=tag,
                                        xml=xml,
                                        current_value=current_value,
                                        new_value=new_value,
                                        signature=kw['domain'],
                                        ))
        else:
          keyword = {'product_id': document.getId(), tag: new_value , }
          document.context.product_module.updateProduct(**keyword)
  
      new_document = document.context.product_module[document.getId()]
      document.updateProperties(new_document)
      return conflict_list
function_tokens: def _updateXupdateUpdate ( self , document = None , xml = None , previous_xml = None , * * kw ) : conflict_list = [ ] xpath_expression = xml . get ( 'select' ) tag = xpath_expression . split ( '/' ) [ - 1 ] new_value = xml . text # retrieve the previous xml etree through xpath previous_xml = previous_xml . xpath ( xpath_expression ) try : previous_value = previous_xml [ 0 ] . text except IndexError : raise ValueError ( 'Too little or too many value, only one is required for %s' % previous_xml ) if isinstance ( previous_value , unicode ) : previous_value = previous_value . encode ( 'utf-8' ) if isinstance ( new_value , unicode ) : new_value = new_value . encode ( 'utf-8' ) # check if it'a work on product or on categories if tag . split ( '[' ) [ 0 ] == 'category' : # call the method which allows to work on a specific part, the update of # categories conflict_list += self . _updateCategory ( document , xml , previous_value , signature = kw [ 'signature' ] ) else : # getter used to retrieve the current values and to check conflicts property_list = [ 'sale_price' , 'purchase_price' , 'ean13' ] getter_value_dict = dict ( zip ( property_list , [ getattr ( document , prop , None ) for prop in property_list ] ) ) # create and fill a conflict when the integration site value, the erp5 # value and the previous value are differents current_value = getter_value_dict [ tag ] if isinstance ( current_value , float ) : current_value = '%.6f' % current_value if isinstance ( current_value , unicode ) : current_value = current_value . encode ( 'utf-8' ) if current_value not in [ new_value , previous_value ] : conflict_list . append ( self . _generateConflict ( path = document . getPhysicalPath ( ) , tag = tag , xml = xml , current_value = current_value , new_value = new_value , signature = kw [ 'domain' ] , ) ) else : keyword = { 'product_id' : document . getId ( ) , tag : new_value , } document . context . product_module . updateProduct ( * * keyword ) new_document = document . context . product_module [ document . getId ( ) ] document . updateProperties ( new_document ) return conflict_list