src/aws/flb_aws_util.c
flb_sds_t flb_xml_get_val(char *response, size_t response_len, char *tag)
{
    flb_sds_t val = NULL;
    char *node = NULL;
    char *end;
    int len;

    if (response_len == 0) {
        return NULL;
    }
    node = strstr(response, tag);
    if (!node) {
        flb_debug("[aws] Could not find '%s' tag in API response", tag);
        return NULL;
    }

    /* advance to end of tag */
    node += strlen(tag);

    end = strchr(node, '<');
    if (!end) {
        flb_error("[aws] Could not find end of '%s' node in xml", tag);
        return NULL;
    }
    len = end - node;
    val = flb_sds_create_len(node, len);
    if (!val) {
        flb_errno();
        return NULL;
    }

    return val;
}
/*
 * Parses an XML document and returns the value of the given tag
 * Param `tag` should include angle brackets; ex "<code>"
 */
Parses an XML document and returns the value of the given tag
Param `tag` should include angle brackets; ex ""
Parses an XML document and returns the value of the given tag Param ` tag ` should include angle brackets ; ex " "
flb_sds_t flb_xml_get_val(char *response, size_t response_len, char *tag)
{
    flb_sds_t val = NULL;
    char *node = NULL;
    char *end;
    int len;
    if (response_len == 0) {
        return NULL;
    }
    node = strstr(response, tag);
    if (!node) {
        flb_debug("[aws] Could not find '%s' tag in API response", tag);
        return NULL;
    }
    node += strlen(tag);
    end = strchr(node, '<');
    if (!end) {
        flb_error("[aws] Could not find end of '%s' node in xml", tag);
        return NULL;
    }
    len = end - node;
    val = flb_sds_create_len(node, len);
    if (!val) {
        flb_errno();
        return NULL;
    }
    return val;
}
flb_sds_t flb_xml_get_val ( char * response , size_t response_len , char * tag ) { flb_sds_t val = NULL ; char * node = NULL ; char * end ; int len ; if ( response_len == 0 ) { return NULL ; } node = strstr ( response , tag ) ; if ( ! node ) { flb_debug ( " " , tag ) ; return NULL ; } node += strlen ( tag ) ; end = strchr ( node , ' ' ) ; if ( ! end ) { flb_error ( " " , tag ) ; return NULL ; } len = end - node ; val = flb_sds_create_len ( node , len ) ; if ( ! val ) { flb_errno ( ) ; return NULL ; } return val ; }
Parses an XML document and returns the value of the given tag
 Param `tag` should include angle brackets; ex "<code>"
Parses an XML document and returns the value of the given tag Param ` tag ` should include angle brackets ; ex " <code > "
/* advance to end of tag */