* xmlCtxtDumpOneNode: * @output: the FILE * for the output * @node: the node * @depth: the indentation level. * * Dumps debug information for the element node, it is not recursive */
| 859 | * Dumps debug information for the element node, it is not recursive |
| 860 | */ |
| 861 | static void |
| 862 | xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node) |
| 863 | { |
| 864 | if (node == NULL) { |
| 865 | if (!ctxt->check) { |
| 866 | xmlCtxtDumpSpaces(ctxt); |
| 867 | fprintf(ctxt->output, "node is NULL\n"); |
| 868 | } |
| 869 | return; |
| 870 | } |
| 871 | ctxt->node = node; |
| 872 | |
| 873 | switch (node->type) { |
| 874 | case XML_ELEMENT_NODE: |
| 875 | if (!ctxt->check) { |
| 876 | xmlCtxtDumpSpaces(ctxt); |
| 877 | fprintf(ctxt->output, "ELEMENT "); |
| 878 | if ((node->ns != NULL) && (node->ns->prefix != NULL)) { |
| 879 | xmlCtxtDumpString(ctxt, node->ns->prefix); |
| 880 | fprintf(ctxt->output, ":"); |
| 881 | } |
| 882 | xmlCtxtDumpString(ctxt, node->name); |
| 883 | fprintf(ctxt->output, "\n"); |
| 884 | } |
| 885 | break; |
| 886 | case XML_ATTRIBUTE_NODE: |
| 887 | if (!ctxt->check) |
| 888 | xmlCtxtDumpSpaces(ctxt); |
| 889 | fprintf(ctxt->output, "Error, ATTRIBUTE found here\n"); |
| 890 | xmlCtxtGenericNodeCheck(ctxt, node); |
| 891 | return; |
| 892 | case XML_TEXT_NODE: |
| 893 | if (!ctxt->check) { |
| 894 | xmlCtxtDumpSpaces(ctxt); |
| 895 | if (node->name == (const xmlChar *) xmlStringTextNoenc) |
| 896 | fprintf(ctxt->output, "TEXT no enc"); |
| 897 | else |
| 898 | fprintf(ctxt->output, "TEXT"); |
| 899 | if (ctxt->options & DUMP_TEXT_TYPE) { |
| 900 | if (node->content == (xmlChar *) &(node->properties)) |
| 901 | fprintf(ctxt->output, " compact\n"); |
| 902 | else if (xmlDictOwns(ctxt->dict, node->content) == 1) |
| 903 | fprintf(ctxt->output, " interned\n"); |
| 904 | else |
| 905 | fprintf(ctxt->output, "\n"); |
| 906 | } else |
| 907 | fprintf(ctxt->output, "\n"); |
| 908 | } |
| 909 | break; |
| 910 | case XML_CDATA_SECTION_NODE: |
| 911 | if (!ctxt->check) { |
| 912 | xmlCtxtDumpSpaces(ctxt); |
| 913 | fprintf(ctxt->output, "CDATA_SECTION\n"); |
| 914 | } |
| 915 | break; |
| 916 | case XML_ENTITY_REF_NODE: |
| 917 | if (!ctxt->check) { |
| 918 | xmlCtxtDumpSpaces(ctxt); |
no test coverage detected