1 /* $Id: d1_absyn.c,v 1.21 2005-06-29 16:52:26 adam Exp $
2 Copyright (C) 1995-2005
5 This file is part of the Zebra server.
7 Zebra is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
12 Zebra is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with Zebra; see the file LICENSE.zebra. If not, write to the
19 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
30 #include <idzebra/data1.h>
31 #include <zebra_xpath.h>
34 #define D1_MAX_NESTING 128
36 struct data1_hash_table {
39 struct data1_hash_entry **ar;
42 struct data1_hash_entry {
45 struct data1_hash_entry *next;
48 unsigned data1_hash_calc(struct data1_hash_table *ht, const char *str)
54 if (*str >= 'a' && *str <= 'z')
55 v = v*65509 + *str -'a'+10;
56 else if (*str >= 'A' && *str <= 'Z')
57 v = v*65509 + *str -'A'+10;
58 else if (*str >= '0' && *str <= '9')
59 v = v*65509 + *str -'0';
65 struct data1_hash_table *data1_hash_open(int size, NMEM nmem)
68 struct data1_hash_table *ht = nmem_malloc(nmem, sizeof(*ht));
73 ht->ar = nmem_malloc(nmem, sizeof(*ht->ar) * ht->size);
74 for (i = 0; i<ht->size; i++)
79 void data1_hash_insert(struct data1_hash_table *ht, const char *str,
80 void *clientData, int copy)
82 char *dstr = copy ? nmem_strdup(ht->nmem, str) : (char*) str;
83 if (strchr(str, '?') || strchr(str, '.'))
86 for (i = 0; i<ht->size; i++)
88 struct data1_hash_entry **he = &ht->ar[i];
89 for (; *he && strcmp(str, (*he)->str); he = &(*he)->next)
93 *he = nmem_malloc(ht->nmem, sizeof(**he));
97 (*he)->clientData = clientData;
102 struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)];
103 for (; *he && strcmp(str, (*he)->str); he = &(*he)->next)
107 *he = nmem_malloc(ht->nmem, sizeof(**he));
111 (*he)->clientData = clientData;
115 void *data1_hash_lookup(struct data1_hash_table *ht, const char *str)
117 struct data1_hash_entry **he = &ht->ar[data1_hash_calc(ht, str)];
119 for (; *he && yaz_matchstr(str, (*he)->str); he = &(*he)->next)
122 return (*he)->clientData;
126 struct data1_systag {
129 struct data1_systag *next;
132 struct data1_absyn_cache_info
136 data1_absyn_cache next;
139 struct data1_attset_cache_info
142 data1_attset *attset;
143 data1_attset_cache next;
146 data1_element *data1_mk_element(data1_handle dh)
148 data1_element *e = nmem_malloc(data1_nmem_get(dh), sizeof(*e));
152 e->next = e->children = 0;
158 data1_absyn *data1_absyn_search (data1_handle dh, const char *name)
160 data1_absyn_cache p = *data1_absyn_cache_get (dh);
164 if (!yaz_matchstr (name, p->name))
171 We need to destroy DFAs, in xp_element (xelm) definitions
175 void data1_absyn_destroy (data1_handle dh)
177 data1_absyn_cache p = *data1_absyn_cache_get (dh);
181 data1_absyn *abs = p->absyn;
184 data1_xpelement *xpe = abs->xp_elements;
186 yaz_log (YLOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr);
187 if (xpe->dfa) { dfa_delete (&xpe->dfa); }
196 void data1_absyn_trav (data1_handle dh, void *handle,
197 void (*fh)(data1_handle dh, void *h, data1_absyn *a))
199 data1_absyn_cache p = *data1_absyn_cache_get (dh);
203 (*fh)(dh, handle, p->absyn);
208 data1_absyn *data1_absyn_add (data1_handle dh, const char *name)
211 NMEM mem = data1_nmem_get (dh);
213 data1_absyn_cache p = (data1_absyn_cache)nmem_malloc (mem, sizeof(*p));
214 data1_absyn_cache *pp = data1_absyn_cache_get (dh);
216 sprintf(fname, "%s.abs", name);
217 p->absyn = data1_read_absyn (dh, fname, 0);
218 p->name = nmem_strdup (mem, name);
224 data1_absyn *data1_get_absyn (data1_handle dh, const char *name)
228 if (!(absyn = data1_absyn_search (dh, name)))
229 absyn = data1_absyn_add (dh, name);
233 data1_attset *data1_attset_search_name (data1_handle dh, const char *name)
235 data1_attset_cache p = *data1_attset_cache_get (dh);
239 if (!yaz_matchstr (name, p->name))
246 data1_attset *data1_attset_search_id (data1_handle dh, int id)
248 data1_attset_cache p = *data1_attset_cache_get (dh);
252 if (id == p->attset->reference)
259 data1_attset *data1_attset_add (data1_handle dh, const char *name)
261 char fname[512], aname[512];
262 NMEM mem = data1_nmem_get (dh);
263 data1_attset *attset;
265 strcpy (aname, name);
266 sprintf(fname, "%s.att", name);
267 attset = data1_read_attset (dh, fname);
271 attset = data1_read_attset (dh, name);
272 if (attset && (cp = strrchr (aname, '.')))
276 yaz_log (YLOG_WARN|YLOG_ERRNO, "Couldn't load attribute set %s", name);
279 data1_attset_cache p = (data1_attset_cache)
280 nmem_malloc (mem, sizeof(*p));
281 data1_attset_cache *pp = data1_attset_cache_get (dh);
283 attset->name = p->name = nmem_strdup (mem, aname);
291 data1_attset *data1_get_attset (data1_handle dh, const char *name)
293 data1_attset *attset;
295 if (!(attset = data1_attset_search_name (dh, name)))
296 attset = data1_attset_add (dh, name);
300 data1_esetname *data1_getesetbyname(data1_handle dh, data1_absyn *a,
305 for (r = a->esetnames; r; r = r->next)
306 if (!data1_matchstr(r->name, name))
311 /* we have multiple versions of data1_getelementbyname */
312 #define DATA1_GETELEMENTBYTAGNAME_VERSION 1
314 #if DATA1_GETELEMENTBYTAGNAME_VERSION==0
315 /* straight linear search */
316 data1_element *data1_getelementbytagname (data1_handle dh, data1_absyn *abs,
317 data1_element *parent,
322 /* It's now possible to have a data1 tree with no abstract syntax */
327 r = abs->main_elements;
329 r = parent->children;
331 for (; r; r = r->next)
335 for (n = r->tag->names; n; n = n->next)
336 if (!data1_matchstr(tagname, n->name))
343 #if DATA1_GETELEMENTBYTAGNAME_VERSION==1
344 /* using hash search */
345 data1_element *data1_getelementbytagname (data1_handle dh, data1_absyn *abs,
346 data1_element *parent,
350 struct data1_hash_table *ht;
352 /* It's now possible to have a data1 tree with no abstract syntax */
357 r = abs->main_elements;
359 r = parent->children;
367 ht = r->hash = data1_hash_open(29, data1_nmem_get(dh));
368 for (; r; r = r->next)
372 for (n = r->tag->names; n; n = n->next)
373 data1_hash_insert(ht, n->name, r, 0);
376 return data1_hash_lookup(ht, tagname);
380 data1_element *data1_getelementbyname (data1_handle dh, data1_absyn *absyn,
385 /* It's now possible to have a data1 tree with no abstract syntax */
388 for (r = absyn->main_elements; r; r = r->next)
389 if (!data1_matchstr(r->name, name))
395 void fix_element_ref (data1_handle dh, data1_absyn *absyn, data1_element *e)
397 /* It's now possible to have a data1 tree with no abstract syntax */
401 for (; e; e = e->next)
406 fix_element_ref (dh, absyn, e->children);
410 data1_sub_elements *sub_e = absyn->sub_elements;
411 while (sub_e && strcmp (e->sub_name, sub_e->name))
414 e->children = sub_e->elements;
416 yaz_log (YLOG_WARN, "Unresolved reference to sub-elements %s",
423 New function, a bit dummy now... I've seen it in zrpn.c... We should build
424 more clever regexps...
436 Now [] predicates are supported
442 static const char * mk_xpath_regexp (data1_handle dh, const char *expr)
444 const char *p = expr;
449 char *res_p, *res = 0;
462 int is_predicate = 0;
465 for (i = 0; *p && !strchr("/",*p); i++, p++)
467 res_size += (i+3); /* we'll add / between later .. */
468 stack[e] = (char *) nmem_malloc(data1_nmem_get(dh), i+1);
470 for (j = 0; j < i; j++)
472 const char *pp = p-i+j;
491 res_p = res = nmem_malloc(data1_nmem_get(dh), res_size + 10);
494 sprintf(res_p, ".*/");
495 res_p = res_p + strlen(res_p);
497 sprintf(res_p, "%s/", stack[e]);
498 res_p += strlen(stack[e]) + 1;
502 sprintf(res_p, ".*");
505 sprintf (res_p, "$");
507 yaz_log(YLOG_DEBUG, "Got regexp: %s", res);
513 added arg xpelement... when called from xelm context, it's 1, saying
514 that ! means xpath, not element name as attribute name...
518 static int parse_termlists (data1_handle dh, data1_termlist ***tpp,
519 char *cp, const char *file, int lineno,
520 const char *element_name, data1_absyn *res,
523 data1_termlist **tp = *tpp;
526 char attname[512], structure[512];
531 for (i = 0; cp[i] && i<sizeof(attname)-1; i++)
532 if (strchr(":,", cp[i]))
540 "%s:%d: Syntax error in termlistspec '%s'",
550 for (i = 0; cp[i] && i<sizeof(structure)-1; i++)
551 if (level == 0 && strchr(",", cp[i]))
555 structure[i] = cp[i];
558 else if (cp[i] == ')')
568 *tp = (data1_termlist *)
569 nmem_malloc(data1_nmem_get(dh), sizeof(**tp));
573 (*tp)->index_name = nmem_strdup(data1_nmem_get(dh), element_name);
574 if (*attname == '!' && xpelement)
575 (*tp)->index_name = 0;
579 strcpy(attname, element_name);
581 if (!((*tp)->att = data1_getattbyname(dh, res->attset, attname)))
583 if ((!xpelement) || (*attname != '!')) {
585 "%s:%d: Couldn't find att '%s' in attset",
586 file, lineno, attname);
593 if (r == 2 && (source = strchr(structure, ':')))
594 *source++ = '\0'; /* cut off structure .. */
596 source = "data"; /* ok: default is leaf data */
597 (*tp)->source = (char *)
598 nmem_strdup (data1_nmem_get (dh), source);
600 if (r < 2) /* is the structure qualified? */
601 (*tp)->structure = "w";
603 (*tp)->structure = (char *)
604 nmem_strdup (data1_nmem_get (dh), structure);
613 * Converts a 'melm' field[$subfield] pattern to a simple xpath
615 static int melm2xpath(char *melm, char *buf)
621 if ((dollar = strchr(melm, '$'))) {
626 if (field[0] == '0' && field[1] == '0')
627 fieldtype = "controlfield";
629 fieldtype = "datafield";
630 sprintf(buf, "/*/%s[@tag=\"%s\"]", fieldtype, field);
632 sprintf(buf + strlen(buf), "/subfield[@code=\"%s\"]", subfield);
633 else if (field[0] != '0' || field[1] != '0')
634 strcat(buf, "/subfield");
635 yaz_log(YLOG_DEBUG, "Created xpath: '%s'", buf);
639 const char *data1_systag_lookup(data1_absyn *absyn, const char *tag,
640 const char *default_value)
642 struct data1_systag *p = absyn->systags;
643 for (; p; p = p->next)
644 if (!strcmp(p->name, tag))
646 return default_value;
649 #define l_isspace(c) ((c) == '\t' || (c) == ' ' || (c) == '\n' || (c) == '\r')
651 int read_absyn_line(FILE *f, int *lineno, char *line, int len,
652 char *argv[], int num)
658 while ((p = fgets(line, len, f)))
661 while (*p && l_isspace(*p))
669 for (argc = 0; *p ; argc++)
671 if (*p == '#') /* trailing comment */
674 while (*p && !(l_isspace(*p) && !quoted)) {
675 if (*p =='"') quoted = 1 - quoted;
676 if (*p =='[') quoted = 1;
677 if (*p ==']') quoted = 0;
683 while (*p && l_isspace(*p))
690 data1_marctab *data1_absyn_getmarctab(data1_handle dh, data1_absyn *absyn)
695 YAZ_EXPORT data1_element *data1_absyn_getelements(data1_handle dh,
698 return absyn->main_elements;
701 data1_absyn *data1_read_absyn (data1_handle dh, const char *file,
704 data1_sub_elements *cur_elements = NULL;
705 data1_xpelement *cur_xpelement = NULL;
707 data1_absyn *res = 0;
709 data1_element **ppl[D1_MAX_NESTING];
710 data1_esetname **esetpp;
711 data1_maptab **maptabp;
712 data1_marctab **marcp;
713 data1_termlist *all = 0;
714 data1_attset_child **attset_childp;
715 data1_tagset **tagset_childp;
716 struct data1_systag **systagsp;
720 char *argv[50], line[512];
722 if (!(f = data1_path_fopen(dh, file, "r")))
724 yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't open %s", file);
729 res = (data1_absyn *) nmem_malloc(data1_nmem_get(dh), sizeof(*res));
731 res->reference = VAL_NONE;
734 res->enable_xpath_indexing = (f ? 0 : 1);
736 systagsp = &res->systags;
737 tagset_childp = &res->tagset;
739 res->attset = data1_empty_attset (dh);
740 attset_childp = &res->attset->children;
744 esetpp = &res->esetnames;
746 maptabp = &res->maptabs;
749 res->sub_elements = NULL;
750 res->main_elements = NULL;
751 res->xp_elements = NULL;
753 while (f && (argc = read_absyn_line(f, &lineno, line, 512, argv, 50)))
756 if (!strcmp(cmd, "elm") || !strcmp(cmd, "element"))
758 data1_element *new_element;
760 char *p, *sub_p, *path, *name, *termlists;
766 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to elm", file, lineno);
775 cur_elements = (data1_sub_elements *)
776 nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements));
777 cur_elements->next = res->sub_elements;
778 cur_elements->elements = NULL;
779 cur_elements->name = "main";
780 res->sub_elements = cur_elements;
783 ppl[level] = &cur_elements->elements;
790 if ((e = strchr(p, '/')))
797 yaz_log(YLOG_WARN, "%s:%d: Bad level increase", file, lineno);
802 new_element = *ppl[level-1] = data1_mk_element(dh);
804 tp = &new_element->termlists;
805 ppl[level-1] = &new_element->next;
806 ppl[level] = &new_element->children;
808 /* consider subtree (if any) ... */
809 if ((sub_p = strchr (p, ':')) && sub_p[1])
812 new_element->sub_name =
813 nmem_strdup (data1_nmem_get(dh), sub_p);
815 /* well-defined tag */
816 if (sscanf(p, "(%d,%d)", &type, &value) == 2)
820 yaz_log(YLOG_WARN, "%s:%d: No tagset loaded", file, lineno);
824 if (!(new_element->tag = data1_gettagbynum (dh, res->tagset,
827 yaz_log(YLOG_WARN, "%s:%d: Couldn't find tag %s in tagset",
837 new_element->tag = (data1_tag *)
838 nmem_malloc(data1_nmem_get (dh),
839 sizeof(*new_element->tag));
840 nt->which = DATA1T_string;
841 nt->value.string = nmem_strdup(data1_nmem_get (dh), p);
842 nt->names = (data1_name *)
843 nmem_malloc(data1_nmem_get(dh),
844 sizeof(*new_element->tag->names));
845 nt->names->name = nt->value.string;
847 nt->kind = DATA1K_string;
853 yaz_log(YLOG_WARN, "%s:%d: Bad element", file, lineno);
857 /* parse termList definitions */
861 assert (res->attset);
863 if (parse_termlists (dh, &tp, p, file, lineno, name, res, 0))
868 *tp = all; /* append any ALL entries to the list */
870 new_element->name = nmem_strdup(data1_nmem_get (dh), name);
873 New code to support xelm directive
874 for each xelm a dfa is built. xelms are stored in res->xp_elements
876 maybe we should use a simple sscanf instead of dfa?
880 Now [] predicates are supported. regexps and xpath structure is
881 a bit redundant, however it's comfortable later...
886 else if (!strcmp(cmd, "xelm") || !strcmp(cmd, "melm")) {
889 char *p, *xpath_expr, *termlists;
891 struct DFA *dfa = dfa = dfa_init();
893 char melm_xpath[128];
897 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to xelm", file, lineno);
901 if (!strcmp(cmd, "melm")) {
902 if (melm2xpath(argv[1], melm_xpath) < 0)
904 xpath_expr = melm_xpath;
906 xpath_expr = argv[1];
909 regexp = mk_xpath_regexp(dh, xpath_expr);
910 i = dfa_parse (dfa, ®exp);
912 yaz_log(YLOG_WARN, "%s:%d: Bad xpath to xelm", file, lineno);
919 cur_xpelement = (data1_xpelement *)
920 nmem_malloc(data1_nmem_get(dh), sizeof(*cur_xpelement));
921 res->xp_elements = cur_xpelement;
923 cur_xpelement->next = (data1_xpelement *)
924 nmem_malloc(data1_nmem_get(dh), sizeof(*cur_xpelement));
925 cur_xpelement = cur_xpelement->next;
927 cur_xpelement->next = NULL;
928 cur_xpelement->xpath_expr = nmem_strdup(data1_nmem_get (dh),
932 cur_xpelement->dfa = dfa;
935 cur_xpelement->xpath_len =
936 zebra_parse_xpath_str(xpath_expr,
937 cur_xpelement->xpath, XPATH_STEP_COUNT,
941 dump_xp_steps(cur_xpelement->xpath,cur_xpelement->xpath_len);
944 cur_xpelement->termlists = 0;
945 tp = &cur_xpelement->termlists;
947 /* parse termList definitions */
951 assert (res->attset);
953 if (parse_termlists (dh, &tp, p, file, lineno,
959 *tp = all; /* append any ALL entries to the list */
962 else if (!strcmp(cmd, "section"))
968 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to section",
974 cur_elements = (data1_sub_elements *)
975 nmem_malloc(data1_nmem_get(dh), sizeof(*cur_elements));
976 cur_elements->next = res->sub_elements;
977 cur_elements->elements = NULL;
978 cur_elements->name = nmem_strdup (data1_nmem_get(dh), name);
979 res->sub_elements = cur_elements;
982 ppl[level] = &cur_elements->elements;
984 else if (!strcmp(cmd, "xpath"))
988 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'xpath' directive",
992 if (!strcmp(argv[1], "enable"))
993 res->enable_xpath_indexing = 1;
994 else if (!strcmp (argv[1], "disable"))
995 res->enable_xpath_indexing = 0;
998 yaz_log(YLOG_WARN, "%s:%d: Expecting disable/enable "
999 "after 'xpath' directive", file, lineno);
1002 else if (!strcmp(cmd, "all"))
1004 data1_termlist **tp = &all;
1007 yaz_log(YLOG_WARN, "%s:%d: Too many 'all' directives - ignored",
1013 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'all' directive",
1017 if (parse_termlists (dh, &tp, argv[1], file, lineno, 0, res, 0))
1023 else if (!strcmp(cmd, "name"))
1027 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to name directive",
1031 res->name = nmem_strdup(data1_nmem_get(dh), argv[1]);
1033 else if (!strcmp(cmd, "reference"))
1039 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to reference",
1044 if ((res->reference = oid_getvalbyname(name)) == VAL_NONE)
1046 yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'",
1047 file, lineno, name);
1051 else if (!strcmp(cmd, "attset"))
1054 yaz_log(YLOG_WARN, "%s:%d: attset obsolete", file, lineno);
1057 data1_attset *attset;
1061 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to attset",
1066 if (!(attset = data1_get_attset (dh, name)))
1068 yaz_log(YLOG_WARN, "%s:%d: Couldn't find attset %s",
1069 file, lineno, name);
1072 *attset_childp = (data1_attset_child *)
1073 nmem_malloc (data1_nmem_get(dh), sizeof(**attset_childp));
1074 (*attset_childp)->child = attset;
1075 (*attset_childp)->next = 0;
1076 attset_childp = &(*attset_childp)->next;
1079 else if (!strcmp(cmd, "tagset"))
1085 yaz_log(YLOG_WARN, "%s:%d: Bad # of args to tagset",
1091 type = atoi(argv[2]);
1092 *tagset_childp = data1_read_tagset (dh, name, type);
1093 if (!(*tagset_childp))
1095 yaz_log(YLOG_WARN, "%s:%d: Couldn't load tagset %s",
1096 file, lineno, name);
1099 tagset_childp = &(*tagset_childp)->next;
1101 else if (!strcmp(cmd, "varset"))
1107 yaz_log(YLOG_WARN, "%s:%d: Bad # of args in varset",
1112 if (!(res->varset = data1_read_varset (dh, name)))
1114 yaz_log(YLOG_WARN, "%s:%d: Couldn't load Varset %s",
1115 file, lineno, name);
1119 else if (!strcmp(cmd, "esetname"))
1125 yaz_log(YLOG_WARN, "%s:%d: Bad # of args in esetname",
1132 *esetpp = (data1_esetname *)
1133 nmem_malloc(data1_nmem_get(dh), sizeof(**esetpp));
1134 (*esetpp)->name = nmem_strdup(data1_nmem_get(dh), name);
1135 (*esetpp)->next = 0;
1137 (*esetpp)->spec = 0;
1138 else if (!((*esetpp)->spec = data1_read_espec1 (dh, fname)))
1140 yaz_log(YLOG_WARN, "%s:%d: Espec-1 read failed for %s",
1141 file, lineno, fname);
1144 esetpp = &(*esetpp)->next;
1146 else if (!strcmp(cmd, "maptab"))
1152 yaz_log(YLOG_WARN, "%s:%d: Bad # of args for maptab",
1157 if (!(*maptabp = data1_read_maptab (dh, name)))
1159 yaz_log(YLOG_WARN, "%s:%d: Couldn't load maptab %s",
1160 file, lineno, name);
1163 maptabp = &(*maptabp)->next;
1165 else if (!strcmp(cmd, "marc"))
1171 yaz_log(YLOG_WARN, "%s:%d: Bad # or args for marc",
1176 if (!(*marcp = data1_read_marctab (dh, name)))
1178 yaz_log(YLOG_WARN, "%s:%d: Couldn't read marctab %s",
1179 file, lineno, name);
1182 marcp = &(*marcp)->next;
1184 else if (!strcmp(cmd, "encoding"))
1188 yaz_log(YLOG_WARN, "%s:%d: Bad # or args for encoding",
1192 res->encoding = nmem_strdup (data1_nmem_get(dh), argv[1]);
1194 else if (!strcmp(cmd, "systag"))
1198 yaz_log(YLOG_WARN, "%s:%d: Bad # or args for systag",
1202 *systagsp = nmem_malloc (data1_nmem_get(dh), sizeof(**systagsp));
1204 (*systagsp)->name = nmem_strdup(data1_nmem_get(dh), argv[1]);
1205 (*systagsp)->value = nmem_strdup(data1_nmem_get(dh), argv[2]);
1206 systagsp = &(*systagsp)->next;
1210 yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,
1218 for (cur_elements = res->sub_elements; cur_elements;
1219 cur_elements = cur_elements->next)
1221 if (!strcmp (cur_elements->name, "main"))
1222 res->main_elements = cur_elements->elements;
1223 fix_element_ref (dh, res, cur_elements->elements);
1226 yaz_log(YLOG_DEBUG, "%s: data1_read_absyn end", file);