Hi Matt,
Matt Gushee <[email protected]> writes:
> I have observed the following undesired behavior:
[...]
> Any solutions for this?
I'm sorry that I didn't get around to changing Lowdown so that it
produces SXML conformant with the spec, yet. In the meantime you can use
this code to clean it up I think (works at least for your example):
(use srfi-1 sxml-transforms)
(define sxml-normalization-rules
`((*text* . ,(lambda (_ x) (->string x)))
(*default* . ,(lambda (tag children)
(cons tag
(append-map
(lambda (x)
(cond ((not (list? x)) (list x))
((null? x) x)
((symbol? (car x)) (list x))
(else x)))
children))))))
(define (normalize-sxml doc)
(pre-post-order* doc sxml-normalization-rules))
Jim, maybe sxml-serializer can be patched so that it handles this
situation in accordance with Postel's law, too?
Hope that helps!
Moritz
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users