From: Jan Nieuwenhuizen Date: Sun, 29 Sep 2002 23:52:47 +0000 (+0000) Subject: Fixes. X-Git-Tag: release/1.7.2~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=004d48222b0b69c84d73d8a17ae78603fd1b58e3;p=lilypond.git Fixes. --- diff --git a/scm/to-xml.scm b/scm/to-xml.scm index 47e8a6cf9b..76d78585d3 100644 --- a/scm/to-xml.scm +++ b/scm/to-xml.scm @@ -99,6 +99,12 @@ is then separated. (define (re-sub re to string) (regexp-substitute/global #f re string 'pre to 'post)) +(define (re-sub-alist string alist) + (re-sub (caar alist) (cdar alist) + (if (pair? (cdr alist)) + (re-sub-alist string (cdr alist)) + string))) + (define (open-tag tag attrs exceptions) (define (candidate? x) (not (memq (car x) exceptions))) @@ -115,20 +121,13 @@ is then separated. (symbol->string sym) "=\"" - (let ((s (call-with-output-string (lambda (port) (display val port))))) - ;; ugh - (re-sub - "\"" """ - (re-sub - "<" "<" - (re-sub - ">" ">" - (re-sub - "'" "'" - (re-sub - "&" "&" s)))))) - + (re-sub-alist s '(("\"" . """) + ("<" . "<") + (">" . ">") + ("'" . "'") + ("&" . "&")))) + "\"" )))