+ xmlChar *text = xmlNodeGetContent(node);
+ size_t text_len = strlen((const char *)text);
+
+ /* if there is no text, we do not need to proceed */
+ if (text_len)
+ {
+ /* keep seqno base so that all text will have
+ identical seqno's for multiple fields , e.g
+ <z:index name="title:w any:w title:p">.. */
+
+ zint seqno_base = recword->seqno;
+ zint seqno_max = recword->seqno;
+
+
+ const char *look = index_p;
+ const char *bval;
+ const char *eval;
+
+ xmlChar index[256];
+ xmlChar type[256];
+
+ /* assingning text to be indexed */
+ recword->term_buf = (const char *)text;
+ recword->term_len = text_len;
+
+ /* parsing all index name/type pairs */
+ /* may not start with ' ' or ':' */
+ while (*look && ' ' != *look && ':' != *look)
+ {
+ /* setting name and type to zero */
+ *index = '\0';
+ *type = '\0';
+
+ /* parsing one index name */
+ bval = look;
+ while (*look && ':' != *look && ' ' != *look)
+ {
+ look++;
+ }
+ eval = look;
+ strncpy((char *)index, (const char *)bval, eval - bval);
+ index[eval - bval] = '\0';
+
+
+ /* parsing one index type, if existing */
+ if (':' == *look)
+ {
+ look++;
+
+ bval = look;
+ while (*look && ' ' != *look)
+ {
+ look++;
+ }
+ eval = look;
+ strncpy((char *)type, (const char *)bval, eval - bval);
+ type[eval - bval] = '\0';
+ }
+
+ /* actually indexing the text given */
+
+ recword->seqno = seqno_base;
+ recword->index_name = (const char *)index;
+ if (*type)
+ recword->index_type = (const char *) type;
+
+ /* writing debug out */
+ if (extctr->flagShowRecords)
+ dom_log(YLOG_LOG, tinfo, 0,
+ "INDEX '%s:%s' '%s'",
+ (const char *) index,
+ (const char *) type,
+ (const char *) text);
+
+ (extctr->tokenAdd)(recword);
+
+ if (seqno_max < recword->seqno)
+ seqno_max = recword->seqno;
+
+ /* eat whitespaces */
+ if (*look && ' ' == *look)
+ {
+ look++;
+ }
+ }
+ recword->seqno = seqno_max;
+ }
+ xmlFree(text);