Java XML Node Parent getParentElement(final Node node)

Here you can find the source of getParentElement(final Node node)

Description

get Parent Element

License

Apache License

Declaration

public static Element getParentElement(final Node node) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.Element;

import org.w3c.dom.Node;

public class Main {
    public static Element getParentElement(final Node node) {
        final Node parent = node.getParentNode();
        return parent instanceof Element ? (Element) parent : null;
    }/*from  www  .j a  va2  s .  c o  m*/
}

Related

  1. getParent(final Node n)
  2. getParent(Node node)
  3. getParent(Node target)
  4. getParentElement(Element element)
  5. getParentElement(Element element)
  6. getParentElement(Node node)
  7. getParentElement(Node node)
  8. getParentElement(Node node)
  9. getParentNamespaces(Element el)