Re: Problem With tree-before

Subject: Re: Problem With tree-before
From: Richard Light <richard@xxxxxxxxxxxxxxxxx>
Date: Fri, 3 Apr 1998 11:19:08 +0100
In message <>, "W. Eliot
Kimber" <eliot@xxxxxxxxxx> writes
>I'm trying to implement the preceding XPointer location term using
>tree-before, which I think matches the behavior of preceding(). Using the
>definitions in the DSSSL standard, I copied over all the functions that
>Jade didn't implement. However, I now get an infinite loop somewhere in the
>chain. Before I spend a lot of time chasing down the problem, I was
>wondering if anyone else had tried to do this and ran into a typo in the
>DSSSL spec or something. I looked at the DSSSL list archive but didn't find
>anything. The functions I had to copy are:

In my copy of the standard I have annotated the following change to

(define (node-list-filter proc n1)
        (node-list-reduce n1
                (lambda (result sn1)
                        (if (proc sn1)
                            (node-list result sn1)
; this was (node-list sn1 result) in the standard

(Just don't ask me how I found out this was wrong, or what the change

Incidentally, I also have an annotation for (ancestors) with the
commentary 'error (loops)', so you can have that one too:

(define (ancestors n1)
        (node-list-map (lambda (sn1)
                (let loop (cur (parent sn1))
                        (result (empty-node-list)))
                (if (node-list-empty? cur)
                    (loop (parent cur) ; was sn1 in printed standard
                          (node-list cur result)))))

Hope this does it,


Richard Light
SGML/XML and Museum Information Consultancy

 DSSSList info and archive:

Current Thread
  • Problem With tree-before
    • W. Eliot Kimber - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id XAA19330Thu, 2 Apr 1998 23:56:00 -0500 (EST)
      • Richard Light - from mail1.ability.netby (8.8.5/8.6.12) with ESMTP id FAA29410Fri, 3 Apr 1998 05:30:21 -0500 (EST) <=