[plt-scheme] Pretty-printing XML

From: Henk Boom (lunarc.lists at gmail.com)
Date: Thu Jan 3 01:59:08 EST 2008

There is already display-xml in the xml collection, why not go for
completeness and include something like xexpr->pretty-string? I've
implemented it in my code as follows, but I'm sure there's a more
direct way to do it in the library itself.

  (define (xexpr->pretty-string x)
    (let ((out (open-output-string)))
      (display-xml/content (xexpr->xml x) out)
      (get-output-string out)))


Posted on the users mailing list.