systemId = "file:/"+systemId;
systemId = "file:"+systemId;
    private ContentHandler getOutputHandler(Result result) 	throws TransformerException {	// Try to get the encoding from Translet (may not be set)	if (_translet._encoding != null)	    _encoding = _translet._encoding;	else	    _encoding = "utf-8"; // default output encoding	try {	    String systemId = result.getSystemId();	    // Handle SAXResult output handler	    if (result instanceof SAXResult) {		final SAXResult target = (SAXResult)result;		final ContentHandler handler = target.getHandler();		// Simple as feck, just pass the SAX handler back...		if (handler != null) return handler;	    }	    // Handle StreamResult output handler	    else if (result instanceof StreamResult) {		final StreamResult target = (StreamResult)result;		final OutputStream ostream = target.getOutputStream();		final Writer writer = target.getWriter();		if (ostream != null)		    return (new DefaultSAXOutputHandler(ostream, _encoding));		else if (writer != null)		    return (new DefaultSAXOutputHandler(writer, _encoding));	    }	    // Handle DOMResult output handler	    else if (result instanceof DOMResult) {		return (new SAX2DOM());	    }	    // Common, final handling of all input sources, only used if the	    // other contents of the Result object could not be used	    if (systemId != null) {		if ((new File(systemId)).exists())		    systemId = "file:/"+systemId;		final URL url = new URL(systemId);		final URLConnection connection = url.openConnection();		final OutputStream ostream = connection.getOutputStream();		return(new DefaultSAXOutputHandler(ostream, _encoding));	    }	    else {		throw new TransformerException(OUTPUT_RESULT_EMPTY);	    }	}	// If we cannot write to the location specified by the SystemId	catch (UnknownServiceException e) {	    throw new TransformerException(e);	}	// If we cannot create a SAX2DOM adapter	catch (ParserConfigurationException e) {	    throw new TransformerException(		"SAX2DOM adapter could not be created, " + e.getMessage());	}	// If we cannot create the file specified by the SystemId	catch (IOException e) {	    throw new TransformerException(e);	}    }