You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ron Chan <rc...@i-tao.com> on 2000/06/01 16:08:02 UTC

Output to file

I picked this up from an older message as a possible way of generating output to file

java -cp <classpath> org.apache.cocoon.Cocoon \ 
        -p cocoon.properties input.xml output.html 


is it possible to do this from within a servlet or a xsp file??



Ron

 

Re: Output to file

Posted by Russell Castagnaro <ru...@synctank.com>.
// Get the XML Document
        File xmlFile = new File(_path,_xml);
        File xslFile = new File(_path,_xsl);
    FileWriter out = new FileWriter("file.out");

     XSLTProcessor processor = XSLTProcessorFactory.getProcessor();

    processor.process(new XSLTInputSource(new FileReader(xmlFile)),
                      new XSLTInputSource(new FileReader(xslFile)),
                      new XSLTResultTarget(out));

Gensky Regnus wrote:

> Quoting Ron Chan <rc...@i-tao.com>:
>
> > would it be possible to give me an example of how
> you'd redirect the > output to a writer?
> >
>
> I would also be interested to see how this is done.
>
> Regards,
> Gensky Regnus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org

--
Hope to see you at my presentation, "Making the Most of XML, XSL and Server-Side
Processing"
at XML DevCon 2000, June 25-28, 2000.

Russell Castagnaro
Chief Mentor
SyncTank Solutions
http://www.synctank.com

Earth is the cradle of mankind; one does not remain in the cradle forever
-Tsiolkovsky



Re: Output to file

Posted by Gensky Regnus <re...@techolap.com>.
Quoting Ron Chan <rc...@i-tao.com>:

> would it be possible to give me an example of how 
you'd redirect the > output to a writer?
>

I would also be interested to see how this is done.

Regards,
Gensky Regnus

Re: Output to file

Posted by Ron Chan <rc...@i-tao.com>.
would it be possible to give me an example of how you'd redirect the output to a writer?

Thanks
ron

 
  ----- Original Message ----- 
  From: Russell Castagnaro 
  To: cocoon-users@xml.apache.org 
  Sent: Thursday, June 01, 2000 6:09 PM
  Subject: Re: Output to file


  Ron, 
  You really don't need to as you can write the output to any writer (including a filewriter) from a servlet or xsp. 
  -rrc 
  Ron Chan wrote: 

    I picked this up from an older message as a possible way of generating output to file java -cp <classpath> org.apache.cocoon.Cocoon \ 
            -p cocoon.properties input.xml output.html is it possible to do this from within a servlet or a xsp file??   Ron 
  -- 
  Hope to see you at my presentation, "Making the Most of XML, XSL and Server-Side Processing" 
  at XML DevCon 2000, June 25-28, 2000. 

  Russell Castagnaro 
  Chief Mentor 
  SyncTank Solutions 
  http://www.synctank.com 

  Earth is the cradle of mankind; one does not remain in the cradle forever 
  -Tsiolkovsky 
    --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-users-help@xml.apache.org