- instance_node_obj =
- cx_evaluate_xpath(xpath_ctx, xpath->plugin_instance_from);
- if (instance_node_obj == NULL)
- return -1; /* error is already logged */
-
- instance_node = instance_node_obj->nodesetval;
- int tmp_size = (instance_node) ? instance_node->nodeNr : 0;
-
- if (tmp_size <= 0) {
- WARNING("curl_xml plugin: "
- "relative xpath expression for 'PluginInstanceFrom' \"%s\" "
- "doesn't match any of the nodes. Skipping the node.",
- xpath->plugin_instance_from);
- xmlXPathFreeObject(instance_node_obj);
- return -1;
- }
-
- if (tmp_size > 1) {
- WARNING("curl_xml plugin: "
- "relative xpath expression for 'PluginInstanceFrom' \"%s\" "
- "is expected to return only one text node. Skipping the node.",
- xpath->plugin_instance_from);
- xmlXPathFreeObject(instance_node_obj);
- return -1;
- }
+ char *node_value = cx_get_text_node_value(
+ xpath_ctx, xpath->plugin_instance_from, "PluginInstanceFrom");