[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SAXException..

Subject: SAXException..
From: Krishnam Raju <krishnamrajua@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Jul 2002 10:03:04 +0530
saxexception jar
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.