- for (child = node->xmlChildrenNode; child != NULL; child = child->next) {
- if ((xmlStrcmp(child->name, (const xmlChar *) "comment") == 0)
- || (xmlStrcmp(child->name, (const xmlChar *) "text") == 0))
- /* ignore */ ;
- else if (xmlStrcmp(child->name, (const xmlChar *) "cf") == 0)
- status = parse_tag_rra_cf(doc, child, cur_rra_def);
- else if (xmlStrcmp(child->name, (const xmlChar *) "pdp_per_row") == 0)
- status = get_int_from_node(doc, child,
- (int *) &cur_rra_def->pdp_cnt);
- else if (xmlStrcmp(child->name, (const xmlChar *) "params") == 0)
- status = parse_tag_rra_params(doc, child, cur_rra_def);
- else if (xmlStrcmp(child->name, (const xmlChar *) "cdp_prep") == 0)
- status = parse_tag_rra_cdp_prep(doc, child, rrd, cur_cdp_prep);
- else if (xmlStrcmp(child->name, (const xmlChar *) "database") == 0)
- status = parse_tag_rra_database(doc, child, rrd);
- else {
- rrd_set_error("parse_tag_rra: Unknown tag: %s", child->name);
- status = -1;
+ while ((element = get_xml_element(reader)) != NULL){
+ if (xmlStrcasecmp(element, (const xmlChar *) "cf") == 0)
+ status = parse_tag_rra_cf(reader, cur_rra_def);
+ else if (xmlStrcasecmp(element, (const xmlChar *) "pdp_per_row") == 0)
+ status = get_xml_ulong(reader,
+ &cur_rra_def->pdp_cnt);
+ else if (atoi(rrd->stat_head->version) == 1
+ && xmlStrcasecmp(element, (const xmlChar *) "xff") == 0)
+ status = get_xml_double(reader,
+ (double *) &cur_rra_def->
+ par[RRA_cdp_xff_val].u_val);
+ else if (atoi(rrd->stat_head->version) >= 2
+ && xmlStrcasecmp(element, (const xmlChar *) "params") == 0){
+ xmlFree(element);
+ status = parse_tag_rra_params(reader, cur_rra_def);
+ if (status == 0)
+ continue;
+ else
+ return status;