You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Prashant Sarode <ps...@brience.com> on 2001/02/08 03:24:49 UTC
Namespace not supported by SAXParser
Problem Statement---Convert foo.xml using foo.xsl using a Java
Servlet---Trying my first Hallo world Xalan Java2.0 code
I am using a JavaServlet in which I am doing three simple steps as follows:
public class FrontComponent extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws FileNotFoundException,IOException, ServletException
{
String msgText;
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Front Component</title>");
out.println("</head>");
out.println("<body>");
out.println("<H1>");
out.println("Xalang Performance Through Tomcat----");
out.println("</H1>");
out.println("<HR SIZE=1/>");
try{
//Step1
TransformerFactory tFactory =
TransformerFactory.newInstance();
//Step2
Transformer transformer = tFactory.newTransformer(new
StreamSource("file:///C:/birds.xsl"));
//Step3
transformer.transform(new StreamSource("birds.xml"), new
StreamResult(new FileOutputStream("birds.out")));
msgText="Transformation Done Successfully";
}catch(Exception e){
msgText="Error Occured while Transformation :----- " +
e.getMessage();
}
//Print the Msg Text
out.println(msgText);
out.println("</body>");
out.println("</html>");
}
}
WHen I do this I get a the Error message mentioned in the subject line. I
looked a very complicated sample servlet using xalan transformation. That
example uses some really very complicated way of getting xmlSOurce and
xslSource.
Any kind of help or direction would be apprecited:
-I tried using relative path.
-I tried using HTTP URL
-I tried using the same stuff in a standalone app with xsl and xml in same
dir. ANd it works fine.
Prashant Sarode
RE: Namespace not supported by SAXParser
Posted by chris markiewicz <cm...@commnav.com>.
i had a similar problem...it's something in your servlet engine's
classpath...you have to make sure that your xerces and xalan jars appear
before jaxp.jar, parser.jar, and xt.jar. that's the theory anyway. i moved
to some other stuff before i got a chance to try it out. that's why it
works with your standalone app...if you put those jars in the classpath of
your standalone, you'll get the same problem.
chris
-----Original Message-----
From: Prashant Sarode [mailto:psarode@brience.com]
Sent: Wednesday, February 07, 2001 9:25 PM
To: 'xalan-dev@xml.apache.org'
Subject: Namespace not supported by SAXParser
Problem Statement---Convert foo.xml using foo.xsl using a Java
Servlet---Trying my first Hallo world Xalan Java2.0 code
I am using a JavaServlet in which I am doing three simple steps as follows:
public class FrontComponent extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws FileNotFoundException,IOException, ServletException
{
String msgText;
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<body>");
out.println("<head>");
out.println("<title>Front Component</title>");
out.println("</head>");
out.println("<body>");
out.println("<H1>");
out.println("Xalang Performance Through Tomcat----");
out.println("</H1>");
out.println("<HR SIZE=1/>");
try{
//Step1
TransformerFactory tFactory =
TransformerFactory.newInstance();
//Step2
Transformer transformer = tFactory.newTransformer(new
StreamSource("file:///C:/birds.xsl"));
//Step3
transformer.transform(new StreamSource("birds.xml"), new
StreamResult(new FileOutputStream("birds.out")));
msgText="Transformation Done Successfully";
}catch(Exception e){
msgText="Error Occured while Transformation :----- " +
e.getMessage();
}
//Print the Msg Text
out.println(msgText);
out.println("</body>");
out.println("</html>");
}
}
WHen I do this I get a the Error message mentioned in the subject line. I
looked a very complicated sample servlet using xalan transformation. That
example uses some really very complicated way of getting xmlSOurce and
xslSource.
Any kind of help or direction would be apprecited:
-I tried using relative path.
-I tried using HTTP URL
-I tried using the same stuff in a standalone app with xsl and xml in same
dir. ANd it works fine.
Prashant Sarode