| 697 | } |
| 698 | |
| 699 | static void |
| 700 | xmlCtxtDumpNamespace(xmlDebugCtxtPtr ctxt, xmlNsPtr ns) |
| 701 | { |
| 702 | xmlCtxtDumpSpaces(ctxt); |
| 703 | |
| 704 | if (ns == NULL) { |
| 705 | if (!ctxt->check) |
| 706 | fprintf(ctxt->output, "namespace node is NULL\n"); |
| 707 | return; |
| 708 | } |
| 709 | if (ns->type != XML_NAMESPACE_DECL) { |
| 710 | xmlDebugErr(ctxt, XML_CHECK_NOT_NS_DECL, |
| 711 | "Node is not a namespace declaration"); |
| 712 | return; |
| 713 | } |
| 714 | if (ns->href == NULL) { |
| 715 | if (ns->prefix != NULL) |
| 716 | xmlDebugErr3(ctxt, XML_CHECK_NO_HREF, |
| 717 | "Incomplete namespace %s href=NULL\n", |
| 718 | (char *) ns->prefix); |
| 719 | else |
| 720 | xmlDebugErr(ctxt, XML_CHECK_NO_HREF, |
| 721 | "Incomplete default namespace href=NULL\n"); |
| 722 | } else { |
| 723 | if (!ctxt->check) { |
| 724 | if (ns->prefix != NULL) |
| 725 | fprintf(ctxt->output, "namespace %s href=", |
| 726 | (char *) ns->prefix); |
| 727 | else |
| 728 | fprintf(ctxt->output, "default namespace href="); |
| 729 | |
| 730 | xmlCtxtDumpString(ctxt, ns->href); |
| 731 | fprintf(ctxt->output, "\n"); |
| 732 | } |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | static void |
| 737 | xmlCtxtDumpNamespaceList(xmlDebugCtxtPtr ctxt, xmlNsPtr ns) |
no test coverage detected