cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sudheendra Hebbagilu <sudheen...@insage.com>
Subject RE: PI problem.
Date Wed, 11 Oct 2000 16:54:57 GMT
Hi,
If I am understanding it correctly, ur Servlet just calls xslt processor,
which will apply the given xsl to the xml file. 
May I ask why r u doing it that ? Cant u use cocoon to handle that ?
Any ways, if u were using cocoon, first it will call xsp processor, then
xslt processor (depending on the order of PI's in ur xml).
So if u do that in ur servlet probably it might work. My suggestion would be
to use Cocoon to handle all xml files.
HTH
Sudhi
--------------------------
>   public void service(HttpServletRequest servReq, HttpServletResponse
> servRes) throws
>       IOException
>    {
> 
> 
>      servRes.setContentType("text/html") ;
>      String sheet =
> "d:\\jakarta\\jakarta-tomcat\\webapps\\cocoon\\xml\\xsl\\hello.xsl" ;
>      String doc =
> "d:\\jakarta\\jakarta-tomcat\\webapps\\cocoon\\xml\\hello.xml" ;
> 
>      System.err.println("first.service -- entered");
> 
>      try{
>           XSLTProcessor processor = 
> XSLTProcessorFactory.getProcessor() ;
>           processor.process(new XSLTInputSource(new 
> FileInputStream(doc)) ,
> 			  new XSLTInputSource(new 
> FileInputStream(sheet)) ,
>                             new
> XSLTResultTarget(servRes.getOutputStream()));
>                System.err.println("second.service -- entered");
>         }
> 
>      catch (Exception e )
>        {
>           PrintWriter out = servRes.getWriter() ;
>           out.println("Error:"+ e ) ;
>           out.close() ;
>         }
>     }
> }
--------------------------------------

Mime
View raw message