Code example for Node

Methods: getOwnerDocument

0
     * xmlNode.isRoot() 
     *  
     * @return True if xmlNode is the root of the document, false otherwise 
     */ 
    public static boolean isRoot(Node node) {
        return node.getOwnerDocument().getDocumentElement() == node;
    } 
 
    /** 
     * xmlNode.is("tagName") 
     *  
     * @return True if xmlNode.getNodeName().equals(name), false otherwise. 
     */ 
    public static boolean is(Node node, String name) {
        return node.getNodeName().equals(name);
    } 
 
    /** 
     * xmlNode.depth() 
     *  
     * @return The maximum depth of the node.