Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

javax.xml.transform.TransformerException: Unknown error in XPath.

843834Aug 25 2006
Hi

I am getting
javax.xml.transform.TransformerException: Unknown error in XPath.
Caused by: java.lang.ClassCastException

from the snippet of code below.

TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer(new StreamSource(xslFile));
String outputString = "";
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
//_cat.info("Before Transform");
**** transformer.transform( new StreamSource(xmlFile), new StreamResult(outputStream));
//_cat.info("After Transform");
outputString = outputStream.toString();

printWriter = new PrintWriter(new FileWriter(new File(outFile)));
printWriter.write(outputString);
printWriter.flush();

I am getting the exception in the starred(****) line above.

Please guide me as to what could be the issue.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2006
Added on Aug 25 2006
0 comments
552 views