-
- /* 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);
-
+ 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);