public class XMLTools
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
readXMLChunk(java.io.BufferedReader reader,
org.xml.sax.helpers.DefaultHandler m_handler,
java.lang.String chunkToken)
Attempts to read XML file in chunks, passing each chunk to a SAX parser.
|
public static boolean readXMLChunk(java.io.BufferedReader reader, org.xml.sax.helpers.DefaultHandler m_handler, java.lang.String chunkToken) throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException
reader
- the reader to read the XML fromm_handler
- the SAX parser to feed the XML tochunkToken
- the token to read. The parser will locate the first instance of
<chunkToken and will buffer all content, including the opening tag and up to
and including the closing </chunkToken> tag. It will not currently handle
<chunkToken/> instances, nor instances where more than one tag appears per line,
or extra spaces appear between the angle brackets, slashes, and tag name of the
tag we are searching for.javax.xml.parsers.ParserConfigurationException
- if there was a problem setting up the SAX parser.org.xml.sax.SAXException
- if there was a problem parsing the XML.java.io.IOException
- if there was a problem reading the XML from the reader.