Re: chains of SXML transformations?
[email protected] Wed, 22 Oct 2003 11:54:56 -0700 (PDT)
| Newsgroups | gmane.lisp.scheme.ssax-sxml |
|---|---|
| Message-ID | <[email protected]> |
> Your solution is not 100% right, though (ah, those nasty border cases):
My apologies. Indeed, an empty list, albeit not a pair, is a node-list
nevertheless. Please replace map-node-concat in the previous message
with the following:
(define (map-node-concat fn lst)
(if (null? lst) '()
(let ((result (fn (car lst))))
(cond
((null? result) ; It's a null node-list, splice it in
(map-node-concat fn (cdr lst)))
((and (pair? result) (not (symbol? (car result))))
; it's a non-null node-list
(append result (map-node-concat fn (cdr lst))))
(else
(cons result (map-node-concat fn (cdr lst))))))))
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54