Java XML Last Child Element getLastChildElement(Node node)

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

Description

get Last Child Element

License

Open Source License

Declaration

public static Element getLastChildElement(Node node) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Node;

import org.w3c.dom.Element;

public class Main {
    public static Element getLastChildElement(Node node) {
        Node child = node.getLastChild();
        while (child != null) {
            if (child.getNodeType() == Node.ELEMENT_NODE) {
                return (Element) child;
            }//from   w  w w.j a  v a  2s. c  o  m

            child = child.getPreviousSibling();
        }
        return null;
    }
}

Related

  1. getLastChild(Node node, String name)
  2. getLastChildElement(Element e)
  3. getLastChildElement(Element e)
  4. getLastChildElement(Element elem)
  5. getLastChildElement(Node n)
  6. getLastChildElement(Node node)
  7. getLastChildElement(Node node)
  8. getLastChildElement(Node parent)
  9. getLastChildElement(Node parent)