Extracts a value for the field from an XML-RPC response.
338719
def convert_to_python(self, xmlrpc=None):
        
        if xmlrpc:
            return xmlrpc.get(self.name, self.default)
        elif self.default:
            return self.default
        else:
            return None
496551
def AnalizarXml(self, xml=""):
        ""
        try:
            if not xml:
                xml = self.XmlResponse
            self.xml = SimpleXMLElement(xml)
            return True
        except Exception, e:
            self.Excepcion = u"%s" % (e)
            return False
1297983
def get_xml_type(val):
    """"""
    if type(val).__name__ in ('str', 'unicode'):
        return 'str'
    if type(val).__name__ in ('int', 'long'):
        return 'int'
    if type(val).__name__ == 'float':
        return 'float'
    if type(val).__name__ == 'bool':
        return 'bool'
    if isinstance(val, numbers.Number):
        return 'number'
    if type(val).__name__ == 'NoneType':
        return 'null'
    if isinstance(val, dict):
        return 'dict'
    if isinstance(val, collections.Iterable):
        return 'list'
    return type(val).__name__
1186521
def get_xml_str(self, data):
        

        responses = []
        for tag, value in data.items():
            elem = Element(tag)
            if isinstance(value, dict):
                for value in self.get_xml_str(value):
                    elem.append(value)
            elif isinstance(value, list):
                value = ', '.join([m for m in value])
                elem.text = value
            else:
                elem.text = value
            responses.append(elem)
        return responses
1250602
def parse(self, response, metadata_type):
        
        xml = xmltodict.parse(response.text)
        self.analyze_reply_code(xml_response_dict=xml)
        base = xml.get('RETS', {}).get(metadata_type, {})
        attributes = self.get_attributes(base)

        parsed = []
        if base.get('System') or base.get('SYSTEM'):
            system_obj = {}

            if base.get('SYSTEM', {}).get('@SystemDescription'):
                system_obj['system_id'] = str(base['SYSTEM']['@SystemID'])

            if base.get('SYSTEM', {}).get('@SystemDescription'):
                system_obj['system_description'] = str(base['SYSTEM']['@SystemDescription'])

            if base.get('SYSTEM', {}).get('@TimeZoneOffset'):
                system_obj['timezone_offset'] = str(base['SYSTEM']['@TimeZoneOffset'])

            if base.get('SYSTEM', {}).get('Comments'):
                system_obj['comments'] = base['SYSTEM']['Comments']

            if base.get('@Version'):
                system_obj['version'] = base['@Version']

            parsed.append(system_obj)

        elif 'DATA' in base:
            if not isinstance(base['DATA'], list):  # xmltodict could take single entry XML lists and turn them into str
                base['DATA'] = [base['DATA']]

            for data in base['DATA']:
                data_dict = self.data_columns_to_dict(columns_string=base.get('COLUMNS', ''), dict_string=data)
                data_dict.update(attributes)
                parsed.append(data_dict)

        return parsed
343258
private String extractStringValue(XMLObject xmlo) {
        if (xmlo instanceof XSString) {
            return ((XSString)xmlo).getValue();
        } else if (xmlo instanceof XSAnyImpl) {
            return ((XSAnyImpl)xmlo).getTextContent();
        }
        logger.warn("Unable to map attribute class {} to String. Unknown type. Enable TRACE logging to see attribute name",
                xmlo.getClass());
        return null;
    }
1240094
def get_result_xml(result):
    
    result_xml = Element('result')
    for name, value in [('name', result['name']),
                        ('type', ResultType.get_str(result['type'])),
                        ('severity', result['severity']),
                        ('host', result['host']),
                        ('test_id', result['test_id']),
                        ('port', result['port']),
                        ('qod', result['qod'])]:
        result_xml.set(name, str(value))
    result_xml.text = result['value']
    return result_xml
839108
def getResponsePathValue( path )
       @fieldValue = ""
       e = getResponseElement( path )
       if e and e.is_a?( REXML::Element ) and e.has_text?
          @fieldValue = e.text
       end
       @fieldValue
   end
