-/* $Id: d1_absyn.c,v 1.21 2005-06-29 16:52:26 adam Exp $
+/* $Id: d1_absyn.c,v 1.22 2006-02-06 23:22:28 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
{
int is_predicate = 0;
char *s;
- int j;
+ int i, j;
for (i = 0; *p && !strchr("/",*p); i++, p++)
;
res_size += (i+3); /* we'll add / between later .. */
}
res_p = res = nmem_malloc(data1_nmem_get(dh), res_size + 10);
- i = 0;
- sprintf(res_p, ".*/");
+ if (stack[e-1][0] == '@') /* path/@attr spec (leaf is attribute) */
+ sprintf(res_p, "/");
+ else
+ sprintf(res_p, "[^@]*/"); /* path .. (index all cdata below it) */
res_p = res_p + strlen(res_p);
while (--e >= 0) {
sprintf(res_p, "%s/", stack[e]);