You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by cib <c....@laposte.net> on 2001/09/29 19:16:31 UTC
Save on disk: IT WORKS!
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>