Java XML Node Print printNode(Node node)

Here you can find the source of printNode(Node node)

Description

print Node

License

Open Source License

Declaration

public static void printNode(Node node) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.apache.log4j.Logger;

import org.w3c.dom.Node;

public class Main {
    protected static Logger logger = Logger.getLogger(new Object() {
    }.getClass().getEnclosingClass().getName());

    public static void printNode(Node node) {
        logger.debug("--> printNode() " + node.getNodeName());
        logger.debug("prefix=" + node.getPrefix() + ", baseuri=" + node.getBaseURI() + ", nsuri="
                + node.getNamespaceURI() + ", value=" + node.getNodeValue());
        if (node.getFirstChild() != null) {
            logger.debug("--> Child of " + node.getNodeName());
            printNode(node.getFirstChild());
            logger.debug("<-- Child of " + node.getNodeName());
        }//w ww.  j av  a2  s.  co  m
        if (node.getNextSibling() != null) {
            logger.debug("--> Sibling of " + node.getNodeName());
            printNode(node.getNextSibling());
            logger.debug("<-- Sibling of " + node.getNodeName());
        }
        logger.debug("<-- printNode() " + node.getNodeName());
    }
}

Related

  1. printNode(final String indent, final Node node)
  2. printNode(Node aNode, int aLevel)
  3. printNode(Node node)
  4. printNode(Node node)
  5. printNode(Node node)
  6. printNode(Node node, int level)
  7. printNode(Node node, PrintStream out)
  8. printNode(Node node, StringWriter sw)
  9. printNodeBasics(Node node)