* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
- * $Id: marcread.c,v 1.15 2002-05-28 21:10:34 adam Exp $
+ * $Id: marcread.c,v 1.16 2002-07-05 12:43:30 adam Exp $
*/
#include <stdio.h>
#include <ctype.h>
#if MARC_DEBUG
FILE *outf = stdout;
#endif
-
- data1_node *res_root;
+ data1_node *res_root, *res_top;
char *absynName;
data1_marctab *marctab;
yaz_log (LOG_WARN, "cannot read MARC without an abstract syntax");
return 0;
}
+ res_top = data1_mk_tag (p->dh, p->mem, absynName, 0, res_root);
marctab = res_root->u.root.absyn->marc;
int i, i0;
char tag[4];
data1_node *res;
- data1_node *parent = res_root;
+ data1_node *parent = res_top;
memcpy (tag, buf+entry_p, 3);
entry_p += 3;
/* generate field node */
- res = data1_mk_tag_n (p->dh, p->mem, tag, 3, 0 /* attr */, res_root);
+ res = data1_mk_tag_n (p->dh, p->mem, tag, 3, 0 /* attr */, parent);
#if MARC_DEBUG
fprintf (outf, "%s ", tag);
* Copyright (C) 1994-2002, Index Data
* All rights reserved.
*
- * $Id: regxread.c,v 1.42 2002-05-07 11:05:20 adam Exp $
+ * $Id: regxread.c,v 1.43 2002-07-05 12:43:30 adam Exp $
*/
#include <stdio.h>
#include <assert.h>
#endif
res = data1_mk_root (spec->dh, spec->m, absynName);
- spec->d1_stack[spec->d1_level] = res;
- spec->d1_stack[++(spec->d1_level)] = NULL;
+ spec->d1_stack[spec->d1_level++] = res;
+
+ res = data1_mk_tag (spec->dh, spec->m, absynName, 0, res);
+
+ spec->d1_stack[spec->d1_level++] = res;
+
+ spec->d1_stack[spec->d1_level] = NULL;
}
else if (!strcmp(argv[1], "element") && argc == 3)
{
#endif
res = data1_mk_root (spec->dh, spec->m, absynName);
- spec->d1_stack[spec->d1_level] = res;
- spec->d1_stack[++(spec->d1_level)] = NULL;
+ spec->d1_stack[spec->d1_level++] = res;
+
+ res = data1_mk_tag (spec->dh, spec->m, absynName, 0, res);
+
+ spec->d1_stack[spec->d1_level++] = res;
+
+ spec->d1_stack[spec->d1_level] = NULL;
}
r = execTok (spec, &s, &cmd_str, &cmd_len);
}