@Override
    public void startDocument() throws SAXException {
        try {
            if (xsltExecutable != null) {
                // Make sure the executable points at the local error handler.
                final Configuration configuration = xsltExecutable.getUnderlyingCompiledStylesheet().getConfiguration();
                configuration.setErrorListener(errorListener);
//                configuration.setLineNumbering(!pipelineContext.isStepping());

                // Create a handler to receive all SAX events.
                final TemplatesImpl templates = new TemplatesImpl(xsltExecutable);
                final TransformerImpl transformer = (TransformerImpl) templates.newTransformer();
                transformer.setErrorListener(errorListener);
                configureMessageListener(transformer);

                handler = transformer.newTransformerHandler();
                handler.setResult(new SAXResult(getFilter()));
                if (locator != null) {
                    handler.setDocumentLocator(locator);
                }
                handler.startDocument();

            } else if (passThrough) {
                super.startDocument();
            }

        } catch (final RuntimeException e) {
            final Throwable throwable = unwrapException(e);

            errorReceiverProxy.log(Severity.FATAL_ERROR,
                    getLocation(throwable),
                    getElementId(),
                    throwable.toString(),
                    throwable);
            // If we aren't stepping then throw an exception to terminate early.
            if (!pipelineContext.isStepping()) {
                throw LoggedException.wrap(throwable);
            }
        }
    }
@throws org.xml.sax.SAXException any SAX exception, possibly wrapping another exception
@see #endDocument
@see org.xml.sax.helpers.XMLFilterImpl#startDocument()
stroom-pipeline/src/main/java/stroom/pipeline/filter/XsltFilter.java