Code example for Node

Methods: getNodeTypegetParentNode

   * ownerElement if the input node is an Attr, or null if the node is 
   * a Document, a DocumentFragment, or an orphan. 
  public static Node getParentOfNode(Node node)
          Node parent=node.getParentNode();
          if(parent==null && (Node.ATTRIBUTE_NODE == node.getNodeType()) )
           parent=((Attr) node).getOwnerElement();
          return parent;
   * Returns the local name of the given node, as defined by the 
   * XML Namespaces specification. This is prepared to handle documents 
   * built using DOM Level 1 methods by falling back upon explicitly 
   * parsing the node name. 
   * @param n Node to be examined 
   * @return String containing the local name, or null if the node