+ /* parsing PI record instructions */
+ if (0 == strncmp((const char *)look, "record", 6))
+ {
+ xmlChar id[256];
+ xmlChar rank[256];
+ xmlChar type[256];
+
+ *id = '\0';
+ *rank = '\0';
+ *type = '\0';
+
+ look += 6;
+
+ /* eat whitespace */
+ while (*look && ' ' == *look && *(look+1))
+ look++;
+
+ /* parse possible id */
+ if (*look && 0 == strncmp((const char *)look, "id=", 3))
+ {
+ look += 3;
+ bval = look;
+ while (*look && ' ' != *look)
+ look++;
+ eval = look;
+ strncpy((char *)id, (const char *)bval, eval - bval);
+ id[eval - bval] = '\0';
+ }
+
+ /* eat whitespace */
+ while (*look && ' ' == *look && *(look+1))
+ look++;
+
+ /* parse possible rank */
+ if (*look && 0 == strncmp((const char *)look, "rank=", 5))
+ {
+ look += 6;
+ bval = look;
+ while (*look && ' ' != *look)
+ look++;
+ eval = look;
+ strncpy((char *)rank, (const char *)bval, eval - bval);
+ rank[eval - bval] = '\0';
+ }
+
+ /* eat whitespace */
+ while (*look && ' ' == *look && *(look+1))
+ look++;
+
+ if (look && '\0' != *look)
+ {
+ xmlChar *node_path = xmlGetNodePath(node);
+ yaz_log(YLOG_WARN,"%s dom filter: "
+ "%s content '%s', can not parse '%s'",
+ tinfo->fname, node_path, pi_p, look);
+ xmlFree(node_path);
+ }
+ else
+ set_record_info(tinfo, extctr, id, rank, 0);
+
+ }
+ /* parsing index instruction */
+ else if (0 == strncmp((const char *)look, "index", 5))
+ {
+ look += 5;
+
+ /* eat whitespace */
+ while (*look && ' ' == *look && *(look+1))
+ look++;
+
+ /* export index instructions to outside */
+ *index_pp = look;
+ }
+ else
+ {
+ xmlChar *node_path = xmlGetNodePath(node);
+ yaz_log(YLOG_WARN,"%s dom filter: "
+ "%s content '%s', can not parse '%s'",
+ tinfo->fname, node_path, pi_p, look);
+ xmlFree(node_path);
+ }
+ }
+}
+
+/* DOM filter style indexing */
+static void process_xml_element_node(struct filter_info *tinfo,
+ struct recExtractCtrl *extctr,
+ RecWord* recword,
+ xmlNodePtr node)
+{
+ /* remember indexing instruction from PI to next element node */
+ xmlChar *index_p = 0;
+
+ /* check if we are an element node in the special zebra namespace
+ and either set record data or index value-of node content*/
+ process_xml_element_zebra_node(tinfo, extctr, recword, node);
+
+ /* loop through kid nodes */
+ for (node = node->children; node; node = node->next)