Lines Matching +full:- +full:- +full:output +full:- +full:document
33 FILE *output; /* the output file */ member
36 xmlDocPtr doc; /* current document */
41 int nodict; /* if the document has no dictionary */
52 ctxt->depth = 0; in xmlCtxtDumpInitCtxt()
53 ctxt->check = 0; in xmlCtxtDumpInitCtxt()
54 ctxt->errors = 0; in xmlCtxtDumpInitCtxt()
55 ctxt->output = stdout; in xmlCtxtDumpInitCtxt()
56 ctxt->doc = NULL; in xmlCtxtDumpInitCtxt()
57 ctxt->node = NULL; in xmlCtxtDumpInitCtxt()
58 ctxt->dict = NULL; in xmlCtxtDumpInitCtxt()
59 ctxt->nodict = 0; in xmlCtxtDumpInitCtxt()
60 ctxt->options = 0; in xmlCtxtDumpInitCtxt()
62 ctxt->shift[i] = ' '; in xmlCtxtDumpInitCtxt()
63 ctxt->shift[100] = 0; in xmlCtxtDumpInitCtxt()
79 * Returns 1 if in scope, -1 in case of argument error,
80 * -2 if the namespace is not in scope, and -3 if not on
89 return(-1); in xmlNsCheckScope()
91 if ((node->type != XML_ELEMENT_NODE) && in xmlNsCheckScope()
92 (node->type != XML_ATTRIBUTE_NODE) && in xmlNsCheckScope()
93 (node->type != XML_DOCUMENT_NODE) && in xmlNsCheckScope()
94 (node->type != XML_TEXT_NODE) && in xmlNsCheckScope()
95 (node->type != XML_HTML_DOCUMENT_NODE) && in xmlNsCheckScope()
96 (node->type != XML_XINCLUDE_START)) in xmlNsCheckScope()
97 return(-2); in xmlNsCheckScope()
100 ((node->type == XML_ELEMENT_NODE) || in xmlNsCheckScope()
101 (node->type == XML_ATTRIBUTE_NODE) || in xmlNsCheckScope()
102 (node->type == XML_TEXT_NODE) || in xmlNsCheckScope()
103 (node->type == XML_XINCLUDE_START))) { in xmlNsCheckScope()
104 if ((node->type == XML_ELEMENT_NODE) || in xmlNsCheckScope()
105 (node->type == XML_XINCLUDE_START)) { in xmlNsCheckScope()
106 cur = node->nsDef; in xmlNsCheckScope()
110 if (xmlStrEqual(cur->prefix, ns->prefix)) in xmlNsCheckScope()
111 return(-2); in xmlNsCheckScope()
112 cur = cur->next; in xmlNsCheckScope()
115 node = node->parent; in xmlNsCheckScope()
117 /* the xml namespace may be declared on the document node */ in xmlNsCheckScope()
119 ((node->type == XML_DOCUMENT_NODE) || in xmlNsCheckScope()
120 (node->type == XML_HTML_DOCUMENT_NODE))) { in xmlNsCheckScope()
121 xmlNsPtr oldNs = ((xmlDocPtr) node)->oldNs; in xmlNsCheckScope()
125 return(-3); in xmlNsCheckScope()
131 if (ctxt->check) in xmlCtxtDumpSpaces()
133 if ((ctxt->output != NULL) && (ctxt->depth > 0)) { in xmlCtxtDumpSpaces()
134 if (ctxt->depth < 50) in xmlCtxtDumpSpaces()
135 fprintf(ctxt->output, "%s", &ctxt->shift[100 - 2 * ctxt->depth]); in xmlCtxtDumpSpaces()
137 fprintf(ctxt->output, "%s", ctxt->shift); in xmlCtxtDumpSpaces()
151 ctxt->errors++; in xmlDebugErr()
152 fprintf(ctxt->output, "ERROR %d: %s", error, msg); in xmlDebugErr()
157 ctxt->errors++; in xmlDebugErr2()
158 fprintf(ctxt->output, "ERROR %d: ", error); in xmlDebugErr2()
159 fprintf(ctxt->output, msg, extra); in xmlDebugErr2()
164 ctxt->errors++; in xmlDebugErr3()
165 fprintf(ctxt->output, "ERROR %d: ", error); in xmlDebugErr3()
166 fprintf(ctxt->output, msg, extra); in xmlDebugErr3()
183 if (ret == -2) { in xmlCtxtNsCheckScope()
184 if (ns->prefix == NULL) in xmlCtxtNsCheckScope()
190 (char *) ns->prefix); in xmlCtxtNsCheckScope()
192 if (ret == -3) { in xmlCtxtNsCheckScope()
193 if (ns->prefix == NULL) in xmlCtxtNsCheckScope()
199 (char *) ns->prefix); in xmlCtxtNsCheckScope()
208 * Do debugging on the string, currently it just checks the UTF-8 content
214 if (ctxt->check) { in xmlCtxtCheckString()
217 "String is not UTF-8 %s", (const char *) str); in xmlCtxtCheckString()
233 if (ctxt->check) { in xmlCtxtCheckName()
242 if ((ctxt->dict != NULL) && in xmlCtxtCheckName()
243 (!xmlDictOwns(ctxt->dict, name)) && in xmlCtxtCheckName()
244 ((ctxt->doc == NULL) || in xmlCtxtCheckName()
245 ((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) { in xmlCtxtCheckName()
247 "Name is not from the document dictionary '%s'", in xmlCtxtCheckName()
258 doc = node->doc; in xmlCtxtGenericNodeCheck()
260 if (node->parent == NULL) in xmlCtxtGenericNodeCheck()
263 if (node->doc == NULL) { in xmlCtxtGenericNodeCheck()
268 dict = doc->dict; in xmlCtxtGenericNodeCheck()
269 if ((dict == NULL) && (ctxt->nodict == 0)) { in xmlCtxtGenericNodeCheck()
270 ctxt->nodict = 1; in xmlCtxtGenericNodeCheck()
272 if (ctxt->doc == NULL) in xmlCtxtGenericNodeCheck()
273 ctxt->doc = doc; in xmlCtxtGenericNodeCheck()
275 if (ctxt->dict == NULL) { in xmlCtxtGenericNodeCheck()
276 ctxt->dict = dict; in xmlCtxtGenericNodeCheck()
279 if ((node->parent != NULL) && (node->doc != node->parent->doc) && in xmlCtxtGenericNodeCheck()
280 (!xmlStrEqual(node->name, BAD_CAST "pseudoroot"))) in xmlCtxtGenericNodeCheck()
283 if (node->prev == NULL) { in xmlCtxtGenericNodeCheck()
284 if (node->type == XML_ATTRIBUTE_NODE) { in xmlCtxtGenericNodeCheck()
285 if ((node->parent != NULL) && in xmlCtxtGenericNodeCheck()
286 (node != (xmlNodePtr) node->parent->properties)) in xmlCtxtGenericNodeCheck()
290 } else if ((node->parent != NULL) && (node->parent->children != node)) in xmlCtxtGenericNodeCheck()
294 if (node->prev->next != node) in xmlCtxtGenericNodeCheck()
296 "Node prev->next : back link wrong\n"); in xmlCtxtGenericNodeCheck()
298 if (node->next == NULL) { in xmlCtxtGenericNodeCheck()
299 if ((node->parent != NULL) && (node->type != XML_ATTRIBUTE_NODE) && in xmlCtxtGenericNodeCheck()
300 (node->parent->last != node) && in xmlCtxtGenericNodeCheck()
301 (node->parent->type == XML_ELEMENT_NODE)) in xmlCtxtGenericNodeCheck()
305 if (node->next->prev != node) in xmlCtxtGenericNodeCheck()
307 "Node next->prev : forward link wrong\n"); in xmlCtxtGenericNodeCheck()
308 if (node->next->parent != node->parent) in xmlCtxtGenericNodeCheck()
310 "Node next->prev : forward link wrong\n"); in xmlCtxtGenericNodeCheck()
312 if (node->type == XML_ELEMENT_NODE) { in xmlCtxtGenericNodeCheck()
315 ns = node->nsDef; in xmlCtxtGenericNodeCheck()
318 ns = ns->next; in xmlCtxtGenericNodeCheck()
320 if (node->ns != NULL) in xmlCtxtGenericNodeCheck()
321 xmlCtxtNsCheckScope(ctxt, node, node->ns); in xmlCtxtGenericNodeCheck()
322 } else if (node->type == XML_ATTRIBUTE_NODE) { in xmlCtxtGenericNodeCheck()
323 if (node->ns != NULL) in xmlCtxtGenericNodeCheck()
324 xmlCtxtNsCheckScope(ctxt, node, node->ns); in xmlCtxtGenericNodeCheck()
327 if ((node->type != XML_ELEMENT_NODE) && in xmlCtxtGenericNodeCheck()
328 (node->type != XML_ATTRIBUTE_NODE) && in xmlCtxtGenericNodeCheck()
329 (node->type != XML_ELEMENT_DECL) && in xmlCtxtGenericNodeCheck()
330 (node->type != XML_ATTRIBUTE_DECL) && in xmlCtxtGenericNodeCheck()
331 (node->type != XML_DTD_NODE) && in xmlCtxtGenericNodeCheck()
332 (node->type != XML_HTML_DOCUMENT_NODE) && in xmlCtxtGenericNodeCheck()
333 (node->type != XML_DOCUMENT_NODE)) { in xmlCtxtGenericNodeCheck()
334 if (node->content != NULL) in xmlCtxtGenericNodeCheck()
335 xmlCtxtCheckString(ctxt, (const xmlChar *) node->content); in xmlCtxtGenericNodeCheck()
337 switch (node->type) { in xmlCtxtGenericNodeCheck()
340 xmlCtxtCheckName(ctxt, node->name); in xmlCtxtGenericNodeCheck()
343 if ((node->name == xmlStringText) || in xmlCtxtGenericNodeCheck()
344 (node->name == xmlStringTextNoenc)) in xmlCtxtGenericNodeCheck()
347 if ((ctxt->dict != NULL) && in xmlCtxtGenericNodeCheck()
348 (node->name == xmlDictLookup(ctxt->dict, BAD_CAST "nbktext", in xmlCtxtGenericNodeCheck()
354 (const char *) node->name); in xmlCtxtGenericNodeCheck()
357 if (node->name == xmlStringComment) in xmlCtxtGenericNodeCheck()
361 (const char *) node->name); in xmlCtxtGenericNodeCheck()
364 xmlCtxtCheckName(ctxt, node->name); in xmlCtxtGenericNodeCheck()
367 if (node->name == NULL) in xmlCtxtGenericNodeCheck()
371 (const char *) node->name); in xmlCtxtGenericNodeCheck()
396 if (ctxt->check) { in xmlCtxtDumpString()
401 fprintf(ctxt->output, "(NULL)"); in xmlCtxtDumpString()
408 fputc(' ', ctxt->output); in xmlCtxtDumpString()
410 fprintf(ctxt->output, "#%X", str[i]); in xmlCtxtDumpString()
412 fputc(str[i], ctxt->output); in xmlCtxtDumpString()
413 fprintf(ctxt->output, "..."); in xmlCtxtDumpString()
422 if (!ctxt->check) in xmlCtxtDumpDtdNode()
423 fprintf(ctxt->output, "DTD node is NULL\n"); in xmlCtxtDumpDtdNode()
427 if (dtd->type != XML_DTD_NODE) { in xmlCtxtDumpDtdNode()
432 if (!ctxt->check) { in xmlCtxtDumpDtdNode()
433 if (dtd->name != NULL) in xmlCtxtDumpDtdNode()
434 fprintf(ctxt->output, "DTD(%s)", (char *) dtd->name); in xmlCtxtDumpDtdNode()
436 fprintf(ctxt->output, "DTD"); in xmlCtxtDumpDtdNode()
437 if (dtd->ExternalID != NULL) in xmlCtxtDumpDtdNode()
438 fprintf(ctxt->output, ", PUBLIC %s", (char *) dtd->ExternalID); in xmlCtxtDumpDtdNode()
439 if (dtd->SystemID != NULL) in xmlCtxtDumpDtdNode()
440 fprintf(ctxt->output, ", SYSTEM %s", (char *) dtd->SystemID); in xmlCtxtDumpDtdNode()
441 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDtdNode()
455 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
456 fprintf(ctxt->output, "Attribute declaration is NULL\n"); in xmlCtxtDumpAttrDecl()
459 if (attr->type != XML_ATTRIBUTE_DECL) { in xmlCtxtDumpAttrDecl()
464 if (attr->name != NULL) { in xmlCtxtDumpAttrDecl()
465 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
466 fprintf(ctxt->output, "ATTRDECL(%s)", (char *) attr->name); in xmlCtxtDumpAttrDecl()
470 if (attr->elem != NULL) { in xmlCtxtDumpAttrDecl()
471 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
472 fprintf(ctxt->output, " for %s", (char *) attr->elem); in xmlCtxtDumpAttrDecl()
476 if (!ctxt->check) { in xmlCtxtDumpAttrDecl()
477 switch (attr->atype) { in xmlCtxtDumpAttrDecl()
479 fprintf(ctxt->output, " CDATA"); in xmlCtxtDumpAttrDecl()
482 fprintf(ctxt->output, " ID"); in xmlCtxtDumpAttrDecl()
485 fprintf(ctxt->output, " IDREF"); in xmlCtxtDumpAttrDecl()
488 fprintf(ctxt->output, " IDREFS"); in xmlCtxtDumpAttrDecl()
491 fprintf(ctxt->output, " ENTITY"); in xmlCtxtDumpAttrDecl()
494 fprintf(ctxt->output, " ENTITIES"); in xmlCtxtDumpAttrDecl()
497 fprintf(ctxt->output, " NMTOKEN"); in xmlCtxtDumpAttrDecl()
500 fprintf(ctxt->output, " NMTOKENS"); in xmlCtxtDumpAttrDecl()
503 fprintf(ctxt->output, " ENUMERATION"); in xmlCtxtDumpAttrDecl()
506 fprintf(ctxt->output, " NOTATION "); in xmlCtxtDumpAttrDecl()
509 if (attr->tree != NULL) { in xmlCtxtDumpAttrDecl()
511 xmlEnumerationPtr cur = attr->tree; in xmlCtxtDumpAttrDecl()
515 fprintf(ctxt->output, "|%s", (char *) cur->name); in xmlCtxtDumpAttrDecl()
517 fprintf(ctxt->output, " (%s", (char *) cur->name); in xmlCtxtDumpAttrDecl()
518 cur = cur->next; in xmlCtxtDumpAttrDecl()
523 fprintf(ctxt->output, ")"); in xmlCtxtDumpAttrDecl()
525 fprintf(ctxt->output, "...)"); in xmlCtxtDumpAttrDecl()
527 switch (attr->def) { in xmlCtxtDumpAttrDecl()
531 fprintf(ctxt->output, " REQUIRED"); in xmlCtxtDumpAttrDecl()
534 fprintf(ctxt->output, " IMPLIED"); in xmlCtxtDumpAttrDecl()
537 fprintf(ctxt->output, " FIXED"); in xmlCtxtDumpAttrDecl()
540 if (attr->defaultValue != NULL) { in xmlCtxtDumpAttrDecl()
541 fprintf(ctxt->output, "\""); in xmlCtxtDumpAttrDecl()
542 xmlCtxtDumpString(ctxt, attr->defaultValue); in xmlCtxtDumpAttrDecl()
543 fprintf(ctxt->output, "\""); in xmlCtxtDumpAttrDecl()
545 fprintf(ctxt->output, "\n"); in xmlCtxtDumpAttrDecl()
560 if (!ctxt->check) in xmlCtxtDumpElemDecl()
561 fprintf(ctxt->output, "Element declaration is NULL\n"); in xmlCtxtDumpElemDecl()
564 if (elem->type != XML_ELEMENT_DECL) { in xmlCtxtDumpElemDecl()
569 if (elem->name != NULL) { in xmlCtxtDumpElemDecl()
570 if (!ctxt->check) { in xmlCtxtDumpElemDecl()
571 fprintf(ctxt->output, "ELEMDECL("); in xmlCtxtDumpElemDecl()
572 xmlCtxtDumpString(ctxt, elem->name); in xmlCtxtDumpElemDecl()
573 fprintf(ctxt->output, ")"); in xmlCtxtDumpElemDecl()
578 if (!ctxt->check) { in xmlCtxtDumpElemDecl()
579 switch (elem->etype) { in xmlCtxtDumpElemDecl()
581 fprintf(ctxt->output, ", UNDEFINED"); in xmlCtxtDumpElemDecl()
584 fprintf(ctxt->output, ", EMPTY"); in xmlCtxtDumpElemDecl()
587 fprintf(ctxt->output, ", ANY"); in xmlCtxtDumpElemDecl()
590 fprintf(ctxt->output, ", MIXED "); in xmlCtxtDumpElemDecl()
593 fprintf(ctxt->output, ", MIXED "); in xmlCtxtDumpElemDecl()
596 if ((elem->type != XML_ELEMENT_NODE) && (elem->content != NULL)) { in xmlCtxtDumpElemDecl()
600 xmlSnprintfElementContent(buf, 5000, elem->content, 1); in xmlCtxtDumpElemDecl()
602 fprintf(ctxt->output, "%s", buf); in xmlCtxtDumpElemDecl()
604 fprintf(ctxt->output, "\n"); in xmlCtxtDumpElemDecl()
619 if (!ctxt->check) in xmlCtxtDumpEntityDecl()
620 fprintf(ctxt->output, "Entity declaration is NULL\n"); in xmlCtxtDumpEntityDecl()
623 if (ent->type != XML_ENTITY_DECL) { in xmlCtxtDumpEntityDecl()
628 if (ent->name != NULL) { in xmlCtxtDumpEntityDecl()
629 if (!ctxt->check) { in xmlCtxtDumpEntityDecl()
630 fprintf(ctxt->output, "ENTITYDECL("); in xmlCtxtDumpEntityDecl()
631 xmlCtxtDumpString(ctxt, ent->name); in xmlCtxtDumpEntityDecl()
632 fprintf(ctxt->output, ")"); in xmlCtxtDumpEntityDecl()
637 if (!ctxt->check) { in xmlCtxtDumpEntityDecl()
638 switch (ent->etype) { in xmlCtxtDumpEntityDecl()
640 fprintf(ctxt->output, ", internal\n"); in xmlCtxtDumpEntityDecl()
643 fprintf(ctxt->output, ", external parsed\n"); in xmlCtxtDumpEntityDecl()
646 fprintf(ctxt->output, ", unparsed\n"); in xmlCtxtDumpEntityDecl()
649 fprintf(ctxt->output, ", parameter\n"); in xmlCtxtDumpEntityDecl()
652 fprintf(ctxt->output, ", external parameter\n"); in xmlCtxtDumpEntityDecl()
655 fprintf(ctxt->output, ", predefined\n"); in xmlCtxtDumpEntityDecl()
658 if (ent->ExternalID) { in xmlCtxtDumpEntityDecl()
660 fprintf(ctxt->output, " ExternalID=%s\n", in xmlCtxtDumpEntityDecl()
661 (char *) ent->ExternalID); in xmlCtxtDumpEntityDecl()
663 if (ent->SystemID) { in xmlCtxtDumpEntityDecl()
665 fprintf(ctxt->output, " SystemID=%s\n", in xmlCtxtDumpEntityDecl()
666 (char *) ent->SystemID); in xmlCtxtDumpEntityDecl()
668 if (ent->URI != NULL) { in xmlCtxtDumpEntityDecl()
670 fprintf(ctxt->output, " URI=%s\n", (char *) ent->URI); in xmlCtxtDumpEntityDecl()
672 if (ent->content) { in xmlCtxtDumpEntityDecl()
674 fprintf(ctxt->output, " content="); in xmlCtxtDumpEntityDecl()
675 xmlCtxtDumpString(ctxt, ent->content); in xmlCtxtDumpEntityDecl()
676 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntityDecl()
692 if (!ctxt->check) in xmlCtxtDumpNamespace()
693 fprintf(ctxt->output, "namespace node is NULL\n"); in xmlCtxtDumpNamespace()
696 if (ns->type != XML_NAMESPACE_DECL) { in xmlCtxtDumpNamespace()
701 if (ns->href == NULL) { in xmlCtxtDumpNamespace()
702 if (ns->prefix != NULL) in xmlCtxtDumpNamespace()
705 (char *) ns->prefix); in xmlCtxtDumpNamespace()
710 if (!ctxt->check) { in xmlCtxtDumpNamespace()
711 if (ns->prefix != NULL) in xmlCtxtDumpNamespace()
712 fprintf(ctxt->output, "namespace %s href=", in xmlCtxtDumpNamespace()
713 (char *) ns->prefix); in xmlCtxtDumpNamespace()
715 fprintf(ctxt->output, "default namespace href="); in xmlCtxtDumpNamespace()
717 xmlCtxtDumpString(ctxt, ns->href); in xmlCtxtDumpNamespace()
718 fprintf(ctxt->output, "\n"); in xmlCtxtDumpNamespace()
728 ns = ns->next; in xmlCtxtDumpNamespaceList()
738 if (!ctxt->check) in xmlCtxtDumpEntity()
739 fprintf(ctxt->output, "Entity is NULL\n"); in xmlCtxtDumpEntity()
742 if (!ctxt->check) { in xmlCtxtDumpEntity()
743 switch (ent->etype) { in xmlCtxtDumpEntity()
745 fprintf(ctxt->output, "INTERNAL_GENERAL_ENTITY "); in xmlCtxtDumpEntity()
748 fprintf(ctxt->output, "EXTERNAL_GENERAL_PARSED_ENTITY "); in xmlCtxtDumpEntity()
751 fprintf(ctxt->output, "EXTERNAL_GENERAL_UNPARSED_ENTITY "); in xmlCtxtDumpEntity()
754 fprintf(ctxt->output, "INTERNAL_PARAMETER_ENTITY "); in xmlCtxtDumpEntity()
757 fprintf(ctxt->output, "EXTERNAL_PARAMETER_ENTITY "); in xmlCtxtDumpEntity()
760 fprintf(ctxt->output, "ENTITY_%d ! ", (int) ent->etype); in xmlCtxtDumpEntity()
762 fprintf(ctxt->output, "%s\n", ent->name); in xmlCtxtDumpEntity()
763 if (ent->ExternalID) { in xmlCtxtDumpEntity()
765 fprintf(ctxt->output, "ExternalID=%s\n", in xmlCtxtDumpEntity()
766 (char *) ent->ExternalID); in xmlCtxtDumpEntity()
768 if (ent->SystemID) { in xmlCtxtDumpEntity()
770 fprintf(ctxt->output, "SystemID=%s\n", (char *) ent->SystemID); in xmlCtxtDumpEntity()
772 if (ent->URI) { in xmlCtxtDumpEntity()
774 fprintf(ctxt->output, "URI=%s\n", (char *) ent->URI); in xmlCtxtDumpEntity()
776 if (ent->content) { in xmlCtxtDumpEntity()
778 fprintf(ctxt->output, "content="); in xmlCtxtDumpEntity()
779 xmlCtxtDumpString(ctxt, ent->content); in xmlCtxtDumpEntity()
780 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntity()
787 * @output: the FILE * for the output
799 if (!ctxt->check) in xmlCtxtDumpAttr()
800 fprintf(ctxt->output, "Attr is NULL"); in xmlCtxtDumpAttr()
803 if (!ctxt->check) { in xmlCtxtDumpAttr()
804 fprintf(ctxt->output, "ATTRIBUTE "); in xmlCtxtDumpAttr()
805 xmlCtxtDumpString(ctxt, attr->name); in xmlCtxtDumpAttr()
806 fprintf(ctxt->output, "\n"); in xmlCtxtDumpAttr()
807 if (attr->children != NULL) { in xmlCtxtDumpAttr()
808 ctxt->depth++; in xmlCtxtDumpAttr()
809 xmlCtxtDumpNodeList(ctxt, attr->children); in xmlCtxtDumpAttr()
810 ctxt->depth--; in xmlCtxtDumpAttr()
813 if (attr->name == NULL) in xmlCtxtDumpAttr()
825 * @output: the FILE * for the output
836 attr = attr->next; in xmlCtxtDumpAttrList()
842 * @output: the FILE * for the output
852 if (!ctxt->check) { in xmlCtxtDumpOneNode()
854 fprintf(ctxt->output, "node is NULL\n"); in xmlCtxtDumpOneNode()
858 ctxt->node = node; in xmlCtxtDumpOneNode()
860 switch (node->type) { in xmlCtxtDumpOneNode()
862 if (!ctxt->check) { in xmlCtxtDumpOneNode()
864 fprintf(ctxt->output, "ELEMENT "); in xmlCtxtDumpOneNode()
865 if ((node->ns != NULL) && (node->ns->prefix != NULL)) { in xmlCtxtDumpOneNode()
866 xmlCtxtDumpString(ctxt, node->ns->prefix); in xmlCtxtDumpOneNode()
867 fprintf(ctxt->output, ":"); in xmlCtxtDumpOneNode()
869 xmlCtxtDumpString(ctxt, node->name); in xmlCtxtDumpOneNode()
870 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
874 if (!ctxt->check) in xmlCtxtDumpOneNode()
876 fprintf(ctxt->output, "Error, ATTRIBUTE found here\n"); in xmlCtxtDumpOneNode()
880 if (!ctxt->check) { in xmlCtxtDumpOneNode()
882 if (node->name == (const xmlChar *) xmlStringTextNoenc) in xmlCtxtDumpOneNode()
883 fprintf(ctxt->output, "TEXT no enc"); in xmlCtxtDumpOneNode()
885 fprintf(ctxt->output, "TEXT"); in xmlCtxtDumpOneNode()
886 if (ctxt->options & DUMP_TEXT_TYPE) { in xmlCtxtDumpOneNode()
887 if (node->content == (xmlChar *) &(node->properties)) in xmlCtxtDumpOneNode()
888 fprintf(ctxt->output, " compact\n"); in xmlCtxtDumpOneNode()
889 else if (xmlDictOwns(ctxt->dict, node->content) == 1) in xmlCtxtDumpOneNode()
890 fprintf(ctxt->output, " interned\n"); in xmlCtxtDumpOneNode()
892 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
894 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
898 if (!ctxt->check) { in xmlCtxtDumpOneNode()
900 fprintf(ctxt->output, "CDATA_SECTION\n"); in xmlCtxtDumpOneNode()
904 if (!ctxt->check) { in xmlCtxtDumpOneNode()
906 fprintf(ctxt->output, "ENTITY_REF(%s)\n", in xmlCtxtDumpOneNode()
907 (char *) node->name); in xmlCtxtDumpOneNode()
911 if (!ctxt->check) { in xmlCtxtDumpOneNode()
913 fprintf(ctxt->output, "ENTITY\n"); in xmlCtxtDumpOneNode()
917 if (!ctxt->check) { in xmlCtxtDumpOneNode()
919 fprintf(ctxt->output, "PI %s\n", (char *) node->name); in xmlCtxtDumpOneNode()
923 if (!ctxt->check) { in xmlCtxtDumpOneNode()
925 fprintf(ctxt->output, "COMMENT\n"); in xmlCtxtDumpOneNode()
930 if (!ctxt->check) { in xmlCtxtDumpOneNode()
933 fprintf(ctxt->output, "Error, DOCUMENT found here\n"); in xmlCtxtDumpOneNode()
937 if (!ctxt->check) { in xmlCtxtDumpOneNode()
939 fprintf(ctxt->output, "DOCUMENT_TYPE\n"); in xmlCtxtDumpOneNode()
943 if (!ctxt->check) { in xmlCtxtDumpOneNode()
945 fprintf(ctxt->output, "DOCUMENT_FRAG\n"); in xmlCtxtDumpOneNode()
949 if (!ctxt->check) { in xmlCtxtDumpOneNode()
951 fprintf(ctxt->output, "NOTATION\n"); in xmlCtxtDumpOneNode()
970 if (!ctxt->check) { in xmlCtxtDumpOneNode()
972 fprintf(ctxt->output, "INCLUDE START\n"); in xmlCtxtDumpOneNode()
976 if (!ctxt->check) { in xmlCtxtDumpOneNode()
978 fprintf(ctxt->output, "INCLUDE END\n"); in xmlCtxtDumpOneNode()
982 if (!ctxt->check) in xmlCtxtDumpOneNode()
985 "Unknown node type %d\n", node->type); in xmlCtxtDumpOneNode()
988 if (node->doc == NULL) { in xmlCtxtDumpOneNode()
989 if (!ctxt->check) { in xmlCtxtDumpOneNode()
992 fprintf(ctxt->output, "PBM: doc == NULL !!!\n"); in xmlCtxtDumpOneNode()
994 ctxt->depth++; in xmlCtxtDumpOneNode()
995 if ((node->type == XML_ELEMENT_NODE) && (node->nsDef != NULL)) in xmlCtxtDumpOneNode()
996 xmlCtxtDumpNamespaceList(ctxt, node->nsDef); in xmlCtxtDumpOneNode()
997 if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) in xmlCtxtDumpOneNode()
998 xmlCtxtDumpAttrList(ctxt, node->properties); in xmlCtxtDumpOneNode()
999 if (node->type != XML_ENTITY_REF_NODE) { in xmlCtxtDumpOneNode()
1000 if ((node->type != XML_ELEMENT_NODE) && (node->content != NULL)) { in xmlCtxtDumpOneNode()
1001 if (!ctxt->check) { in xmlCtxtDumpOneNode()
1003 fprintf(ctxt->output, "content="); in xmlCtxtDumpOneNode()
1004 xmlCtxtDumpString(ctxt, node->content); in xmlCtxtDumpOneNode()
1005 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
1011 ent = xmlGetDocEntity(node->doc, node->name); in xmlCtxtDumpOneNode()
1015 ctxt->depth--; in xmlCtxtDumpOneNode()
1025 * @output: the FILE * for the output
1035 if (!ctxt->check) { in xmlCtxtDumpNode()
1037 fprintf(ctxt->output, "node is NULL\n"); in xmlCtxtDumpNode()
1042 if ((node->type != XML_NAMESPACE_DECL) && in xmlCtxtDumpNode()
1043 (node->children != NULL) && (node->type != XML_ENTITY_REF_NODE)) { in xmlCtxtDumpNode()
1044 ctxt->depth++; in xmlCtxtDumpNode()
1045 xmlCtxtDumpNodeList(ctxt, node->children); in xmlCtxtDumpNode()
1046 ctxt->depth--; in xmlCtxtDumpNode()
1052 * @output: the FILE * for the output
1063 node = node->next; in xmlCtxtDumpNodeList()
1071 if (!ctxt->check) in xmlCtxtDumpDocHead()
1072 fprintf(ctxt->output, "DOCUMENT == NULL !\n"); in xmlCtxtDumpDocHead()
1075 ctxt->node = (xmlNodePtr) doc; in xmlCtxtDumpDocHead()
1077 switch (doc->type) { in xmlCtxtDumpDocHead()
1111 if (!ctxt->check) in xmlCtxtDumpDocHead()
1112 fprintf(ctxt->output, "DOCUMENT\n"); in xmlCtxtDumpDocHead()
1115 if (!ctxt->check) in xmlCtxtDumpDocHead()
1116 fprintf(ctxt->output, "HTML DOCUMENT\n"); in xmlCtxtDumpDocHead()
1132 "Unknown node type %d\n", doc->type); in xmlCtxtDumpDocHead()
1138 * @output: the FILE * for the output
1139 * @doc: the document
1141 * Dumps debug information concerning the document, not recursive
1148 if (!ctxt->check) { in xmlCtxtDumpDocumentHead()
1149 if (doc->name != NULL) { in xmlCtxtDumpDocumentHead()
1150 fprintf(ctxt->output, "name="); in xmlCtxtDumpDocumentHead()
1151 xmlCtxtDumpString(ctxt, BAD_CAST doc->name); in xmlCtxtDumpDocumentHead()
1152 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1154 if (doc->version != NULL) { in xmlCtxtDumpDocumentHead()
1155 fprintf(ctxt->output, "version="); in xmlCtxtDumpDocumentHead()
1156 xmlCtxtDumpString(ctxt, doc->version); in xmlCtxtDumpDocumentHead()
1157 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1159 if (doc->encoding != NULL) { in xmlCtxtDumpDocumentHead()
1160 fprintf(ctxt->output, "encoding="); in xmlCtxtDumpDocumentHead()
1161 xmlCtxtDumpString(ctxt, doc->encoding); in xmlCtxtDumpDocumentHead()
1162 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1164 if (doc->URL != NULL) { in xmlCtxtDumpDocumentHead()
1165 fprintf(ctxt->output, "URL="); in xmlCtxtDumpDocumentHead()
1166 xmlCtxtDumpString(ctxt, doc->URL); in xmlCtxtDumpDocumentHead()
1167 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1169 if (doc->standalone) in xmlCtxtDumpDocumentHead()
1170 fprintf(ctxt->output, "standalone=true\n"); in xmlCtxtDumpDocumentHead()
1172 if (doc->oldNs != NULL) in xmlCtxtDumpDocumentHead()
1173 xmlCtxtDumpNamespaceList(ctxt, doc->oldNs); in xmlCtxtDumpDocumentHead()
1178 * @output: the FILE * for the output
1179 * @doc: the document
1181 * Dumps debug information for the document, it's recursive
1187 if (!ctxt->check) in xmlCtxtDumpDocument()
1188 fprintf(ctxt->output, "DOCUMENT == NULL !\n"); in xmlCtxtDumpDocument()
1192 if (((doc->type == XML_DOCUMENT_NODE) || in xmlCtxtDumpDocument()
1193 (doc->type == XML_HTML_DOCUMENT_NODE)) in xmlCtxtDumpDocument()
1194 && (doc->children != NULL)) { in xmlCtxtDumpDocument()
1195 ctxt->depth++; in xmlCtxtDumpDocument()
1196 xmlCtxtDumpNodeList(ctxt, doc->children); in xmlCtxtDumpDocument()
1197 ctxt->depth--; in xmlCtxtDumpDocument()
1208 if (!ctxt->check) in xmlCtxtDumpEntityCallback()
1209 fprintf(ctxt->output, "Entity is NULL"); in xmlCtxtDumpEntityCallback()
1212 if (!ctxt->check) { in xmlCtxtDumpEntityCallback()
1213 fprintf(ctxt->output, "%s : ", (char *) cur->name); in xmlCtxtDumpEntityCallback()
1214 switch (cur->etype) { in xmlCtxtDumpEntityCallback()
1216 fprintf(ctxt->output, "INTERNAL GENERAL, "); in xmlCtxtDumpEntityCallback()
1219 fprintf(ctxt->output, "EXTERNAL PARSED, "); in xmlCtxtDumpEntityCallback()
1222 fprintf(ctxt->output, "EXTERNAL UNPARSED, "); in xmlCtxtDumpEntityCallback()
1225 fprintf(ctxt->output, "INTERNAL PARAMETER, "); in xmlCtxtDumpEntityCallback()
1228 fprintf(ctxt->output, "EXTERNAL PARAMETER, "); in xmlCtxtDumpEntityCallback()
1232 "Unknown entity type %d\n", cur->etype); in xmlCtxtDumpEntityCallback()
1234 if (cur->ExternalID != NULL) in xmlCtxtDumpEntityCallback()
1235 fprintf(ctxt->output, "ID \"%s\"", (char *) cur->ExternalID); in xmlCtxtDumpEntityCallback()
1236 if (cur->SystemID != NULL) in xmlCtxtDumpEntityCallback()
1237 fprintf(ctxt->output, "SYSTEM \"%s\"", (char *) cur->SystemID); in xmlCtxtDumpEntityCallback()
1238 if (cur->orig != NULL) in xmlCtxtDumpEntityCallback()
1239 fprintf(ctxt->output, "\n orig \"%s\"", (char *) cur->orig); in xmlCtxtDumpEntityCallback()
1240 if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) in xmlCtxtDumpEntityCallback()
1241 fprintf(ctxt->output, "\n content \"%s\"", in xmlCtxtDumpEntityCallback()
1242 (char *) cur->content); in xmlCtxtDumpEntityCallback()
1243 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntityCallback()
1249 * @output: the FILE * for the output
1250 * @doc: the document
1252 * Dumps debug information for all the entities in use by the document
1259 if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) { in xmlCtxtDumpEntities()
1261 doc->intSubset->entities; in xmlCtxtDumpEntities()
1263 if (!ctxt->check) in xmlCtxtDumpEntities()
1264 fprintf(ctxt->output, "Entities in internal subset\n"); in xmlCtxtDumpEntities()
1267 fprintf(ctxt->output, "No entities in internal subset\n"); in xmlCtxtDumpEntities()
1268 if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) { in xmlCtxtDumpEntities()
1270 doc->extSubset->entities; in xmlCtxtDumpEntities()
1272 if (!ctxt->check) in xmlCtxtDumpEntities()
1273 fprintf(ctxt->output, "Entities in external subset\n"); in xmlCtxtDumpEntities()
1275 } else if (!ctxt->check) in xmlCtxtDumpEntities()
1276 fprintf(ctxt->output, "No entities in external subset\n"); in xmlCtxtDumpEntities()
1281 * @output: the FILE * for the output
1290 if (!ctxt->check) in xmlCtxtDumpDTD()
1291 fprintf(ctxt->output, "DTD is NULL\n"); in xmlCtxtDumpDTD()
1295 if (dtd->children == NULL) in xmlCtxtDumpDTD()
1296 fprintf(ctxt->output, " DTD is empty\n"); in xmlCtxtDumpDTD()
1298 ctxt->depth++; in xmlCtxtDumpDTD()
1299 xmlCtxtDumpNodeList(ctxt, dtd->children); in xmlCtxtDumpDTD()
1300 ctxt->depth--; in xmlCtxtDumpDTD()
1312 * @output: the FILE * for the output
1318 xmlDebugDumpString(FILE * output, const xmlChar * str) in xmlDebugDumpString() argument
1322 if (output == NULL) in xmlDebugDumpString()
1323 output = stdout; in xmlDebugDumpString()
1325 fprintf(output, "(NULL)"); in xmlDebugDumpString()
1332 fputc(' ', output); in xmlDebugDumpString()
1334 fprintf(output, "#%X", str[i]); in xmlDebugDumpString()
1336 fputc(str[i], output); in xmlDebugDumpString()
1337 fprintf(output, "..."); in xmlDebugDumpString()
1342 * @output: the FILE * for the output
1349 xmlDebugDumpAttr(FILE *output, xmlAttrPtr attr, int depth) { in xmlDebugDumpAttr() argument
1352 if (output == NULL) return; in xmlDebugDumpAttr()
1354 ctxt.output = output; in xmlDebugDumpAttr()
1363 * @output: the FILE * for the output
1364 * @doc: the document
1366 * Dumps debug information for all the entities in use by the document
1369 xmlDebugDumpEntities(FILE * output, xmlDocPtr doc) in xmlDebugDumpEntities() argument
1373 if (output == NULL) return; in xmlDebugDumpEntities()
1375 ctxt.output = output; in xmlDebugDumpEntities()
1382 * @output: the FILE * for the output
1389 xmlDebugDumpAttrList(FILE * output, xmlAttrPtr attr, int depth) in xmlDebugDumpAttrList() argument
1393 if (output == NULL) return; in xmlDebugDumpAttrList()
1395 ctxt.output = output; in xmlDebugDumpAttrList()
1403 * @output: the FILE * for the output
1410 xmlDebugDumpOneNode(FILE * output, xmlNodePtr node, int depth) in xmlDebugDumpOneNode() argument
1414 if (output == NULL) return; in xmlDebugDumpOneNode()
1416 ctxt.output = output; in xmlDebugDumpOneNode()
1424 * @output: the FILE * for the output
1431 xmlDebugDumpNode(FILE * output, xmlNodePtr node, int depth) in xmlDebugDumpNode() argument
1435 if (output == NULL) in xmlDebugDumpNode()
1436 output = stdout; in xmlDebugDumpNode()
1438 ctxt.output = output; in xmlDebugDumpNode()
1446 * @output: the FILE * for the output
1453 xmlDebugDumpNodeList(FILE * output, xmlNodePtr node, int depth) in xmlDebugDumpNodeList() argument
1457 if (output == NULL) in xmlDebugDumpNodeList()
1458 output = stdout; in xmlDebugDumpNodeList()
1460 ctxt.output = output; in xmlDebugDumpNodeList()
1468 * @output: the FILE * for the output
1469 * @doc: the document
1471 * Dumps debug information concerning the document, not recursive
1474 xmlDebugDumpDocumentHead(FILE * output, xmlDocPtr doc) in xmlDebugDumpDocumentHead() argument
1478 if (output == NULL) in xmlDebugDumpDocumentHead()
1479 output = stdout; in xmlDebugDumpDocumentHead()
1482 ctxt.output = output; in xmlDebugDumpDocumentHead()
1489 * @output: the FILE * for the output
1490 * @doc: the document
1492 * Dumps debug information for the document, it's recursive
1495 xmlDebugDumpDocument(FILE * output, xmlDocPtr doc) in xmlDebugDumpDocument() argument
1499 if (output == NULL) in xmlDebugDumpDocument()
1500 output = stdout; in xmlDebugDumpDocument()
1503 ctxt.output = output; in xmlDebugDumpDocument()
1510 * @output: the FILE * for the output
1516 xmlDebugDumpDTD(FILE * output, xmlDtdPtr dtd) in xmlDebugDumpDTD() argument
1520 if (output == NULL) in xmlDebugDumpDTD()
1521 output = stdout; in xmlDebugDumpDTD()
1524 ctxt.output = output; in xmlDebugDumpDTD()
1537 * @output: the FILE * for the output
1538 * @doc: the document
1540 * Check the document for potential content problems, and output
1541 * the errors to @output
1546 xmlDebugCheckDocument(FILE * output, xmlDocPtr doc) in xmlDebugCheckDocument() argument
1550 if (output == NULL) in xmlDebugCheckDocument()
1551 output = stdout; in xmlDebugCheckDocument()
1553 ctxt.output = output; in xmlDebugCheckDocument()