cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "cib" <c....@laposte.net>
Subject Xsp logic help C2
Date Sat, 15 Sep 2001 16:33:52 GMT
hi,
I can't get to write the output.txt file from this xsp on Cocoon2

<?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:logic>
public class WriteMe {
      public static void main(String args[])
      {
try { //try to read from url
URL myurl = new URL( "http://localhost/cocoon/test/a1.html" );
BufferedInputStream inn = new BufferedInputStream(myurl.openStream());
BufferedWriter out = new BufferedWriter( new OutputStreamWriter( new
FileOutputStream("output.txt") ) );
for(;;) {
     int data = inn.read();
if (data == -1) {
break;
}
else {
out.write((char) data);
}
}
out.flush();
}
catch(MalformedURLException mue) { System.out.println("Invalid URL");}
catch(IOException ioe) { System.out.println("I/O Error - " + ioe);}
}
</xsp:logic>
  <page>

<xsp:expr>WriteMe()</xsp:expr>
make 1 xsp
  </page>
</xsp:page>

I only get a blank page:
The serialiser seems to work, but the xsl isn't applied and no output txt is
created.
If someone sees my mistake.

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