-/* $Id: recgrs.c,v 1.79 2003-05-05 20:14:42 adam Exp $
+/* $Id: recgrs.c,v 1.83 2003-09-16 12:18:24 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
strcpy (p->type, cp+1);
for (gh = h->handlers; gh; gh = gh->next)
{
- if (!memcmp (type, gh->type->type, cp-type))
+ if (!memcmp (type, gh->type->type, cp-type) &&
+ gh->type->type[cp-type] == '\0')
{
if (!gh->initFlag)
{
grs_add_handler (h, recTypeGrs_tcl);
#endif
grs_add_handler (h, recTypeGrs_marc);
+ grs_add_handler (h, recTypeGrs_marcxml);
#if HAVE_EXPAT_H
grs_add_handler (h, recTypeGrs_xml);
#endif
wrd->length = n->u.data.len;
if (p->flagShowRecords)
{
- printf("%*s data=", (level + 1) * 4, "");
+ printf("%*s XData:\"", (level + 1) * 4, "");
for (i = 0; i<wrd->length && i < 8; i++)
fputc (wrd->string[i], stdout);
- printf("\n");
+ printf("\"\n");
}
else {
data1_termlist *tl;
tag_path_full[flen] = 0;
/* If we have a matching termlist... */
- if ((tl = xpath_termlist_by_tagpath(tag_path_full, n))) {
+ if (n->root->u.root.absyn && (tl = xpath_termlist_by_tagpath(tag_path_full, n))) {
for (; tl; tl = tl->next) {
wrd->reg_type = *tl->structure;
/* this is the ! case, so structure is for the xpath index */
tlist->att->parent->name,
tlist->att->name, tlist->att->value,
tlist->source);
- printf (" data=\"");
+ printf (" XData:\"");
for (i = 0; i<wrd->length && i < 40; i++)
fputc (wrd->string[i], stdout);
fputc ('"', stdout);
{
index_termlist (n, n, p, level, wrd);
/* index start tag */
- assert (n->root->u.root.absyn);
- index_xpath (n, p, level, wrd, 1);
+ if (n->root->u.root.absyn)
+ index_xpath (n, p, level, wrd, 1);
}
if (n->child)
printf("%*s", level * 4, "");
printf("Data: ");
if (n->u.data.len > 256)
- printf("'%.240s ... %.6s'\n", n->u.data.data,
- n->u.data.data + n->u.data.len-6);
+ printf("'%.170s ... %.70s'\n", n->u.data.data,
+ n->u.data.data + n->u.data.len-70);
else if (n->u.data.len > 0)
printf("'%.*s'\n", n->u.data.len, n->u.data.data);
else