Friday 5 August 2011

Add Text object to an Element.

  
import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Utils {
  /**
   * Add Text object to an Element.
   @param element the containing element
   @param text the text to add
   */
  public static void addText(Element element, String text) {
    element.appendChild(element.getOwnerDocument().createTextNode(text));
  }
}

   
    
  

No comments:

Post a Comment