* xmlShellDir: * @ctxt: the shell context * @arg: unused * @node: a node * @node2: unused * * Implements the XML shell function "dir" * dumps information about the node (namespace, attributes, content). * * Returns 0 */
| 2255 | * Returns 0 |
| 2256 | */ |
| 2257 | int |
| 2258 | xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, |
| 2259 | char *arg ATTRIBUTE_UNUSED, xmlNodePtr node, |
| 2260 | xmlNodePtr node2 ATTRIBUTE_UNUSED) |
| 2261 | { |
| 2262 | if (!ctxt) |
| 2263 | return (0); |
| 2264 | if (node == NULL) { |
| 2265 | fprintf(ctxt->output, "NULL\n"); |
| 2266 | return (0); |
| 2267 | } |
| 2268 | if ((node->type == XML_DOCUMENT_NODE) || |
| 2269 | (node->type == XML_HTML_DOCUMENT_NODE)) { |
| 2270 | xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node); |
| 2271 | } else if (node->type == XML_ATTRIBUTE_NODE) { |
| 2272 | xmlDebugDumpAttr(ctxt->output, (xmlAttrPtr) node, 0); |
| 2273 | } else { |
| 2274 | xmlDebugDumpOneNode(ctxt->output, node, 0); |
| 2275 | } |
| 2276 | return (0); |
| 2277 | } |
| 2278 | |
| 2279 | /** |
| 2280 | * xmlShellSetContent: |
no test coverage detected