Re: have-child? method

Subject: Re: have-child? method
From: Daniel Speck <dspeck@xxxxxxx>
Date: Tue, 22 Jun 1999 09:10:13 -0400
Guillaume,

I would do something like:

(define (have-child? gi)
    (let ((matching-children (select-elements (children (current-node)) gi))

         (if (node-list-empty? matching-children)
            #f
            #t)))

You might want to make the node to test an optional parameter defaulting to
(current-node).

-dan

Guillaume Rouchy wrote:

> Hello,
>
> I would like to know if a node contains a specific child. Exactly as the
> "have-ancestor?" method do but in the other way. I know that no
> "have-child?" exists... how can I do this ?

--
Daniel Speck
Bureau of National Affairs, Inc.               Voice: +1 202.452.6596
1231 25th Street, NW                             Fax: +1 202.331.5178
Washington, DC 20037                          e-mail:  dspeck@xxxxxxx



 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread