Package writer2latex.util

# Class SimpleXMLParser

java.lang.Object
org.xml.sax.helpers.DefaultHandler
writer2latex.util.SimpleXMLParser

All Implemented Interfaces:
  `ContentHandler`, `DTDHandler`, `EntityResolver`, `ErrorHandler`

public class SimpleXMLParser extends DefaultHandler
A simple SAX based XML parser which transforms the SAX events into a DOM tree (supporting element and text nodes only)

## Constructor Summary

Constructors
Constructor
Description
`SimpleXMLParser()`

## Method Summary

Modifier and Type
Method
Description
`void`
`characters(char[] characters, int nStart, int nEnd)`
`void`
`endElement(String nameSpace, String localName, String qName)`
`Document`
`getDOM()`
`static Document`
`parse(InputStream is)`
Static method to parse an XML input stream into a DOM tree
`InputSource`
`resolveEntity(String publicID, String systemID)`
`void`
`startElement(String nameSpace, String localName, String qName, Attributes attributes)`

### Methods inherited from class org.xml.sax.helpers.DefaultHandler

`endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning`

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

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

### Methods inherited from interface org.xml.sax.ContentHandler

`declaration`

## Constructor Details

### SimpleXMLParser

public SimpleXMLParser()

## Method Details

### parse

public static Document parse(InputStream is) throws IOException, SAXException
Static method to parse an XML input stream into a DOM tree

Parameters:
  `is` - the input stream to parse
Returns:
  a DOM tree of the document
Throws:
  `IOException` - if an error occurs reading the input stream
  `SAXException` - if an error occurs parsing the stream

### getDOM

public Document getDOM()

### resolveEntity

public InputSource resolveEntity(String publicID, String systemID) throws SAXException

Specified by:
  `resolveEntity` in interface `EntityResolver`
Overrides:
  `resolveEntity` in class `DefaultHandler`
Throws:
  `SAXException`

### startElement

public void startElement(String nameSpace, String localName, String qName, Attributes attributes)

Specified by:
  `startElement` in interface `ContentHandler`
Overrides:
  `startElement` in class `DefaultHandler`

### endElement

public void endElement(String nameSpace, String localName, String qName)

Specified by:
  `endElement` in interface `ContentHandler`
Overrides:
  `endElement` in class `DefaultHandler`

### characters

public void characters(char[] characters, int nStart, int nEnd) throws SAXException

Specified by:
  `characters` in interface `ContentHandler`
Overrides:
  `characters` in class `DefaultHandler`
Throws:
  `SAXException`