Equivalent for (tree-before?)

Subject: Equivalent for (tree-before?)
From: Chris Maden <crism@xxxxxxxxxxx>
Date: Thu, 29 Jul 1999 12:23:45 -0400 (EDT)
I need to check which footnotes come before a page break:

(let ((fn-list (select-elements (descendants (current-node))
                                (norm "footnote")))
      (last-break-pi (node-list-last (find-break-pis))))
  (process-node-list (node-list-filter (lambda (cand)
                                         (tree-before? last-break-pi
                                                       cand))
                                       fn-list)))

I've implemented the reference functions from ISO/IEC 10179, and it's
*really* slow (presumably because of (sort-in-tree-order)).

Is there a faster way to do this?  In this case, I can use a variant
of (sort-in-tree-order) that only gets the (subtree) for the current
context (I only need to do this inside DocBook <sidebar>s), but it
would be nice to know another way.  When only elements are involved, I
just use (all-element-number), but that doesn't work when one of the
nodes is not an element.

Thanks in advance,
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