From d409a21b762853976ff2371f90fc043877723498 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 11 Jan 2010 16:52:25 +0100 Subject: [PATCH] curl_xml plugin: Documented the type-instance behavior a bit better. --- src/curl_xml.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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. */ -- 2.30.2