Java XML Node Print printNodes(Node node, int level)

Here you can find the source of printNodes(Node node, int level)

Description

Method to print nodes of the DOM

License

Open Source License

Parameter

Parameter Description
node current node in DOM
level depth of node

Declaration

public static void printNodes(Node node, int level) 

Method Source Code

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

import org.w3c.dom.Node;

public class Main {
    /**/*from  w  w w  .j a  va 2 s .  c o m*/
     * Method to print nodes of the DOM
     * @param node current node in DOM
     * @param level depth of node
     */
    public static void printNodes(Node node, int level) {
        level++;
        System.out.println(node);
        for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
            printNodes(child, level);
        }
        return;
    }
}

Related

  1. printNode(Node node, int level)
  2. printNode(Node node, PrintStream out)
  3. printNode(Node node, StringWriter sw)
  4. printNodeBasics(Node node)
  5. printNodeIterator(NodeIterator iterator)
  6. printNodeType(Node node, int ident)
  7. printToTerminal(Node n, String indent, boolean descend)
  8. printTree(Node node, int ident)
  9. printTree(Node root, int level)