Java Utililty Methods XML Node Owner

List of utility methods to do XML Node Owner

Description

The list of methods to do XML Node Owner are organized into topic(s).

Method

ElementgetOwnerElement(Node node)
Returns the owner element of the node and null if not found.
int nodeType = node.getNodeType();
switch (nodeType) {
case Node.ATTRIBUTE_NODE:
    return ((Attr) node).getOwnerElement();
case Node.TEXT_NODE:
    return (Element) ((Text) node).getParentNode();
case Node.CDATA_SECTION_NODE:
    return (Element) ((CDATASection) node).getParentNode();
...