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

RE: SAXException..

Subject: RE: SAXException..
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 4 Jul 2002 09:15:19 +0100
saxexception jar
First thing to do is to establish beyond doubt which XML Parser is being
loaded. This problem occurs when the XSLT processor requests a parsing
feature that the XML parser doesn't support, and in tomcat this usually
happens because the system is set up to load the wrong parser.

Using System.setProperty("javax.xml.parsers.SAXParserFactory", ...) can
help to ensure you get the parser you want.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Krishnam Raju
> Sent: 04 July 2002 05:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  SAXException..
> 
> 
> 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
> 


 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-2013 All Rights Reserved.