<RefEntry id="descendant-ofX3F"> <!-- This file is generated automatically from the DSSSL source. --> <!-- Do not edit this file! --> <?html-filename descendant-of-p.html> <RefMeta> <RefEntryTitle>descendant-of?</RefEntryTitle> <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo> </RefMeta> <RefNameDiv> <RefName>descendant-of?</RefName> <RefPurpose>Returns true if the child is some descendant of the specified node</RefPurpose> </RefNameDiv> <RefSynopsisDiv><Title>Synopsis</Title> <Synopsis> (descendant-of? ancestor child) </Synopsis> </RefSynopsisDiv> <RefSect1><Title>Description</Title> <para> Returns <literal>#t</literal> if <literal>child</literal> is a descendant of <literal>ancestor</literal>.</para> </RefSect1> <RefSect1><Title>Author</Title> <para> Norman Walsh, <ndw@nwalsh.com> </para> </RefSect1> <RefSect1><Title>Source Code</Title> <ProgramListing> (define (descendant-of? ancestor child) ;; Returns true if the child is some descendant of the specified node (let loop ((c child)) (if (node-list-empty? c) #f (if (node-list=? ancestor c) #t (loop (parent c)))))) </ProgramListing> </RefSect1> </RefEntry>