| 1095 | |
| 1096 | #ifdef LIBXML_DEBUG_ENABLED |
| 1097 | static void |
| 1098 | xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) { |
| 1099 | int i; |
| 1100 | char shift[100]; |
| 1101 | |
| 1102 | for (i = 0;((i < depth) && (i < 25));i++) |
| 1103 | shift[2 * i] = shift[2 * i + 1] = ' '; |
| 1104 | shift[2 * i] = shift[2 * i + 1] = 0; |
| 1105 | if (cur == NULL) { |
| 1106 | fprintf(output, "%s", shift); |
| 1107 | fprintf(output, "Node is NULL !\n"); |
| 1108 | return; |
| 1109 | |
| 1110 | } |
| 1111 | |
| 1112 | if ((cur->type == XML_DOCUMENT_NODE) || |
| 1113 | (cur->type == XML_HTML_DOCUMENT_NODE)) { |
| 1114 | fprintf(output, "%s", shift); |
| 1115 | fprintf(output, " /\n"); |
| 1116 | } else if (cur->type == XML_ATTRIBUTE_NODE) |
| 1117 | xmlDebugDumpAttr(output, (xmlAttrPtr)cur, depth); |
| 1118 | else |
| 1119 | xmlDebugDumpOneNode(output, cur, depth); |
| 1120 | } |
| 1121 | static void |
| 1122 | xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) { |
| 1123 | xmlNodePtr tmp; |
no test coverage detected