* xmlShellBase: * @ctxt: the shell context * @arg: unused * @node: a node * @node2: unused * * Implements the XML shell function "base" * dumps the current XML base of the node * * Returns 0 */
| 2038 | * Returns 0 |
| 2039 | */ |
| 2040 | int |
| 2041 | xmlShellBase(xmlShellCtxtPtr ctxt, |
| 2042 | char *arg ATTRIBUTE_UNUSED, xmlNodePtr node, |
| 2043 | xmlNodePtr node2 ATTRIBUTE_UNUSED) |
| 2044 | { |
| 2045 | xmlChar *base; |
| 2046 | if (!ctxt) |
| 2047 | return 0; |
| 2048 | if (node == NULL) { |
| 2049 | fprintf(ctxt->output, "NULL\n"); |
| 2050 | return (0); |
| 2051 | } |
| 2052 | |
| 2053 | base = xmlNodeGetBase(node->doc, node); |
| 2054 | |
| 2055 | if (base == NULL) { |
| 2056 | fprintf(ctxt->output, " No base found !!!\n"); |
| 2057 | } else { |
| 2058 | fprintf(ctxt->output, "%s\n", base); |
| 2059 | xmlFree(base); |
| 2060 | } |
| 2061 | return (0); |
| 2062 | } |
| 2063 | |
| 2064 | #ifdef LIBXML_TREE_ENABLED |
| 2065 | /** |