StreamResult sresult = (StreamResult) outputTarget;
String method = format.getProperty(OutputKeys.METHOD);
try
{
Serializer serializer =
SerializerFactory.getSerializer(format.getProperties());
if (null != sresult.getWriter())
serializer.setWriter(sresult.getWriter());
else if (null != sresult.getOutputStream())
serializer.setOutputStream(sresult.getOutputStream());
else if (null != sresult.getSystemId())
{
String fileURL = sresult.getSystemId();
if (fileURL.startsWith("file:///"))
{
if (fileURL.substring(8).indexOf(":") >0)
fileURL = fileURL.substring(8);
else
fileURL = fileURL.substring(7);
}
m_outputStream = new java.io.FileOutputStream(fileURL);
serializer.setOutputStream(m_outputStream);
}
else
throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_OUTPUT_SPECIFIED, null)); //"No output specified!");
handler = serializer.asContentHandler();
this.setSerializer(serializer);
}
catch (UnsupportedEncodingException uee)
{