Re: returning a nodelist

Subject: Re: returning a nodelist
From: Norman Walsh <ndw@xxxxxxxxxx>
Date: Thu, 10 Dec 1998 15:10:35 -0500
| which suggests to my untrained eye that JADE is interpreting
| nd as a function and finding that it isn't one.
| So my question is, how do I return a nodelist so I can process
| it further?

Instead of returning (nd), return nd.

(define (named-nl node name)
  (let* ((gr (node-property 'grove-root node))
         (de (node-property 'document-element gr)))
    (let loop ((nl (node-property 'content de)))
      (if (node-list-empty? nl) #f
          (let ((nd (node-list-first nl)))
            (or (and (equal? 'element (node-property 'class-name nd))
                     (if (string=? name (gi nd))
                         nd ; <<<<----return the nodelist
                         (loop (node-property 'content nd))))
                (loop (node-list-rest nl))))))))

Norman Walsh <ndw@xxxxxxxxxx>      | Curiosity never killed anything                 | except maybe a few hours.

 DSSSList info and archive:

Current Thread