The sxml package has some strange behavior on DAGs. Before I go and try to fix 
it (or at least put a warning in the docs), I want to make sure it's a bug. 

The problem is that when a given node appears multiple times in an SXML 
document--that is, the eq?-same pointer--, calling sxml:modify to delete those 
nodes only deletes *some* of those instances.

#lang racket 
(require sxml)
(define zombie-node '(zombie))
(define t3 
 `(*TOP*
   (body
    (a ,zombie-node
       ,zombie-node)
    (b ,zombie-node
       ,zombie-node))))
(check-equal? ((sxml:modify '("//zombie" delete)) t3)
             `(*TOP* (body (a) (b))))

;; FAILS: produces (*TOP* (body (a (zombie)) (b (zombie)))) ... that is, half 
the zombies didn't die.

I claim the "most disgusting workaround of the week" award for my TeX-like 
solution of just calling sxml:modify again and again to get rid of them all... 

Anyhow, can any of the distinguished programmers familiar with this code 
confirm that this is not the desired behavior?

John

p.s.: sorry for the double-posting to three of you; my earlier message was sent 
with a bad From:, and got bounced from users.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to