I have something like:
String baseXSL = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n .... "
(I want to be able to modify the XSL on the fly)
Then I create a streamSource like ...
StreamSource theXSL = new StreamSource(new ByteArrayInputStream(baseXSL.getBytes()));
for use in something like ...
Templates template = tFactory.newTemplates(theXSL);
Transformer xslTrans = template.newTransformer();
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
Result res = new StreamResult(byteStream);
xslTrans.transform(theXML, res);
I get an:
ERROR Servlet.service() for servlet action threw exception
java.io.EOFException
when trying to build the streamSource out of the String instead of out of a filePath (which works just fine).
Any ideas?
TIA!
String baseXSL = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n .... "
(I want to be able to modify the XSL on the fly)
Then I create a streamSource like ...
StreamSource theXSL = new StreamSource(new ByteArrayInputStream(baseXSL.getBytes()));
for use in something like ...
Templates template = tFactory.newTemplates(theXSL);
Transformer xslTrans = template.newTransformer();
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
Result res = new StreamResult(byteStream);
xslTrans.transform(theXML, res);
I get an:
ERROR Servlet.service() for servlet action threw exception
java.io.EOFException
when trying to build the streamSource out of the String instead of out of a filePath (which works just fine).
Any ideas?
TIA!