[plt-scheme] Request for pretty-printing in webserver

From: dvanhorn at emba.uvm.edu (dvanhorn at emba.uvm.edu)
Date: Sat Mar 29 18:27:49 EST 2003

I'd like for the web server to emit pretty printed XML in the case of calling
send/suspend with an X-expression.  Currently the web server prints a single
line of XML, which can be difficult to read.

An easy solution is to change the (xexpr->string page) expression (line 773,
web-server-unit.ss) to:

(let ((tmp-out (open-output-string)))
  (display-xml/content (xexpr->xml page) tmp-out)
  (get-output-string tmp-out))

Although this is inefficient, but necessary so that Content-length can be
included in the headers.

Is there, perhaps, a better way of doing this?  Is there a reason for not doing
this, ie for using the xexpr->string approach?


Posted on the users mailing list.