[plt-scheme] Pretty-printing XML

Henk Boom lunarc.lists at gmail.com
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)))

    Henk



More information about the plt-scheme mailing list