Class DOMUtil

java.lang.Object
com.openhtmltopdf.pdfboxout.DOMUtil

public class DOMUtil extends Object
  • Constructor Details

    • DOMUtil

      public DOMUtil()
  • Method Details

    • getChild

      public static Element getChild(Element parent, String name)
    • getChildren

      public static List<Element> getChildren(Element parent, String name)
    • findClosestEnclosingElementWithNodeName

      public static Element findClosestEnclosingElementWithNodeName(Node e, String nodeName)
      Helper function to find an enclosing element with given node name. Returns null on failure.
    • getText

      public static String getText(Element parent)
      Loads all of the text content in all offspring of an element. Ignores all attributes, comments and processing instructions.
      Returns:
      a String with the text content of an element (may be an empty string but will not be null).
    • getText

      public static void getText(Element parent, StringBuilder sb)
      Appends all text content in all offspring of an element to a StringBuffer. Ignores all attributes, comments and processing instructions.
      Parameters:
      sb - will get the text content of the element children