Nethtml.document -> String

"Rakotomandimby (R12y) Mihamina" <[email protected]> Sat, 21 May 2005 00:42:15 +0200
Newsgroups gmane.comp.lang.ocaml.lib.net.devel
Message-ID <1116628936.17033.7.camel@vavahady>
Hello,

I made these things and I cant find what is my mistake. Would you help
me? The goal is to print the HTML page to the screen just to debug for
small applications, and if it works well I could use it and see how it
behaves on the cgi script. I try to output a Nethtml.document to a
Buffer, and then print the content of the buffer.

# let page = Nethtml.Element (  "body", [], [Nethtml.Data("rien")]);;
val page : Nethtml.document =
  Nethtml.Element ("body", [], [Nethtml.Data "rien"])
# let tampon = Buffer.create 80 ;;
val tampon : Buffer.t = <abstr>
#  let canal = new Netchannels.output_buffer tampon in
   Nethtml.write canal [page] ; print_string (tampon.contents);;
This expression has type Buffer.t but is here used with type 'a ref


"tampon" is the underlined word.
What I expected is to have 

<body>rien</body>

displayed.

Thank you for your help...

-- 
Get a fully managed dedicated server for €200/month ($257/month)
No time limit for taking care of your server.
You keep the "root" acces if you want. Billing periods are 3 months.
See the conditions at http://aspo.rktmb.org/activities/managed_servers



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click