1229858
def parse_match_info(self, req: Request, name: str, field: Field) -> typing.Any:
        """"""
        return core.get_value(req.match_info, name, field)
1269927
def to_xml_updates(value)
      return if options[:readonly]
      doc = Nokogiri::XML::Document.new
      if value.is_a?(Array)
        value.each do |sub_value|
          sub_field.to_xml_updates(sub_value) do |field_uri_xml, element_xml|
            element_wrapper = doc.create_element(sub_field.tag_name)
            element_wrapper << element_xml
            yield [
              field_uri_xml,
              element_wrapper
            ]
          end
        end
      elsif value.is_a?(Exchanger::Element)
        value.tag_name = tag_name
        if value.class.elements.keys.include?(:text)
          field = value.class.elements[:text]
          yield [
            field.to_xml_field_uri(value),
            field.to_xml(value)
          ]
        else
          # PhysicalAddress ?
          value.class.elements.each do |name, field|
            yield [
              field.to_xml_field_uri(value),
              field.to_xml(value, :only => [name])
            ]
          end
        end
      else # String, Integer, Boolean, ...
        yield [
          self.to_xml_field_uri(value),
          self.to_xml(value)
        ]
      end
    end
327830
def trips_process_xml():
    """"""
    if request.method == 'OPTIONS':
        return {}
    response = request.body.read().decode('utf-8')
    body = json.loads(response)
    xml_str = body.get('xml_str')
    tp = trips.process_xml(xml_str)
    return _stmts_from_proc(tp)
871393
def from_xml_node(cls, node):
        """"""
        return cls(name=node.find("Name").text,
                bit_position=int(node.find("Bitposition").text),
                bit_size=int(node.find("Bitsize").text),
                factor=float(node.find("Factor").text),
                offset=float(node.find("Offset").text),
                min_value=float(node.find("Minimum").text),
                max_value=float(node.find("Maximum").text))
1269348
public function seeResponseIsXMLRPC()
    {
        $result = xmlrpc_decode($this->response);
        \PHPUnit\Framework\Assert::assertNotNull($result, 'Invalid response document returned from XmlRpc server');
    }
127056
def process_xml(self, xml):
        '''
        
        '''
        try:
            root = objectify.fromstring(xml)
            # Get message idenifier from header info
            self.message_identifier = root.imsx_POXHeader.\
                imsx_POXResponseHeaderInfo.\
                imsx_messageIdentifier

            status_node = root.imsx_POXHeader.\
                imsx_POXResponseHeaderInfo.\
                imsx_statusInfo

            # Get status parameters from header info status
            self.code_major = status_node.imsx_codeMajor
            self.severity = status_node.imsx_severity
            self.description = status_node.imsx_description
            self.message_ref_identifier = str(
                status_node.imsx_messageRefIdentifier)
            self.operation = status_node.imsx_operationRefIdentifier

            try:
                # Try to get the score
                self.score = str(root.imsx_POXBody.readResultResponse.
                                 result.resultScore.textString)
            except AttributeError:
                # Not a readResult, just ignore!
                pass
        except:
            pass
363902
private static Object readFieldValue(final Object obj, final Field field) {
    try {
      return field.get(obj);
    } catch (Exception ex) {
      throw new JBBPException("Can't get value from field [" + field + ']', ex);
    }
  }
660182
def _wrap_value_with_context(self, value: dict or str, field_name: str, start: int=0, end: int=0) -> Extraction:
        """"""
        return Extraction(value, self.name, start_token=start, end_token=end, tag=field_name)
815727
def handle_xmlrpc(self, request_text):
        """"""

        response = self._marshaled_dispatch(request_text)

        print('Content-Type: text/xml')
        print('Content-Length: %d' % len(response))
        print()
        sys.stdout.flush()
        sys.stdout.buffer.write(response)
        sys.stdout.buffer.flush()