<d:when xmlns:ac="http://www.askemos.org/2000/CoreAPI" xmlns:d="http://www.askemos.org/2005/NameSpaceDSSSL/" test="(equal? (data (form-field "action" (current-node))) "toggle-replication-state") ">
<ac:reply>
<ac:continue>
<d:copy-of select="(grove-root (current-node))"></d:copy-of>
</ac:continue>
<ac:replicates>
<d:copy-of select="#CONTENT">
(let* ((replicates (me 'replicates))
(li ((sxpath '(Bag li)) replicates))
(rdf (string->symbol "<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#")))">http://www.w3.org/1999/02/22-rdf-syntax-ns#")))</a>
(receive
(deleteable insertable)
(partition (lambda (name)
(ormap (lambda (li)
(equal? (attribute-string 'resource li) name))
li))
(map data (form-field 'name (current-node))))
(let ((nli (fold
(lambda (name init)
(if (equal? name "") init
(cons (make element gi: 'li ns: rdf
attributes: `((,rdf resource ,name))) init)))
(empty-node-list)
insertable))
(left (node-list-filter
(lambda (li) (not (member (attribute-string 'resource li) deleteable)))
li)))
(if (and (node-list-empty? nli) (node-list-empty? left))
(error "cowardly not removing the last supporter")
(make element gi: (gi replicates) ns: (ns replicates) attributes: (copy-attributes replicates)
(make element gi: 'Bag ns: rdf nli left))))))
</d:copy-of>
</ac:replicates>
<ac:output></ac:output>
</ac:reply>
</d:when>