• Home
  • Raw
  • Download

Lines Matching refs:ctxt

54 static void xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node);
57 xmlCtxtDumpInitCtxt(xmlDebugCtxtPtr ctxt) in xmlCtxtDumpInitCtxt() argument
61 ctxt->depth = 0; in xmlCtxtDumpInitCtxt()
62 ctxt->check = 0; in xmlCtxtDumpInitCtxt()
63 ctxt->errors = 0; in xmlCtxtDumpInitCtxt()
64 ctxt->output = stdout; in xmlCtxtDumpInitCtxt()
65 ctxt->doc = NULL; in xmlCtxtDumpInitCtxt()
66 ctxt->node = NULL; in xmlCtxtDumpInitCtxt()
67 ctxt->dict = NULL; in xmlCtxtDumpInitCtxt()
68 ctxt->nodict = 0; in xmlCtxtDumpInitCtxt()
69 ctxt->options = 0; in xmlCtxtDumpInitCtxt()
71 ctxt->shift[i] = ' '; in xmlCtxtDumpInitCtxt()
72 ctxt->shift[100] = 0; in xmlCtxtDumpInitCtxt()
76 xmlCtxtDumpCleanCtxt(xmlDebugCtxtPtr ctxt ATTRIBUTE_UNUSED) in xmlCtxtDumpCleanCtxt()
138 xmlCtxtDumpSpaces(xmlDebugCtxtPtr ctxt) in xmlCtxtDumpSpaces() argument
140 if (ctxt->check) in xmlCtxtDumpSpaces()
142 if ((ctxt->output != NULL) && (ctxt->depth > 0)) { in xmlCtxtDumpSpaces()
143 if (ctxt->depth < 50) in xmlCtxtDumpSpaces()
144 fprintf(ctxt->output, "%s", &ctxt->shift[100 - 2 * ctxt->depth]); in xmlCtxtDumpSpaces()
146 fprintf(ctxt->output, "%s", ctxt->shift); in xmlCtxtDumpSpaces()
158 xmlDebugErr(xmlDebugCtxtPtr ctxt, int error, const char *msg) in xmlDebugErr() argument
160 ctxt->errors++; in xmlDebugErr()
162 NULL, ctxt->node, XML_FROM_CHECK, in xmlDebugErr()
168 xmlDebugErr2(xmlDebugCtxtPtr ctxt, int error, const char *msg, int extra) in xmlDebugErr2() argument
170 ctxt->errors++; in xmlDebugErr2()
172 NULL, ctxt->node, XML_FROM_CHECK, in xmlDebugErr2()
178 xmlDebugErr3(xmlDebugCtxtPtr ctxt, int error, const char *msg, const char *extra) in xmlDebugErr3() argument
180 ctxt->errors++; in xmlDebugErr3()
182 NULL, ctxt->node, XML_FROM_CHECK, in xmlDebugErr3()
197 xmlCtxtNsCheckScope(xmlDebugCtxtPtr ctxt, xmlNodePtr node, xmlNsPtr ns) in xmlCtxtNsCheckScope() argument
204 xmlDebugErr(ctxt, XML_CHECK_NS_SCOPE, in xmlCtxtNsCheckScope()
207 xmlDebugErr3(ctxt, XML_CHECK_NS_SCOPE, in xmlCtxtNsCheckScope()
213 xmlDebugErr(ctxt, XML_CHECK_NS_ANCESTOR, in xmlCtxtNsCheckScope()
216 xmlDebugErr3(ctxt, XML_CHECK_NS_ANCESTOR, in xmlCtxtNsCheckScope()
230 xmlCtxtCheckString(xmlDebugCtxtPtr ctxt, const xmlChar * str) in xmlCtxtCheckString() argument
233 if (ctxt->check) { in xmlCtxtCheckString()
235 xmlDebugErr3(ctxt, XML_CHECK_NOT_UTF8, in xmlCtxtCheckString()
250 xmlCtxtCheckName(xmlDebugCtxtPtr ctxt, const xmlChar * name) in xmlCtxtCheckName() argument
252 if (ctxt->check) { in xmlCtxtCheckName()
254 xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL"); in xmlCtxtCheckName()
258 xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME, in xmlCtxtCheckName()
261 if ((ctxt->dict != NULL) && in xmlCtxtCheckName()
262 (!xmlDictOwns(ctxt->dict, name)) && in xmlCtxtCheckName()
263 ((ctxt->doc == NULL) || in xmlCtxtCheckName()
264 ((ctxt->doc->parseFlags & (XML_PARSE_SAX1 | XML_PARSE_NODICT)) == 0))) { in xmlCtxtCheckName()
265 xmlDebugErr3(ctxt, XML_CHECK_OUTSIDE_DICT, in xmlCtxtCheckName()
273 xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) { in xmlCtxtGenericNodeCheck() argument
280 xmlDebugErr(ctxt, XML_CHECK_NO_PARENT, in xmlCtxtGenericNodeCheck()
283 xmlDebugErr(ctxt, XML_CHECK_NO_DOC, in xmlCtxtGenericNodeCheck()
288 if ((dict == NULL) && (ctxt->nodict == 0)) { in xmlCtxtGenericNodeCheck()
292 xmlDebugErr(ctxt, XML_CHECK_NO_DICT, in xmlCtxtGenericNodeCheck()
295 ctxt->nodict = 1; in xmlCtxtGenericNodeCheck()
297 if (ctxt->doc == NULL) in xmlCtxtGenericNodeCheck()
298 ctxt->doc = doc; in xmlCtxtGenericNodeCheck()
300 if (ctxt->dict == NULL) { in xmlCtxtGenericNodeCheck()
301 ctxt->dict = dict; in xmlCtxtGenericNodeCheck()
306 xmlDebugErr(ctxt, XML_CHECK_WRONG_DOC, in xmlCtxtGenericNodeCheck()
312 xmlDebugErr(ctxt, XML_CHECK_NO_PREV, in xmlCtxtGenericNodeCheck()
316 xmlDebugErr(ctxt, XML_CHECK_NO_PREV, in xmlCtxtGenericNodeCheck()
320 xmlDebugErr(ctxt, XML_CHECK_WRONG_PREV, in xmlCtxtGenericNodeCheck()
327 xmlDebugErr(ctxt, XML_CHECK_NO_NEXT, in xmlCtxtGenericNodeCheck()
331 xmlDebugErr(ctxt, XML_CHECK_WRONG_NEXT, in xmlCtxtGenericNodeCheck()
334 xmlDebugErr(ctxt, XML_CHECK_WRONG_PARENT, in xmlCtxtGenericNodeCheck()
342 xmlCtxtNsCheckScope(ctxt, node, ns); in xmlCtxtGenericNodeCheck()
346 xmlCtxtNsCheckScope(ctxt, node, node->ns); in xmlCtxtGenericNodeCheck()
349 xmlCtxtNsCheckScope(ctxt, node, node->ns); in xmlCtxtGenericNodeCheck()
361 xmlCtxtCheckString(ctxt, (const xmlChar *) node->content); in xmlCtxtGenericNodeCheck()
366 xmlCtxtCheckName(ctxt, node->name); in xmlCtxtGenericNodeCheck()
373 if ((ctxt->dict != NULL) && in xmlCtxtGenericNodeCheck()
374 (node->name == xmlDictLookup(ctxt->dict, BAD_CAST "nbktext", in xmlCtxtGenericNodeCheck()
378 xmlDebugErr3(ctxt, XML_CHECK_WRONG_NAME, in xmlCtxtGenericNodeCheck()
385 xmlDebugErr3(ctxt, XML_CHECK_WRONG_NAME, in xmlCtxtGenericNodeCheck()
390 xmlCtxtCheckName(ctxt, node->name); in xmlCtxtGenericNodeCheck()
395 xmlDebugErr3(ctxt, XML_CHECK_NAME_NOT_NULL, in xmlCtxtGenericNodeCheck()
421 xmlCtxtDumpString(xmlDebugCtxtPtr ctxt, const xmlChar * str) in xmlCtxtDumpString() argument
425 if (ctxt->check) { in xmlCtxtDumpString()
430 fprintf(ctxt->output, "(NULL)"); in xmlCtxtDumpString()
437 fputc(' ', ctxt->output); in xmlCtxtDumpString()
439 fprintf(ctxt->output, "#%X", str[i]); in xmlCtxtDumpString()
441 fputc(str[i], ctxt->output); in xmlCtxtDumpString()
442 fprintf(ctxt->output, "..."); in xmlCtxtDumpString()
446 xmlCtxtDumpDtdNode(xmlDebugCtxtPtr ctxt, xmlDtdPtr dtd) in xmlCtxtDumpDtdNode() argument
448 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpDtdNode()
451 if (!ctxt->check) in xmlCtxtDumpDtdNode()
452 fprintf(ctxt->output, "DTD node is NULL\n"); in xmlCtxtDumpDtdNode()
457 xmlDebugErr(ctxt, XML_CHECK_NOT_DTD, in xmlCtxtDumpDtdNode()
461 if (!ctxt->check) { in xmlCtxtDumpDtdNode()
463 fprintf(ctxt->output, "DTD(%s)", (char *) dtd->name); in xmlCtxtDumpDtdNode()
465 fprintf(ctxt->output, "DTD"); in xmlCtxtDumpDtdNode()
467 fprintf(ctxt->output, ", PUBLIC %s", (char *) dtd->ExternalID); in xmlCtxtDumpDtdNode()
469 fprintf(ctxt->output, ", SYSTEM %s", (char *) dtd->SystemID); in xmlCtxtDumpDtdNode()
470 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDtdNode()
475 xmlCtxtGenericNodeCheck(ctxt, (xmlNodePtr) dtd); in xmlCtxtDumpDtdNode()
479 xmlCtxtDumpAttrDecl(xmlDebugCtxtPtr ctxt, xmlAttributePtr attr) in xmlCtxtDumpAttrDecl() argument
481 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpAttrDecl()
484 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
485 fprintf(ctxt->output, "Attribute declaration is NULL\n"); in xmlCtxtDumpAttrDecl()
489 xmlDebugErr(ctxt, XML_CHECK_NOT_ATTR_DECL, in xmlCtxtDumpAttrDecl()
494 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
495 fprintf(ctxt->output, "ATTRDECL(%s)", (char *) attr->name); in xmlCtxtDumpAttrDecl()
497 xmlDebugErr(ctxt, XML_CHECK_NO_NAME, in xmlCtxtDumpAttrDecl()
500 if (!ctxt->check) in xmlCtxtDumpAttrDecl()
501 fprintf(ctxt->output, " for %s", (char *) attr->elem); in xmlCtxtDumpAttrDecl()
503 xmlDebugErr(ctxt, XML_CHECK_NO_ELEM, in xmlCtxtDumpAttrDecl()
505 if (!ctxt->check) { in xmlCtxtDumpAttrDecl()
508 fprintf(ctxt->output, " CDATA"); in xmlCtxtDumpAttrDecl()
511 fprintf(ctxt->output, " ID"); in xmlCtxtDumpAttrDecl()
514 fprintf(ctxt->output, " IDREF"); in xmlCtxtDumpAttrDecl()
517 fprintf(ctxt->output, " IDREFS"); in xmlCtxtDumpAttrDecl()
520 fprintf(ctxt->output, " ENTITY"); in xmlCtxtDumpAttrDecl()
523 fprintf(ctxt->output, " ENTITIES"); in xmlCtxtDumpAttrDecl()
526 fprintf(ctxt->output, " NMTOKEN"); in xmlCtxtDumpAttrDecl()
529 fprintf(ctxt->output, " NMTOKENS"); in xmlCtxtDumpAttrDecl()
532 fprintf(ctxt->output, " ENUMERATION"); in xmlCtxtDumpAttrDecl()
535 fprintf(ctxt->output, " NOTATION "); in xmlCtxtDumpAttrDecl()
544 fprintf(ctxt->output, "|%s", (char *) cur->name); in xmlCtxtDumpAttrDecl()
546 fprintf(ctxt->output, " (%s", (char *) cur->name); in xmlCtxtDumpAttrDecl()
552 fprintf(ctxt->output, ")"); in xmlCtxtDumpAttrDecl()
554 fprintf(ctxt->output, "...)"); in xmlCtxtDumpAttrDecl()
560 fprintf(ctxt->output, " REQUIRED"); in xmlCtxtDumpAttrDecl()
563 fprintf(ctxt->output, " IMPLIED"); in xmlCtxtDumpAttrDecl()
566 fprintf(ctxt->output, " FIXED"); in xmlCtxtDumpAttrDecl()
570 fprintf(ctxt->output, "\""); in xmlCtxtDumpAttrDecl()
571 xmlCtxtDumpString(ctxt, attr->defaultValue); in xmlCtxtDumpAttrDecl()
572 fprintf(ctxt->output, "\""); in xmlCtxtDumpAttrDecl()
574 fprintf(ctxt->output, "\n"); in xmlCtxtDumpAttrDecl()
580 xmlCtxtGenericNodeCheck(ctxt, (xmlNodePtr) attr); in xmlCtxtDumpAttrDecl()
584 xmlCtxtDumpElemDecl(xmlDebugCtxtPtr ctxt, xmlElementPtr elem) in xmlCtxtDumpElemDecl() argument
586 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpElemDecl()
589 if (!ctxt->check) in xmlCtxtDumpElemDecl()
590 fprintf(ctxt->output, "Element declaration is NULL\n"); in xmlCtxtDumpElemDecl()
594 xmlDebugErr(ctxt, XML_CHECK_NOT_ELEM_DECL, in xmlCtxtDumpElemDecl()
599 if (!ctxt->check) { in xmlCtxtDumpElemDecl()
600 fprintf(ctxt->output, "ELEMDECL("); in xmlCtxtDumpElemDecl()
601 xmlCtxtDumpString(ctxt, elem->name); in xmlCtxtDumpElemDecl()
602 fprintf(ctxt->output, ")"); in xmlCtxtDumpElemDecl()
605 xmlDebugErr(ctxt, XML_CHECK_NO_NAME, in xmlCtxtDumpElemDecl()
607 if (!ctxt->check) { in xmlCtxtDumpElemDecl()
610 fprintf(ctxt->output, ", UNDEFINED"); in xmlCtxtDumpElemDecl()
613 fprintf(ctxt->output, ", EMPTY"); in xmlCtxtDumpElemDecl()
616 fprintf(ctxt->output, ", ANY"); in xmlCtxtDumpElemDecl()
619 fprintf(ctxt->output, ", MIXED "); in xmlCtxtDumpElemDecl()
622 fprintf(ctxt->output, ", MIXED "); in xmlCtxtDumpElemDecl()
631 fprintf(ctxt->output, "%s", buf); in xmlCtxtDumpElemDecl()
633 fprintf(ctxt->output, "\n"); in xmlCtxtDumpElemDecl()
639 xmlCtxtGenericNodeCheck(ctxt, (xmlNodePtr) elem); in xmlCtxtDumpElemDecl()
643 xmlCtxtDumpEntityDecl(xmlDebugCtxtPtr ctxt, xmlEntityPtr ent) in xmlCtxtDumpEntityDecl() argument
645 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntityDecl()
648 if (!ctxt->check) in xmlCtxtDumpEntityDecl()
649 fprintf(ctxt->output, "Entity declaration is NULL\n"); in xmlCtxtDumpEntityDecl()
653 xmlDebugErr(ctxt, XML_CHECK_NOT_ENTITY_DECL, in xmlCtxtDumpEntityDecl()
658 if (!ctxt->check) { in xmlCtxtDumpEntityDecl()
659 fprintf(ctxt->output, "ENTITYDECL("); in xmlCtxtDumpEntityDecl()
660 xmlCtxtDumpString(ctxt, ent->name); in xmlCtxtDumpEntityDecl()
661 fprintf(ctxt->output, ")"); in xmlCtxtDumpEntityDecl()
664 xmlDebugErr(ctxt, XML_CHECK_NO_NAME, in xmlCtxtDumpEntityDecl()
666 if (!ctxt->check) { in xmlCtxtDumpEntityDecl()
669 fprintf(ctxt->output, ", internal\n"); in xmlCtxtDumpEntityDecl()
672 fprintf(ctxt->output, ", external parsed\n"); in xmlCtxtDumpEntityDecl()
675 fprintf(ctxt->output, ", unparsed\n"); in xmlCtxtDumpEntityDecl()
678 fprintf(ctxt->output, ", parameter\n"); in xmlCtxtDumpEntityDecl()
681 fprintf(ctxt->output, ", external parameter\n"); in xmlCtxtDumpEntityDecl()
684 fprintf(ctxt->output, ", predefined\n"); in xmlCtxtDumpEntityDecl()
688 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntityDecl()
689 fprintf(ctxt->output, " ExternalID=%s\n", in xmlCtxtDumpEntityDecl()
693 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntityDecl()
694 fprintf(ctxt->output, " SystemID=%s\n", in xmlCtxtDumpEntityDecl()
698 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntityDecl()
699 fprintf(ctxt->output, " URI=%s\n", (char *) ent->URI); in xmlCtxtDumpEntityDecl()
702 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntityDecl()
703 fprintf(ctxt->output, " content="); in xmlCtxtDumpEntityDecl()
704 xmlCtxtDumpString(ctxt, ent->content); in xmlCtxtDumpEntityDecl()
705 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntityDecl()
712 xmlCtxtGenericNodeCheck(ctxt, (xmlNodePtr) ent); in xmlCtxtDumpEntityDecl()
716 xmlCtxtDumpNamespace(xmlDebugCtxtPtr ctxt, xmlNsPtr ns) in xmlCtxtDumpNamespace() argument
718 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpNamespace()
721 if (!ctxt->check) in xmlCtxtDumpNamespace()
722 fprintf(ctxt->output, "namespace node is NULL\n"); in xmlCtxtDumpNamespace()
726 xmlDebugErr(ctxt, XML_CHECK_NOT_NS_DECL, in xmlCtxtDumpNamespace()
732 xmlDebugErr3(ctxt, XML_CHECK_NO_HREF, in xmlCtxtDumpNamespace()
736 xmlDebugErr(ctxt, XML_CHECK_NO_HREF, in xmlCtxtDumpNamespace()
739 if (!ctxt->check) { in xmlCtxtDumpNamespace()
741 fprintf(ctxt->output, "namespace %s href=", in xmlCtxtDumpNamespace()
744 fprintf(ctxt->output, "default namespace href="); in xmlCtxtDumpNamespace()
746 xmlCtxtDumpString(ctxt, ns->href); in xmlCtxtDumpNamespace()
747 fprintf(ctxt->output, "\n"); in xmlCtxtDumpNamespace()
753 xmlCtxtDumpNamespaceList(xmlDebugCtxtPtr ctxt, xmlNsPtr ns) in xmlCtxtDumpNamespaceList() argument
756 xmlCtxtDumpNamespace(ctxt, ns); in xmlCtxtDumpNamespaceList()
762 xmlCtxtDumpEntity(xmlDebugCtxtPtr ctxt, xmlEntityPtr ent) in xmlCtxtDumpEntity() argument
764 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntity()
767 if (!ctxt->check) in xmlCtxtDumpEntity()
768 fprintf(ctxt->output, "Entity is NULL\n"); in xmlCtxtDumpEntity()
771 if (!ctxt->check) { in xmlCtxtDumpEntity()
774 fprintf(ctxt->output, "INTERNAL_GENERAL_ENTITY "); in xmlCtxtDumpEntity()
777 fprintf(ctxt->output, "EXTERNAL_GENERAL_PARSED_ENTITY "); in xmlCtxtDumpEntity()
780 fprintf(ctxt->output, "EXTERNAL_GENERAL_UNPARSED_ENTITY "); in xmlCtxtDumpEntity()
783 fprintf(ctxt->output, "INTERNAL_PARAMETER_ENTITY "); in xmlCtxtDumpEntity()
786 fprintf(ctxt->output, "EXTERNAL_PARAMETER_ENTITY "); in xmlCtxtDumpEntity()
789 fprintf(ctxt->output, "ENTITY_%d ! ", (int) ent->etype); in xmlCtxtDumpEntity()
791 fprintf(ctxt->output, "%s\n", ent->name); in xmlCtxtDumpEntity()
793 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntity()
794 fprintf(ctxt->output, "ExternalID=%s\n", in xmlCtxtDumpEntity()
798 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntity()
799 fprintf(ctxt->output, "SystemID=%s\n", (char *) ent->SystemID); in xmlCtxtDumpEntity()
802 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntity()
803 fprintf(ctxt->output, "URI=%s\n", (char *) ent->URI); in xmlCtxtDumpEntity()
806 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpEntity()
807 fprintf(ctxt->output, "content="); in xmlCtxtDumpEntity()
808 xmlCtxtDumpString(ctxt, ent->content); in xmlCtxtDumpEntity()
809 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntity()
823 xmlCtxtDumpAttr(xmlDebugCtxtPtr ctxt, xmlAttrPtr attr) in xmlCtxtDumpAttr() argument
825 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpAttr()
828 if (!ctxt->check) in xmlCtxtDumpAttr()
829 fprintf(ctxt->output, "Attr is NULL"); in xmlCtxtDumpAttr()
832 if (!ctxt->check) { in xmlCtxtDumpAttr()
833 fprintf(ctxt->output, "ATTRIBUTE "); in xmlCtxtDumpAttr()
834 xmlCtxtDumpString(ctxt, attr->name); in xmlCtxtDumpAttr()
835 fprintf(ctxt->output, "\n"); in xmlCtxtDumpAttr()
837 ctxt->depth++; in xmlCtxtDumpAttr()
838 xmlCtxtDumpNodeList(ctxt, attr->children); in xmlCtxtDumpAttr()
839 ctxt->depth--; in xmlCtxtDumpAttr()
843 xmlDebugErr(ctxt, XML_CHECK_NO_NAME, in xmlCtxtDumpAttr()
849 xmlCtxtGenericNodeCheck(ctxt, (xmlNodePtr) attr); in xmlCtxtDumpAttr()
861 xmlCtxtDumpAttrList(xmlDebugCtxtPtr ctxt, xmlAttrPtr attr) in xmlCtxtDumpAttrList() argument
864 xmlCtxtDumpAttr(ctxt, attr); in xmlCtxtDumpAttrList()
878 xmlCtxtDumpOneNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node) in xmlCtxtDumpOneNode() argument
881 if (!ctxt->check) { in xmlCtxtDumpOneNode()
882 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
883 fprintf(ctxt->output, "node is NULL\n"); in xmlCtxtDumpOneNode()
887 ctxt->node = node; in xmlCtxtDumpOneNode()
891 if (!ctxt->check) { in xmlCtxtDumpOneNode()
892 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
893 fprintf(ctxt->output, "ELEMENT "); in xmlCtxtDumpOneNode()
895 xmlCtxtDumpString(ctxt, node->ns->prefix); in xmlCtxtDumpOneNode()
896 fprintf(ctxt->output, ":"); in xmlCtxtDumpOneNode()
898 xmlCtxtDumpString(ctxt, node->name); in xmlCtxtDumpOneNode()
899 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
903 if (!ctxt->check) in xmlCtxtDumpOneNode()
904 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
905 fprintf(ctxt->output, "Error, ATTRIBUTE found here\n"); in xmlCtxtDumpOneNode()
906 xmlCtxtGenericNodeCheck(ctxt, node); in xmlCtxtDumpOneNode()
909 if (!ctxt->check) { in xmlCtxtDumpOneNode()
910 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
912 fprintf(ctxt->output, "TEXT no enc"); in xmlCtxtDumpOneNode()
914 fprintf(ctxt->output, "TEXT"); in xmlCtxtDumpOneNode()
915 if (ctxt->options & DUMP_TEXT_TYPE) { in xmlCtxtDumpOneNode()
917 fprintf(ctxt->output, " compact\n"); in xmlCtxtDumpOneNode()
918 else if (xmlDictOwns(ctxt->dict, node->content) == 1) in xmlCtxtDumpOneNode()
919 fprintf(ctxt->output, " interned\n"); in xmlCtxtDumpOneNode()
921 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
923 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
927 if (!ctxt->check) { in xmlCtxtDumpOneNode()
928 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
929 fprintf(ctxt->output, "CDATA_SECTION\n"); in xmlCtxtDumpOneNode()
933 if (!ctxt->check) { in xmlCtxtDumpOneNode()
934 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
935 fprintf(ctxt->output, "ENTITY_REF(%s)\n", in xmlCtxtDumpOneNode()
940 if (!ctxt->check) { in xmlCtxtDumpOneNode()
941 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
942 fprintf(ctxt->output, "ENTITY\n"); in xmlCtxtDumpOneNode()
946 if (!ctxt->check) { in xmlCtxtDumpOneNode()
947 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
948 fprintf(ctxt->output, "PI %s\n", (char *) node->name); in xmlCtxtDumpOneNode()
952 if (!ctxt->check) { in xmlCtxtDumpOneNode()
953 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
954 fprintf(ctxt->output, "COMMENT\n"); in xmlCtxtDumpOneNode()
959 if (!ctxt->check) { in xmlCtxtDumpOneNode()
960 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
962 fprintf(ctxt->output, "Error, DOCUMENT found here\n"); in xmlCtxtDumpOneNode()
963 xmlCtxtGenericNodeCheck(ctxt, node); in xmlCtxtDumpOneNode()
966 if (!ctxt->check) { in xmlCtxtDumpOneNode()
967 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
968 fprintf(ctxt->output, "DOCUMENT_TYPE\n"); in xmlCtxtDumpOneNode()
972 if (!ctxt->check) { in xmlCtxtDumpOneNode()
973 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
974 fprintf(ctxt->output, "DOCUMENT_FRAG\n"); in xmlCtxtDumpOneNode()
978 if (!ctxt->check) { in xmlCtxtDumpOneNode()
979 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
980 fprintf(ctxt->output, "NOTATION\n"); in xmlCtxtDumpOneNode()
984 xmlCtxtDumpDtdNode(ctxt, (xmlDtdPtr) node); in xmlCtxtDumpOneNode()
987 xmlCtxtDumpElemDecl(ctxt, (xmlElementPtr) node); in xmlCtxtDumpOneNode()
990 xmlCtxtDumpAttrDecl(ctxt, (xmlAttributePtr) node); in xmlCtxtDumpOneNode()
993 xmlCtxtDumpEntityDecl(ctxt, (xmlEntityPtr) node); in xmlCtxtDumpOneNode()
996 xmlCtxtDumpNamespace(ctxt, (xmlNsPtr) node); in xmlCtxtDumpOneNode()
999 if (!ctxt->check) { in xmlCtxtDumpOneNode()
1000 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
1001 fprintf(ctxt->output, "INCLUDE START\n"); in xmlCtxtDumpOneNode()
1005 if (!ctxt->check) { in xmlCtxtDumpOneNode()
1006 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
1007 fprintf(ctxt->output, "INCLUDE END\n"); in xmlCtxtDumpOneNode()
1011 if (!ctxt->check) in xmlCtxtDumpOneNode()
1012 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
1013 xmlDebugErr2(ctxt, XML_CHECK_UNKNOWN_NODE, in xmlCtxtDumpOneNode()
1018 if (!ctxt->check) { in xmlCtxtDumpOneNode()
1019 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
1021 fprintf(ctxt->output, "PBM: doc == NULL !!!\n"); in xmlCtxtDumpOneNode()
1023 ctxt->depth++; in xmlCtxtDumpOneNode()
1025 xmlCtxtDumpNamespaceList(ctxt, node->nsDef); in xmlCtxtDumpOneNode()
1027 xmlCtxtDumpAttrList(ctxt, node->properties); in xmlCtxtDumpOneNode()
1030 if (!ctxt->check) { in xmlCtxtDumpOneNode()
1031 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpOneNode()
1032 fprintf(ctxt->output, "content="); in xmlCtxtDumpOneNode()
1033 xmlCtxtDumpString(ctxt, node->content); in xmlCtxtDumpOneNode()
1034 fprintf(ctxt->output, "\n"); in xmlCtxtDumpOneNode()
1042 xmlCtxtDumpEntity(ctxt, ent); in xmlCtxtDumpOneNode()
1044 ctxt->depth--; in xmlCtxtDumpOneNode()
1049 xmlCtxtGenericNodeCheck(ctxt, node); in xmlCtxtDumpOneNode()
1061 xmlCtxtDumpNode(xmlDebugCtxtPtr ctxt, xmlNodePtr node) in xmlCtxtDumpNode() argument
1064 if (!ctxt->check) { in xmlCtxtDumpNode()
1065 xmlCtxtDumpSpaces(ctxt); in xmlCtxtDumpNode()
1066 fprintf(ctxt->output, "node is NULL\n"); in xmlCtxtDumpNode()
1070 xmlCtxtDumpOneNode(ctxt, node); in xmlCtxtDumpNode()
1073 ctxt->depth++; in xmlCtxtDumpNode()
1074 xmlCtxtDumpNodeList(ctxt, node->children); in xmlCtxtDumpNode()
1075 ctxt->depth--; in xmlCtxtDumpNode()
1088 xmlCtxtDumpNodeList(xmlDebugCtxtPtr ctxt, xmlNodePtr node) in xmlCtxtDumpNodeList() argument
1091 xmlCtxtDumpNode(ctxt, node); in xmlCtxtDumpNodeList()
1097 xmlCtxtDumpDocHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) in xmlCtxtDumpDocHead() argument
1100 if (!ctxt->check) in xmlCtxtDumpDocHead()
1101 fprintf(ctxt->output, "DOCUMENT == NULL !\n"); in xmlCtxtDumpDocHead()
1104 ctxt->node = (xmlNodePtr) doc; in xmlCtxtDumpDocHead()
1108 xmlDebugErr(ctxt, XML_CHECK_FOUND_ELEMENT, in xmlCtxtDumpDocHead()
1112 xmlDebugErr(ctxt, XML_CHECK_FOUND_ATTRIBUTE, in xmlCtxtDumpDocHead()
1116 xmlDebugErr(ctxt, XML_CHECK_FOUND_TEXT, in xmlCtxtDumpDocHead()
1120 xmlDebugErr(ctxt, XML_CHECK_FOUND_CDATA, in xmlCtxtDumpDocHead()
1124 xmlDebugErr(ctxt, XML_CHECK_FOUND_ENTITYREF, in xmlCtxtDumpDocHead()
1128 xmlDebugErr(ctxt, XML_CHECK_FOUND_ENTITY, in xmlCtxtDumpDocHead()
1132 xmlDebugErr(ctxt, XML_CHECK_FOUND_PI, in xmlCtxtDumpDocHead()
1136 xmlDebugErr(ctxt, XML_CHECK_FOUND_COMMENT, in xmlCtxtDumpDocHead()
1140 if (!ctxt->check) in xmlCtxtDumpDocHead()
1141 fprintf(ctxt->output, "DOCUMENT\n"); in xmlCtxtDumpDocHead()
1144 if (!ctxt->check) in xmlCtxtDumpDocHead()
1145 fprintf(ctxt->output, "HTML DOCUMENT\n"); in xmlCtxtDumpDocHead()
1148 xmlDebugErr(ctxt, XML_CHECK_FOUND_DOCTYPE, in xmlCtxtDumpDocHead()
1152 xmlDebugErr(ctxt, XML_CHECK_FOUND_FRAGMENT, in xmlCtxtDumpDocHead()
1156 xmlDebugErr(ctxt, XML_CHECK_FOUND_NOTATION, in xmlCtxtDumpDocHead()
1160 xmlDebugErr2(ctxt, XML_CHECK_UNKNOWN_NODE, in xmlCtxtDumpDocHead()
1173 xmlCtxtDumpDocumentHead(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) in xmlCtxtDumpDocumentHead() argument
1176 xmlCtxtDumpDocHead(ctxt, doc); in xmlCtxtDumpDocumentHead()
1177 if (!ctxt->check) { in xmlCtxtDumpDocumentHead()
1179 fprintf(ctxt->output, "name="); in xmlCtxtDumpDocumentHead()
1180 xmlCtxtDumpString(ctxt, BAD_CAST doc->name); in xmlCtxtDumpDocumentHead()
1181 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1184 fprintf(ctxt->output, "version="); in xmlCtxtDumpDocumentHead()
1185 xmlCtxtDumpString(ctxt, doc->version); in xmlCtxtDumpDocumentHead()
1186 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1189 fprintf(ctxt->output, "encoding="); in xmlCtxtDumpDocumentHead()
1190 xmlCtxtDumpString(ctxt, doc->encoding); in xmlCtxtDumpDocumentHead()
1191 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1194 fprintf(ctxt->output, "URL="); in xmlCtxtDumpDocumentHead()
1195 xmlCtxtDumpString(ctxt, doc->URL); in xmlCtxtDumpDocumentHead()
1196 fprintf(ctxt->output, "\n"); in xmlCtxtDumpDocumentHead()
1199 fprintf(ctxt->output, "standalone=true\n"); in xmlCtxtDumpDocumentHead()
1202 xmlCtxtDumpNamespaceList(ctxt, doc->oldNs); in xmlCtxtDumpDocumentHead()
1213 xmlCtxtDumpDocument(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) in xmlCtxtDumpDocument() argument
1216 if (!ctxt->check) in xmlCtxtDumpDocument()
1217 fprintf(ctxt->output, "DOCUMENT == NULL !\n"); in xmlCtxtDumpDocument()
1220 xmlCtxtDumpDocumentHead(ctxt, doc); in xmlCtxtDumpDocument()
1224 ctxt->depth++; in xmlCtxtDumpDocument()
1225 xmlCtxtDumpNodeList(ctxt, doc->children); in xmlCtxtDumpDocument()
1226 ctxt->depth--; in xmlCtxtDumpDocument()
1231 xmlCtxtDumpEntityCallback(xmlEntityPtr cur, xmlDebugCtxtPtr ctxt) in xmlCtxtDumpEntityCallback() argument
1234 if (!ctxt->check) in xmlCtxtDumpEntityCallback()
1235 fprintf(ctxt->output, "Entity is NULL"); in xmlCtxtDumpEntityCallback()
1238 if (!ctxt->check) { in xmlCtxtDumpEntityCallback()
1239 fprintf(ctxt->output, "%s : ", (char *) cur->name); in xmlCtxtDumpEntityCallback()
1242 fprintf(ctxt->output, "INTERNAL GENERAL, "); in xmlCtxtDumpEntityCallback()
1245 fprintf(ctxt->output, "EXTERNAL PARSED, "); in xmlCtxtDumpEntityCallback()
1248 fprintf(ctxt->output, "EXTERNAL UNPARSED, "); in xmlCtxtDumpEntityCallback()
1251 fprintf(ctxt->output, "INTERNAL PARAMETER, "); in xmlCtxtDumpEntityCallback()
1254 fprintf(ctxt->output, "EXTERNAL PARAMETER, "); in xmlCtxtDumpEntityCallback()
1257 xmlDebugErr2(ctxt, XML_CHECK_ENTITY_TYPE, in xmlCtxtDumpEntityCallback()
1261 fprintf(ctxt->output, "ID \"%s\"", (char *) cur->ExternalID); in xmlCtxtDumpEntityCallback()
1263 fprintf(ctxt->output, "SYSTEM \"%s\"", (char *) cur->SystemID); in xmlCtxtDumpEntityCallback()
1265 fprintf(ctxt->output, "\n orig \"%s\"", (char *) cur->orig); in xmlCtxtDumpEntityCallback()
1267 fprintf(ctxt->output, "\n content \"%s\"", in xmlCtxtDumpEntityCallback()
1269 fprintf(ctxt->output, "\n"); in xmlCtxtDumpEntityCallback()
1281 xmlCtxtDumpEntities(xmlDebugCtxtPtr ctxt, xmlDocPtr doc) in xmlCtxtDumpEntities() argument
1284 xmlCtxtDumpDocHead(ctxt, doc); in xmlCtxtDumpEntities()
1289 if (!ctxt->check) in xmlCtxtDumpEntities()
1290 fprintf(ctxt->output, "Entities in internal subset\n"); in xmlCtxtDumpEntities()
1292 ctxt); in xmlCtxtDumpEntities()
1294 fprintf(ctxt->output, "No entities in internal subset\n"); in xmlCtxtDumpEntities()
1299 if (!ctxt->check) in xmlCtxtDumpEntities()
1300 fprintf(ctxt->output, "Entities in external subset\n"); in xmlCtxtDumpEntities()
1302 ctxt); in xmlCtxtDumpEntities()
1303 } else if (!ctxt->check) in xmlCtxtDumpEntities()
1304 fprintf(ctxt->output, "No entities in external subset\n"); in xmlCtxtDumpEntities()
1315 xmlCtxtDumpDTD(xmlDebugCtxtPtr ctxt, xmlDtdPtr dtd) in xmlCtxtDumpDTD() argument
1318 if (!ctxt->check) in xmlCtxtDumpDTD()
1319 fprintf(ctxt->output, "DTD is NULL\n"); in xmlCtxtDumpDTD()
1322 xmlCtxtDumpDtdNode(ctxt, dtd); in xmlCtxtDumpDTD()
1324 fprintf(ctxt->output, " DTD is empty\n"); in xmlCtxtDumpDTD()
1326 ctxt->depth++; in xmlCtxtDumpDTD()
1327 xmlCtxtDumpNodeList(ctxt, dtd->children); in xmlCtxtDumpDTD()
1328 ctxt->depth--; in xmlCtxtDumpDTD()
1378 xmlDebugCtxt ctxt; in xmlDebugDumpAttr() local
1381 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpAttr()
1382 ctxt.output = output; in xmlDebugDumpAttr()
1383 ctxt.depth = depth; in xmlDebugDumpAttr()
1384 xmlCtxtDumpAttr(&ctxt, attr); in xmlDebugDumpAttr()
1385 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpAttr()
1399 xmlDebugCtxt ctxt; in xmlDebugDumpEntities() local
1402 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpEntities()
1403 ctxt.output = output; in xmlDebugDumpEntities()
1404 xmlCtxtDumpEntities(&ctxt, doc); in xmlDebugDumpEntities()
1405 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpEntities()
1419 xmlDebugCtxt ctxt; in xmlDebugDumpAttrList() local
1422 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpAttrList()
1423 ctxt.output = output; in xmlDebugDumpAttrList()
1424 ctxt.depth = depth; in xmlDebugDumpAttrList()
1425 xmlCtxtDumpAttrList(&ctxt, attr); in xmlDebugDumpAttrList()
1426 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpAttrList()
1440 xmlDebugCtxt ctxt; in xmlDebugDumpOneNode() local
1443 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpOneNode()
1444 ctxt.output = output; in xmlDebugDumpOneNode()
1445 ctxt.depth = depth; in xmlDebugDumpOneNode()
1446 xmlCtxtDumpOneNode(&ctxt, node); in xmlDebugDumpOneNode()
1447 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpOneNode()
1461 xmlDebugCtxt ctxt; in xmlDebugDumpNode() local
1465 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpNode()
1466 ctxt.output = output; in xmlDebugDumpNode()
1467 ctxt.depth = depth; in xmlDebugDumpNode()
1468 xmlCtxtDumpNode(&ctxt, node); in xmlDebugDumpNode()
1469 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpNode()
1483 xmlDebugCtxt ctxt; in xmlDebugDumpNodeList() local
1487 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpNodeList()
1488 ctxt.output = output; in xmlDebugDumpNodeList()
1489 ctxt.depth = depth; in xmlDebugDumpNodeList()
1490 xmlCtxtDumpNodeList(&ctxt, node); in xmlDebugDumpNodeList()
1491 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpNodeList()
1504 xmlDebugCtxt ctxt; in xmlDebugDumpDocumentHead() local
1508 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpDocumentHead()
1509 ctxt.options |= DUMP_TEXT_TYPE; in xmlDebugDumpDocumentHead()
1510 ctxt.output = output; in xmlDebugDumpDocumentHead()
1511 xmlCtxtDumpDocumentHead(&ctxt, doc); in xmlDebugDumpDocumentHead()
1512 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpDocumentHead()
1525 xmlDebugCtxt ctxt; in xmlDebugDumpDocument() local
1529 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpDocument()
1530 ctxt.options |= DUMP_TEXT_TYPE; in xmlDebugDumpDocument()
1531 ctxt.output = output; in xmlDebugDumpDocument()
1532 xmlCtxtDumpDocument(&ctxt, doc); in xmlDebugDumpDocument()
1533 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpDocument()
1546 xmlDebugCtxt ctxt; in xmlDebugDumpDTD() local
1550 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugDumpDTD()
1551 ctxt.options |= DUMP_TEXT_TYPE; in xmlDebugDumpDTD()
1552 ctxt.output = output; in xmlDebugDumpDTD()
1553 xmlCtxtDumpDTD(&ctxt, dtd); in xmlDebugDumpDTD()
1554 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugDumpDTD()
1576 xmlDebugCtxt ctxt; in xmlDebugCheckDocument() local
1580 xmlCtxtDumpInitCtxt(&ctxt); in xmlDebugCheckDocument()
1581 ctxt.output = output; in xmlDebugCheckDocument()
1582 ctxt.check = 1; in xmlDebugCheckDocument()
1583 xmlCtxtDumpDocument(&ctxt, doc); in xmlDebugCheckDocument()
1584 xmlCtxtDumpCleanCtxt(&ctxt); in xmlDebugCheckDocument()
1585 return(ctxt.errors); in xmlDebugCheckDocument()
1886 xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node) in xmlShellPrintNodeCtxt() argument
1892 if (ctxt == NULL) in xmlShellPrintNodeCtxt()
1895 fp = ctxt->output; in xmlShellPrintNodeCtxt()
1928 xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list) in xmlShellPrintXPathResultCtxt() argument
1930 if (!ctxt) in xmlShellPrintXPathResultCtxt()
1942 xmlShellPrintNodeCtxt(ctxt, in xmlShellPrintXPathResultCtxt()
2000 xmlShellList(xmlShellCtxtPtr ctxt, in xmlShellList() argument
2005 if (!ctxt) in xmlShellList()
2008 fprintf(ctxt->output, "NULL\n"); in xmlShellList()
2015 xmlLsOneNode(ctxt->output, node); in xmlShellList()
2020 xmlLsOneNode(ctxt->output, node); in xmlShellList()
2024 xmlLsOneNode(ctxt->output, cur); in xmlShellList()
2043 xmlShellBase(xmlShellCtxtPtr ctxt, in xmlShellBase() argument
2048 if (!ctxt) in xmlShellBase()
2051 fprintf(ctxt->output, "NULL\n"); in xmlShellBase()
2058 fprintf(ctxt->output, " No base found !!!\n"); in xmlShellBase()
2060 fprintf(ctxt->output, "%s\n", base); in xmlShellBase()
2080 xmlShellSetBase(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, in xmlShellSetBase()
2104 xmlShellRegisterNamespace(xmlShellCtxtPtr ctxt, char *arg, in xmlShellRegisterNamespace() argument
2123 fprintf(ctxt->output, "setns: prefix=[nsuri] required\n"); in xmlShellRegisterNamespace()
2137 if(xmlXPathRegisterNs(ctxt->pctxt, prefix, href) != 0) { in xmlShellRegisterNamespace()
2138 …fprintf(ctxt->output,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", prefix, … in xmlShellRegisterNamespace()
2160 xmlShellRegisterRootNamespaces(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED, in xmlShellRegisterRootNamespaces() argument
2166 (root->nsDef == NULL) || (ctxt == NULL) || (ctxt->pctxt == NULL)) in xmlShellRegisterRootNamespaces()
2171 xmlXPathRegisterNs(ctxt->pctxt, BAD_CAST "defaultns", ns->href); in xmlShellRegisterRootNamespaces()
2173 xmlXPathRegisterNs(ctxt->pctxt, ns->prefix, ns->href); in xmlShellRegisterRootNamespaces()
2193 xmlShellGrep(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, in xmlShellGrep()
2196 if (!ctxt) in xmlShellGrep()
2213 fprintf(ctxt->output, "%s : ", xmlGetNodePath(node)); in xmlShellGrep()
2214 xmlShellList(ctxt, NULL, node, NULL); in xmlShellGrep()
2219 fprintf(ctxt->output, "%s : ", xmlGetNodePath(node->parent)); in xmlShellGrep()
2220 xmlShellList(ctxt, NULL, node->parent, NULL); in xmlShellGrep()
2271 xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, in xmlShellDir()
2275 if (!ctxt) in xmlShellDir()
2278 fprintf(ctxt->output, "NULL\n"); in xmlShellDir()
2283 xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node); in xmlShellDir()
2285 xmlDebugDumpAttr(ctxt->output, (xmlAttrPtr) node, 0); in xmlShellDir()
2287 xmlDebugDumpOneNode(ctxt->output, node, 0); in xmlShellDir()
2305 xmlShellSetContent(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, in xmlShellSetContent()
2312 if (!ctxt) in xmlShellSetContent()
2315 fprintf(ctxt->output, "NULL\n"); in xmlShellSetContent()
2319 fprintf(ctxt->output, "NULL\n"); in xmlShellSetContent()
2332 fprintf(ctxt->output, "failed to parse content\n"); in xmlShellSetContent()
2356 xmlRelaxNGParserCtxtPtr ctxt; in xmlShellRNGValidate() local
2360 ctxt = xmlRelaxNGNewParserCtxt(schemas); in xmlShellRNGValidate()
2361 xmlRelaxNGSetParserErrors(ctxt, in xmlShellRNGValidate()
2365 relaxngschemas = xmlRelaxNGParse(ctxt); in xmlShellRNGValidate()
2366 xmlRelaxNGFreeParserCtxt(ctxt); in xmlShellRNGValidate()
2407 xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED, in xmlShellCat() argument
2410 if (!ctxt) in xmlShellCat()
2413 fprintf(ctxt->output, "NULL\n"); in xmlShellCat()
2416 if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) { in xmlShellCat()
2419 htmlDocDump(ctxt->output, (htmlDocPtr) node); in xmlShellCat()
2421 htmlNodeDumpFile(ctxt->output, ctxt->doc, node); in xmlShellCat()
2424 xmlDocDump(ctxt->output, (xmlDocPtr) node); in xmlShellCat()
2426 xmlElemDump(ctxt->output, ctxt->doc, node); in xmlShellCat()
2430 xmlDocDump(ctxt->output, (xmlDocPtr) node); in xmlShellCat()
2432 xmlElemDump(ctxt->output, ctxt->doc, node); in xmlShellCat()
2434 fprintf(ctxt->output, "\n"); in xmlShellCat()
2452 xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename, in xmlShellLoad() argument
2459 if ((ctxt == NULL) || (filename == NULL)) return(-1); in xmlShellLoad()
2460 if (ctxt->doc != NULL) in xmlShellLoad()
2461 html = (ctxt->doc->type == XML_HTML_DOCUMENT_NODE); in xmlShellLoad()
2467 fprintf(ctxt->output, "HTML support not compiled in\n"); in xmlShellLoad()
2474 if (ctxt->loaded == 1) { in xmlShellLoad()
2475 xmlFreeDoc(ctxt->doc); in xmlShellLoad()
2477 ctxt->loaded = 1; in xmlShellLoad()
2479 xmlXPathFreeContext(ctxt->pctxt); in xmlShellLoad()
2481 xmlFree(ctxt->filename); in xmlShellLoad()
2482 ctxt->doc = doc; in xmlShellLoad()
2483 ctxt->node = (xmlNodePtr) doc; in xmlShellLoad()
2485 ctxt->pctxt = xmlXPathNewContext(doc); in xmlShellLoad()
2487 ctxt->filename = (char *) xmlCanonicPath((xmlChar *) filename); in xmlShellLoad()
2508 xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node, in xmlShellWrite() argument
2525 if (xmlSaveFile((char *) filename, ctxt->doc) < -1) { in xmlShellWrite()
2533 if (htmlSaveFile((char *) filename, ctxt->doc) < 0) { in xmlShellWrite()
2539 if (xmlSaveFile((char *) filename, ctxt->doc) < -1) { in xmlShellWrite()
2555 xmlElemDump(f, ctxt->doc, node); in xmlShellWrite()
2575 xmlShellSave(xmlShellCtxtPtr ctxt, char *filename, in xmlShellSave() argument
2579 if ((ctxt == NULL) || (ctxt->doc == NULL)) in xmlShellSave()
2582 filename = ctxt->filename; in xmlShellSave()
2592 switch (ctxt->doc->type) { in xmlShellSave()
2594 if (xmlSaveFile((char *) filename, ctxt->doc) < 0) { in xmlShellSave()
2601 if (htmlSaveFile((char *) filename, ctxt->doc) < 0) { in xmlShellSave()
2606 if (xmlSaveFile((char *) filename, ctxt->doc) < 0) { in xmlShellSave()
2637 xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd, in xmlShellValidate() argument
2644 if ((ctxt == NULL) || (ctxt->doc == NULL)) return(-1); in xmlShellValidate()
2650 res = xmlValidateDocument(&vctxt, ctxt->doc); in xmlShellValidate()
2656 res = xmlValidateDtd(&vctxt, ctxt->doc, subset); in xmlShellValidate()
2679 xmlShellDu(xmlShellCtxtPtr ctxt, in xmlShellDu() argument
2686 if (!ctxt) in xmlShellDu()
2695 fprintf(ctxt->output, "/\n"); in xmlShellDu()
2698 fprintf(ctxt->output, " "); in xmlShellDu()
2699 fprintf(ctxt->output, "%s\n", node->name); in xmlShellDu()
2762 xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer, in xmlShellPwd()
2809 xmlShellCtxtPtr ctxt; in xmlShell() local
2820 ctxt = (xmlShellCtxtPtr) xmlMalloc(sizeof(xmlShellCtxt)); in xmlShell()
2821 if (ctxt == NULL) in xmlShell()
2823 ctxt->loaded = 0; in xmlShell()
2824 ctxt->doc = doc; in xmlShell()
2825 ctxt->input = input; in xmlShell()
2826 ctxt->output = output; in xmlShell()
2827 ctxt->filename = (char *) xmlStrdup((xmlChar *) filename); in xmlShell()
2828 ctxt->node = (xmlNodePtr) ctxt->doc; in xmlShell()
2831 ctxt->pctxt = xmlXPathNewContext(ctxt->doc); in xmlShell()
2832 if (ctxt->pctxt == NULL) { in xmlShell()
2833 xmlFree(ctxt); in xmlShell()
2838 if (ctxt->node == (xmlNodePtr) ctxt->doc) in xmlShell()
2840 else if ((ctxt->node != NULL) && (ctxt->node->name)) in xmlShell()
2841 snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name); in xmlShell()
2849 cmdline = ctxt->input(prompt); in xmlShell()
2893 fprintf(ctxt->output, "\tbase display XML base of the node\n"); in xmlShell()
2894 fprintf(ctxt->output, "\tsetbase URI change the XML base of the node\n"); in xmlShell()
2895 fprintf(ctxt->output, "\tbye leave shell\n"); in xmlShell()
2896 fprintf(ctxt->output, "\tcat [node] display node or current node\n"); in xmlShell()
2897 fprintf(ctxt->output, "\tcd [path] change directory to path or to root\n"); in xmlShell()
2898 …fprintf(ctxt->output, "\tdir [path] dumps informations about the node (namespace, attributes, co… in xmlShell()
2899 …fprintf(ctxt->output, "\tdu [path] show the structure of the subtree under path or the current … in xmlShell()
2900 fprintf(ctxt->output, "\texit leave shell\n"); in xmlShell()
2901 fprintf(ctxt->output, "\thelp display this help\n"); in xmlShell()
2902 fprintf(ctxt->output, "\tfree display memory usage\n"); in xmlShell()
2903 fprintf(ctxt->output, "\tload [name] load a new document with name\n"); in xmlShell()
2904 fprintf(ctxt->output, "\tls [path] list contents of path or the current directory\n"); in xmlShell()
2905 …fprintf(ctxt->output, "\tset xml_fragment replace the current node content with the fragment parse… in xmlShell()
2907 …fprintf(ctxt->output, "\txpath expr evaluate the XPath expression in that context and print the … in xmlShell()
2908 …fprintf(ctxt->output, "\tsetns nsreg register a namespace to a prefix in the XPath evaluation con… in xmlShell()
2909 …fprintf(ctxt->output, "\t format for nsreg is: prefix=[nsuri] (i.e. prefix= unsets a p… in xmlShell()
2910 fprintf(ctxt->output, "\tsetrootns register all namespace found on the root element\n"); in xmlShell()
2911 fprintf(ctxt->output, "\t the default namespace if any uses 'defaultns' prefix\n"); in xmlShell()
2913 fprintf(ctxt->output, "\tpwd display current working directory\n"); in xmlShell()
2914 fprintf(ctxt->output, "\tquit leave shell\n"); in xmlShell()
2916 fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n"); in xmlShell()
2917 fprintf(ctxt->output, "\twrite [name] write the current node to the filename\n"); in xmlShell()
2920 fprintf(ctxt->output, "\tvalidate check the document for errors\n"); in xmlShell()
2923 fprintf(ctxt->output, "\trelaxng rng validate the document agaisnt the Relax-NG schemas\n"); in xmlShell()
2925 fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n"); in xmlShell()
2928 xmlShellValidate(ctxt, arg, NULL, NULL); in xmlShell()
2931 xmlShellLoad(ctxt, arg, NULL, NULL); in xmlShell()
2934 xmlShellRNGValidate(ctxt, arg, NULL, NULL); in xmlShell()
2938 xmlShellSave(ctxt, arg, NULL, NULL); in xmlShell()
2944 xmlShellWrite(ctxt, arg, ctxt->node, NULL); in xmlShell()
2947 xmlShellGrep(ctxt, arg, ctxt->node, NULL); in xmlShell()
2950 xmlMemShow(ctxt->output, 0); in xmlShell()
2955 xmlMemShow(ctxt->output, len); in xmlShell()
2960 if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL)) in xmlShell()
2961 fprintf(ctxt->output, "%s\n", dir); in xmlShell()
2963 xmlShellDu(ctxt, NULL, ctxt->node, NULL); in xmlShell()
2965 xmlShellBase(ctxt, NULL, ctxt->node, NULL); in xmlShell()
2967 xmlShellSetContent(ctxt, arg, ctxt->node, NULL); in xmlShell()
2974 xmlShellRegisterNamespace(ctxt, arg, NULL, NULL); in xmlShell()
2979 root = xmlDocGetRootElement(ctxt->doc); in xmlShell()
2980 xmlShellRegisterRootNamespaces(ctxt, NULL, root, NULL); in xmlShell()
2986 ctxt->pctxt->node = ctxt->node; in xmlShell()
2987 list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); in xmlShell()
2988 xmlXPathDebugDumpObject(ctxt->output, list, 0); in xmlShell()
2994 xmlShellSetBase(ctxt, arg, ctxt->node, NULL); in xmlShell()
3001 xmlShellDir(ctxt, NULL, ctxt->node, NULL); in xmlShell()
3003 xmlShellList(ctxt, NULL, ctxt->node, NULL); in xmlShell()
3005 ctxt->pctxt->node = ctxt->node; in xmlShell()
3007 ctxt->pctxt->node = ctxt->node; in xmlShell()
3008 list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); in xmlShell()
3028 xmlShellDir(ctxt, NULL, in xmlShell()
3032 xmlShellList(ctxt, NULL, in xmlShell()
3079 ctxt->pctxt->node = NULL; in xmlShell()
3083 ctxt->node = (xmlNodePtr) ctxt->doc; in xmlShell()
3086 ctxt->pctxt->node = ctxt->node; in xmlShell()
3087 list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); in xmlShell()
3100 ctxt->node = list->nodesetval->nodeTab[0]; in xmlShell()
3101 if ((ctxt->node != NULL) && in xmlShell()
3102 (ctxt->node->type == in xmlShell()
3106 ctxt->node = NULL; in xmlShell()
3159 ctxt->pctxt->node = NULL; in xmlShell()
3164 xmlShellCat(ctxt, NULL, ctxt->node, NULL); in xmlShell()
3166 ctxt->pctxt->node = ctxt->node; in xmlShell()
3168 ctxt->pctxt->node = ctxt->node; in xmlShell()
3169 list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt); in xmlShell()
3189 fprintf(ctxt->output, " -------\n"); in xmlShell()
3190 xmlShellCat(ctxt, NULL, in xmlShell()
3237 ctxt->pctxt->node = NULL; in xmlShell()
3248 xmlXPathFreeContext(ctxt->pctxt); in xmlShell()
3250 if (ctxt->loaded) { in xmlShell()
3251 xmlFreeDoc(ctxt->doc); in xmlShell()
3253 if (ctxt->filename != NULL) in xmlShell()
3254 xmlFree(ctxt->filename); in xmlShell()
3255 xmlFree(ctxt); in xmlShell()