Problem in Transformation of an XML.

Hi All,

I am trying to Transform an xml object using the XSL file using servlet.

1)Created an object for TransformFactory listed below.

TransformerFactory xsltFactory = TransformerFactory.newInstance();

2) Created a Source object and the code is listed below:

Source strXslSource = null;

try{

strXslSource = new StreamSource(new File(xslFilePath));

}

catch(Exception exp)

{

exp.printStackTrace();

}

3) Then tried to create the Transformer object with the line by passing Source object which represents XSL file.

Transformer transformer = xsltFactory.newTransformer(strXslSource);

4) Finally trying to flush the data as shown below:

try {

InputStream in = httpservletrequest.getInputStream();

Source source= new StreamSource(in);

PrintWriter out = httpservletresponse.getWriter();

Result result= new StreamResult(out);

transformer.transform(source, result);

httpservletresponse.flushBuffer();

}

Facing the problem while creating the Transformer object and the exception is listed below:

EXCEPTION MESSAGE :Message : javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found

Exception Stack Trace

javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.parsers.FactoryConfigurationError: Provider for javax.xml.parsers.SAXParserFactory cannot be found

at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:816)

Can any one please give me the solution to the problem.

Sonashree.

[1860 byte] By [sonashreea] at [2007-11-27 2:51:48]
# 1
Please do not cross-post. http://forum.java.sun.com/thread.jspa?threadID=5167102- Saish
Saisha at 2007-7-12 3:25:19 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Yes I do have the below listed jars in my classpath.xml4j.jarxerces.jarxalan.jarxml-apis.jar - All the Transformation related files are present in this jar file.
sonashreea at 2007-7-12 3:25:19 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...