Code example for Element

Methods: getTextContent

0
   */ 
  public String getText () {
    // XXX e.getTextContent() doesn't exsist under Android (Lukasz Wisniewski) 
    // / getTextContent() is now available in at least Android 2.2 if not earlier, so we'll keep using that 
    // return e.hasChildNodes() ? e.getFirstChild().getNodeValue() : null; 
    return e.getTextContent();
  } 
 
  /** 
   * Checks if this element has a child element with the given name. 
   *  
   * @param name 
   *          The child's name 
   * @return <code>true</code> if this element has a child element with the given name 
   */ 
  public boolean hasChild ( String name ) {
    NodeList list = e.getElementsByTagName( name );
    for ( int i = 0, j = list.getLength(); i < j; i++ ) {
      Node item = list.item( i );
      if ( item.getParentNode() == e ) return true;
    }