- xmllint.[c1] : added return code errors for xmllint
- xpath.c: specific debug dump function for result value trees
Daniel
diff --git a/xpath.c b/xpath.c
index 669e4cd..1287d5d 100644
--- a/xpath.c
+++ b/xpath.c
@@ -211,6 +211,27 @@
else
xmlDebugDumpOneNode(output, cur, depth);
}
+void xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) {
+ xmlNodePtr tmp;
+ int i;
+ char shift[100];
+
+ for (i = 0;((i < depth) && (i < 25));i++)
+ shift[2 * i] = shift[2 * i + 1] = ' ';
+ shift[2 * i] = shift[2 * i + 1] = 0;
+ if (cur == NULL) {
+ fprintf(output, shift);
+ fprintf(output, "Node is NULL !\n");
+ return;
+
+ }
+
+ while (cur != NULL) {
+ tmp = cur;
+ cur = cur->next;
+ xmlDebugDumpOneNode(output, tmp, depth);
+ }
+}
void xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
int i;
@@ -235,6 +256,25 @@
}
}
+void xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) {
+ int i;
+ char shift[100];
+
+ for (i = 0;((i < depth) && (i < 25));i++)
+ shift[2 * i] = shift[2 * i + 1] = ' ';
+ shift[2 * i] = shift[2 * i + 1] = 0;
+
+ if ((cur == NULL) || (cur->nodeNr == 0) || (cur->nodeTab[0] == NULL)) {
+ fprintf(output, shift);
+ fprintf(output, "Value Tree is NULL !\n");
+ return;
+
+ }
+
+ fprintf(output, shift);
+ fprintf(output, "%d", i + 1);
+ xmlXPathDebugDumpNodeList(output, cur->nodeTab[0]->children, depth + 1);
+}
#if defined(LIBXML_XPTR_ENABLED)
void xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth);
void xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) {
@@ -284,7 +324,7 @@
break;
case XPATH_XSLT_TREE:
fprintf(output, "Object is an XSLT value tree :\n");
- xmlXPathDebugDumpNode(output, cur->user, depth);
+ xmlXPathDebugDumpValueTree(output, cur->nodesetval, depth);
break;
case XPATH_BOOLEAN:
fprintf(output, "Object is a Boolean : ");