;;; Harmonic Flow web site (define-module (apps aux sxml) #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (sxml->string*)) (define (sxml->string* tree) "Flatten tree by dismissing tags and attributes, and return the resulting string." (define (sxml->strings tree) (match tree (((? symbol?) ('@ _ ...) body ...) (append-map sxml->strings `(" " ,@body " "))) (((? symbol?) body ...) (append-map sxml->strings `(" " ,@body " "))) ((? string?) (list tree)) ((lst ...) (sxml->strings `(div ,@lst))))) (string-concatenate (sxml->strings tree)))