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

From: Paul Graunke (ptg at ccs.neu.edu)
Date: Wed Apr 2 09:13:31 EST 2003

display-xml is broken.  It inserts newlines into the middle of whitespace
sensitive tags, resulting in a document that means something different.
For example '(p "This text is " (em "important") "!!!") would have
extra space before the !!!'s.  The function needs to accept a listof tags
where newlines are (or are not) allowed.

Paul

At Sat, 29 Mar 2003 17:49:07 -0600, Robby Findler wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> I'm not sure, but I suspect it does that for efficiency reasons. 
> 
> One thing you can do when you're debugging is to use Emacs to turn the
> file into something slightly more readable by replacing > with >^J. You
> can do this with these keystrokes:
> 
>   M-x replace-string
>   >
>   >^Q^J
> 
> Or, you can write a little script that reads in the xml and displays it
> back out again when you read it.
> 
> Or, were you wanting to do this for other than debugging reasons?
> 
> Robby
> 
> At Sat, 29 Mar 2003 18:27:49 -0500 (EST), dvanhorn at emba.uvm.edu wrote:
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > 
> > 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?
> > 
> > Thanks.
> > -d
> > 
> > 
> > 



Posted on the users mailing list.