cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cib" <c....@laposte.net>
Subject Save on disk: IT WORKS!
Date Sat, 29 Sep 2001 17:16:31 GMT
Thanks to all of you out there who helped me on this.

Here is my final code.

MAKE1.xsp

***************

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:esql="http://apache.org/cocoon/SQL/v2">

<xsp:structure>
  <xsp:include>java.io.*</xsp:include>
  <xsp:include>java.net.*</xsp:include>
</xsp:structure>



<xsp:logic>



class make_xsl {
   public void main() {

try {
URL myurl = new URL( "http://mydoain/cocoon/test/a1.html" );
BufferedInputStream inn = new BufferedInputStream(myurl.openStream());
BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new
FileOutputStream("G:\\Tomcat\\webapps\\cocoon\\xml\\test\\pages\\output3.txt
") ) );
for(;;) {
     int data = inn.read();
if (data == -1) {
break;
}
else {
out.write((char) data);
}
}
out.flush();
       } catch (FileNotFoundException e) {
           System.err.println("CheckedIODemo1: " + e);
       } catch (java.io.IOException e) {
           System.err.println("CheckedIODemo2: " + e);
 } catch (NoSuchMethodError e) {
           System.err.println("CheckedIODemo3: " + e);
 } catch (Exception e) {
           System.err.println("CheckedIODemo4: " + e);
} catch (NoClassDefFoundError e) {
           System.err.println("CheckedIODemo5: " + e);
      }
 }
}

</xsp:logic>


  <page>
<xsp:logic>
    make_xsl anObject = new make_xsl();
    anObject.main();
</xsp:logic>


If you see this, it works.
  </page>
</xsp:page>

****************

Thanks again.
Cib

France, Bordeaux, xml and gay pride.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message