@Override
    public void parse(final InputSource input) throws IOException, SAXException {
        // Reset some variables in case this parser is being reused.
        inRecord = false;
        root.clear();
        profilingExecutor = null;
        messageBuffer.clear();

        // Get the error handler adaptor if we can so that other message
        // severities can be reported.
        errorHandlerAdaptor = (ErrorHandlerAdaptor) getErrorHandler();

        // Start profiling service if we need to.
        startProfiling();

        // Add a location reader so that we can inform the pipeline what the
        // current read location is.
        if (reader == null) {
            reader = new DS3Reader(input.getCharacterStream(), minBuffer, maxBuffer);
        } else {
            // Reuse the reader if we can as it saves discarding a char buffer.
            reader.setReader(input.getCharacterStream());
        }

        // Set the locator so that the filters know what the current document
        // location is.
        getContentHandler().setDocumentLocator(reader);

        // Start creating the XML output.
        startDocument();

        // Fill up the buffer.
        reader.fillBuffer();

        // Loop round the top level expressions as many times as necessary to
        // match as much content as possible.
        process(root,
                reader,
                null,
                0,
                0,
                MatchOrder.SEQUENCE,
                root.isIgnoreErrors());

        // Make sure we consumed all of the input (ignoring trailing
        // whitespace).
        if (!root.isIgnoreErrors() && (!reader.isEof() || !reader.isBlank())) {
            log(Severity.ERROR, "Top level expressions failed to match all of the content.");
        }

        // Close the reader.
        reader.close();

        // Finish creating the XML output.
        endDocument();

        // Stop profiling service.
        stopProfiling();
    }
Parses a flat file and produces SAX events according to the feed
definition.

@param input The flat input source to process.
@throws IOException  Could be thrown reading the stream.
@throws SAXException Not be thrown as we are not reading an XML file just using
                     the XMLReader interface.
@see org.xml.sax.XMLReader#parse(org.xml.sax.InputSource)
stroom-pipeline/src/main/java/stroom/pipeline/xml/converter/ds3/DS3Parser.java