Package writer2latex.util

# 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 Summary

Constructors
Constructor
Description
`SimpleDOMBuilder()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`characters(String sText)`
Add characters to the currentElement.
`boolean`
`endElement()`
Set the current element to the parent of the current element
`Document`
`getDOM()`
Get the DOM tree
`boolean`
`setAttribute(String sName, String sValue)`
Set an attribute of the current element
`boolean`
`startElement(String sTagName)`
Append an element to the current element and set this new element to be the current element.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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