posted 18 years ago
Hi,
I am using XSLT to transform a XML into another XML and running into the following error.
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
at com.filter.XMLFilter.transformXMLFile(XMLFilter.java:183)
at com.filter.XMLFilter.Run(XMLFilter.java:101)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
and goes on..........
I have been trying to resolve this from morning but of no use. Could someone help me in resolving this.
Here is my transformation code
TransformerFactory tFactory =TransformerFactory.newInstance();
StreamSource stylesource = new StreamSource(stylesource);
transformer = tFactory.newTransformer(stylesource); // This line is giveing the exception
DOMSource source = new DOMSource(document);
File f = new File(origFileName + "-transform.xml");
StreamResult result = new StreamResult(f);
transformer.transform(source, result);