This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Xalan problem with Strings as input/output


---- begin Sample Code ----
public class XslUtil {
	public static String transform(String xslFile, String
xmlString)
	{
		try {
			File file = new File(xslFile);
			StreamSource xslSource = new StreamSource(file);
			xslSource.setSystemId(xslFile);
			xslSource.setPublicId(xslFile);

			TransformerFactory tFactory =
TransformerFactory.newInstance();
			Transformer transformer =
tFactory.newTransformer(xslSource);

			StringReader reader = new StringReader(xmlString);
			StringWriter writer = new StringWriter();

			transformer.transform(new StreamSource(reader), new
StreamResult(writer));

			writer.flush();
			return writer.toString();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

---- End Sample Code ----


When I call this method from main of a my java class,
and I print out the
return string to System.out, everyting works ok.  But
if I call this
method from some other java application which is
continuously running
then the return string value is null.

Do you see anything obvious that I am missing?

Is there any way to debug this?  I am using the Xalan
2.0 tool.

Thanks.

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]