Re: selecting by multiple classes

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

Naturally, since (descendants) is already in tree order, a lot of that
was redundant.  This is more elegant:

(process-node-list
 (let fn-loop
     ((nl (node-list-reverse
           (node-list-filter
            (lambda (snl)
              (or (and (equal? (node-property 'class-name
                                              snl)
                               'element)
                       (equal? (gi snl)
                               (norm "footnote")))
                  (is-break-pi)))
            (descendants (current-node)))))
      (result (empty-node-list)))
   (if (or (node-list-empty? nl)
           (equal? (node-property 'class-name
                                  (node-list-first nl))
                   'pi))
       (node-list-reverse result)
       (fn-loop (node-list-rest nl)
                (node-list result
                           (node-list-first 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