Package writer2latex.util
Class SimpleDOMBuilder
java.lang.Object
writer2latex.util.SimpleDOMBuilder
This class provides a simple way to create and populate a DOM tree in logical order
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
characters
(String sText) Add characters to the currentElement.boolean
Set the current element to the parent of the current elementgetDOM()
Get the DOM treeboolean
setAttribute
(String sName, String sValue) Set an attribute of the current elementboolean
startElement
(String sTagName) Append an element to the current element and set this new element to be the current element.
-
Constructor Details
-
SimpleDOMBuilder
public SimpleDOMBuilder()
-
-
Method Details
-
startElement
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
Set an attribute of the current element- Parameters:
sName
-sValue
-- Returns:
- true on success, false if there is no current element
-
characters
Add characters to the currentElement. The actual writing of characters to the DOM is delayed until thestartElement
orendElement
methods are invoked- Parameters:
sText
-- Returns:
- true on success, false if there is no current element
-
getDOM
Get the DOM tree- Returns:
- the DOM tree, or null if none has been created
-