Re: selecting by multiple classes

Subject: Re: selecting by multiple classes
From: Chris Maden <crism@xxxxxxxxxxx>
Date: Thu, 29 Jul 1999 14:14:24 -0400 (EDT)
Here's what worked, in very reasonable time:

(let ((fn-list (select-elements (descendants (current-node))
                                (norm "footnote")))
      (last-break-pi (find-last-break))
      (sorted-nl (node-list-filter (lambda (snl)
                                     (member (node-property 'class-name
                                                            snl)
                                             '(element
                                               pi)))
                                   (subtree (current-node)))))
  (process-node-list (let fn-loop
                         ((nl (node-list-intersection sorted-nl
                                                      (node-list fn-list
                                                                 last-break-pi))))
                       (if (or (node-list-empty? nl)
                               (equal? (node-property 'class-name
                                                      (node-list-first nl))
                                       'pi))
                           (node-list-rest nl)
                           (fn-loop (node-list-rest nl))))))

-Chris
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread