X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=retrieval%2Fd1_prtree.c;h=4354b300cd8e243e6809eeafea8b19b76f5434e3;hb=c9b7cb5f4ca3e9c570d921307e2d44ce32f51801;hp=6f0441218b5eeb484e6b4322e9a4a305ded93671;hpb=651ccb74d12f2968e791b3f411a6c55bca68428a;p=yaz-moved-to-github.git diff --git a/retrieval/d1_prtree.c b/retrieval/d1_prtree.c index 6f04412..4354b30 100644 --- a/retrieval/d1_prtree.c +++ b/retrieval/d1_prtree.c @@ -3,7 +3,7 @@ * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * - * $Id: d1_prtree.c,v 1.8 2002-05-13 14:13:37 adam Exp $ + * $Id: d1_prtree.c,v 1.11 2002-10-08 20:14:44 adam Exp $ */ #include @@ -16,7 +16,7 @@ static void pr_string (FILE *out, const char *str, int len) { int c = str[i]; if (c < 32 || c >126) - fprintf (out, "\\x%02x", c); + fprintf (out, "\\x%02x", c & 255); else fputc (c, out); } @@ -31,7 +31,8 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) fprintf (out, "root abstract syntax=%s\n", n->u.root.type); break; case DATA1N_tag: - fprintf (out, "tag type=%s\n", n->u.tag.tag); + fprintf (out, "tag type=%s sel=%d\n", n->u.tag.tag, + n->u.tag.node_selected); if (n->u.tag.attributes) { data1_xattr *xattr = n->u.tag.attributes; @@ -42,7 +43,11 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) } break; case DATA1N_data: - fprintf (out, "data type="); + case DATA1N_comment: + if (n->which == DATA1N_data) + fprintf (out, "data type="); + else + fprintf (out, "comment type="); switch (n->u.data.what) { case DATA1I_inctxt: @@ -66,11 +71,27 @@ static void pr_tree (data1_handle dh, data1_node *n, FILE *out, int level) pr_string (out, n->u.data.data, n->u.data.len); fprintf (out, "'\n"); break; + case DATA1I_xmltext: + fprintf (out, "xml text '"); + pr_string (out, n->u.data.data, n->u.data.len); + fprintf (out, "'\n"); + break; default: fprintf (out, "unknown(%d)\n", n->u.data.what); break; } break; + case DATA1N_preprocess: + fprintf (out, "preprocess target=%s\n", n->u.preprocess.target); + if (n->u.preprocess.attributes) + { + data1_xattr *xattr = n->u.preprocess.attributes; + fprintf (out, "%*s attr", level, ""); + for (; xattr; xattr = xattr->next) + fprintf (out, " %s=%s ", xattr->name, xattr->value); + fprintf (out, "\n"); + } + break; case DATA1N_variant: fprintf (out, "variant\n"); #if 0