Interface Element

All Superinterfaces:
Node

public interface Element extends Node
This interface represents XML DOM elements, which are the basic building block of XML. An example follows:
   
      Some text more text
   
 
  • Method Details

    • getAttribute

      String getAttribute(String name)
      This method retrieves the attribute which has a name of name.
      Parameters:
      name - the name of the attribute to get the value of
      Returns:
      the value of the attribute specified by name
    • getAttributeNode

      Attr getAttributeNode(String name)
      This method retrieves the attribute node which has a name of name. This Attr will have the same value as would be gotten with getAttribute.
      Parameters:
      name - the name of the Attr to get
      Returns:
      the attribute node of this Elementwhich has a name of name
    • getElementsByTagName

      NodeList getElementsByTagName(String name)
      This method retrieves the elements by tag name which has a name of name.
      Parameters:
      name - the name of the Element to get
      Returns:
      the elements by tag name of this Element which has a name of name
    • getTagName

      String getTagName()
      This method retrieves the tag name.
      Returns:
      the tag name of this Element
    • hasAttribute

      boolean hasAttribute(String name)
      This method determines whether this Element has an attribute with the supplied name.
      Parameters:
      name - the name of the attribute
      Returns:
      true if this Element has an attribute that name.
    • removeAttribute

      void removeAttribute(String name)
      This method removes the attribute which has the specified name.
      Parameters:
      name - the name of the attribute to remove
    • setAttribute

      void setAttribute(String name, String value)
      This method sets the attribute specified by name to value.
      Parameters:
      name - the name of the attribute to set
      value - the new value this attribute is to have