Package writer2latex.util
Class SimpleDOMBuilder
- java.lang.Object
-
- writer2latex.util.SimpleDOMBuilder
-
public class SimpleDOMBuilder extends java.lang.Object
This class provides a simple way to create and populate a DOM tree in logical order
-
-
Constructor Summary
Constructors Constructor Description SimpleDOMBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
characters(java.lang.String sText)
Add characters to the currentElement.boolean
endElement()
Set the current element to the parent of the current elementorg.w3c.dom.Document
getDOM()
Get the DOM treeboolean
setAttribute(java.lang.String sName, java.lang.String sValue)
Set an attribute of the current elementboolean
startElement(java.lang.String sTagName)
Append an element to the current element and set this new element to be the current element.
-
-
-
Method Detail
-
startElement
public boolean startElement(java.lang.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(java.lang.String sName, java.lang.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(java.lang.String sText)
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
public org.w3c.dom.Document getDOM()
Get the DOM tree- Returns:
- the DOM tree, or null if none has been created
-
-