+/* DOM filter style indexing */
+static void process_xml_pi_node(struct filter_info *tinfo,
+ struct recExtractCtrl *extctr,
+ xmlNodePtr node,
+ const char **index_pp)
+{
+ /* if right PI name, continue parsing PI */
+ if (0 == strcmp(zebra_pi_name, (const char *)node->name))
+ {
+ xmlChar *pi_p = node->content;
+ const char *look = (const char *) node->content;
+
+ /* parsing PI record instructions */
+ if (0 == strncmp((const char *)look, "record", 6))
+ {
+ char id[256];
+ char rank[256];
+ char type[256];
+
+ *id = '\0';
+ *rank = '\0';
+ *type = '\0';
+ look += 6;
+ while (*look)
+ if (attr_content_pi(&look, "id", id, sizeof(id)))
+ ;
+ else if (attr_content_pi(&look, "rank", rank, sizeof(rank)))
+ ;
+ else if (attr_content_pi(&look, "type", type, sizeof(type)))
+ {
+ dom_log(YLOG_WARN, tinfo, node,
+ "content '%s', can not parse '%s'",
+ pi_p, look);
+ break;
+ }
+ set_record_info(tinfo, extctr, node, id, rank, type);
+ }
+ /* parsing index instruction */
+ else if (0 == strncmp((const char *)look, "index", 5))
+ {
+ look += 5;
+
+ /* eat whitespace */
+ while (*look && ' ' == *look)
+ look++;
+
+ /* export index instructions to outside */
+ *index_pp = look;
+ }
+ else
+ {
+ dom_log(YLOG_WARN, tinfo, node,
+ "content '%s', can not parse '%s'",
+ pi_p, look);
+ }
+ }
+}