This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
SAXException..
- From: Krishnam Raju <krishnamrajua at qatalystechnologies dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 4 Jul 2002 10:03:04 +0530
- Subject: [xsl] SAXException..
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi all,
Small help.
I have written the following code in servlet.
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerConfigurationException;
import javax.servlet.http.*;
import javax.servlet.*;
// Imported java classes
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.*;
public class SimpleTransform1 extends HttpServlet
{
public void doGet(HttpServletRequest req,HttpServletResponse
res)throws ServletException,IOException
{
PrintWriter out = res.getWriter();
out.println("Inside the doget method");
try{
createXml(res);
}catch(Exception e){System.out.println("Inside the Exception
: "+e.getMessage());}
}
public void createXml(HttpServletResponse res)throws
TransformerException, TransformerConfigurationException,
FileNotFoundException, IOException
{
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new
StreamSource("/xmlexamples/xml/emp.xsl"));
transformer.transform(new StreamSource("/xmlexamples/xml/emp.xml"),
new StreamResult(new FileOutputStream("/xmlexamples/xml/emp.html")));
}
}
I am using Tomcat4.0 Web server.
When I execute this servlet I am gettig the following exception.
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: org.xml.sax.SAXException:
Namespace not supported by SAXParser
But When I place this code in simple java file, this is working fine.
I have given the following jar files in the class path.
xerces-2_0_1\xercesImpl.jar;
xerces-2_0_1\xmlParserAPIs.jar;
xalan-j_2_3_1\bin\xalan.jar;
xalan-j_2_3_1\bin\xml-apis.jar;
xalan-j_2_3_1\bin\xalanservlet.jar;
Can any body give me the solution?
Raju.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list