From: Florian Forster Date: Mon, 11 Jan 2010 15:52:25 +0000 (+0100) Subject: curl_xml plugin: Documented the type-instance behavior a bit better. X-Git-Tag: collectd-4.10.0~72^2~5 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d409a21b762853976ff2371f90fc043877723498;p=collectd.git curl_xml plugin: Documented the type-instance behavior a bit better. --- diff --git a/src/curl_xml.c b/src/curl_xml.c index 3b0a71a8..74ef2e8e 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -346,10 +346,14 @@ static int cx_handle_instance_xpath (xmlXPathContextPtr xpath_ctx, /* {{{ */ memset (vl->type_instance, 0, sizeof (vl->type_instance)); + /* If the base xpath returns more than one block, the result is assumed to be + * a table. The `Instnce' option is not optional in this case. Check for the + * condition and inform the user. */ if (is_table && (vl->type_instance == NULL)) { WARNING ("curl_xml plugin: " - "Base-XPath %s is a table, but no instance-XPath has been defined.", + "Base-XPath %s is a table (more than one result was returned), " + "but no instance-XPath has been defined.", xpath->path); return (-1); } @@ -474,7 +478,7 @@ static int cx_handle_base_xpath (char *plugin_instance, /* {{{ */ xpath_ctx->node = base_nodes->nodeTab[i]; status = cx_handle_instance_xpath (xpath_ctx, xpath, &vl, - /* is_table = */ (total_nodes > 1)); /* FIXME */ + /* is_table = */ (total_nodes > 1)); if (status != 0) continue; /* An error has already been reported. */