Class SimpleDOMBuilder

java.lang.Object
writer2latex.util.SimpleDOMBuilder

public class SimpleDOMBuilder extends Object
This class provides a simple way to create and populate a DOM tree in logical order
  • Constructor Details

    • SimpleDOMBuilder

      public SimpleDOMBuilder()
  • Method Details

    • startElement

      public boolean startElement(String sTagName)
      Append an element to the current element and set this new element to be the current element. If there is no current element, a new DOM tree will be created (discarding the current DOM tree if any) with the new element as the document element.
      Parameters:
      sTagName -
      Returns:
      true on success
    • endElement

      public boolean endElement()
      Set the current element to the parent of the current element
      Returns:
      true on success, false if there is no current element to end
    • setAttribute

      public boolean setAttribute(String sName, String sValue)
      Set an attribute of the current element
      Parameters:
      sName -
      sValue -
      Returns:
      true on success, false if there is no current element
    • characters

      public boolean characters(String sText)
      Add characters to the currentElement. The actual writing of characters to the DOM is delayed until the startElement or endElement methods are invoked
      Parameters:
      sText -
      Returns:
      true on success, false if there is no current element
    • getDOM

      public Document getDOM()
      Get the DOM tree
      Returns:
      the DOM tree, or null if none has been created