<RefEntry id="ancestor-member">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename ancestor-member.html>

<RefMeta>
  <RefEntryTitle>ancestor-member</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>ancestor-member</RefName>
  <RefPurpose>Returns the first ancestor in a list of GIs</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(ancestor-member nd gilist)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Returns the first ancestor of <literal>nd</literal> whose GI that is a member of <literal>gilist</literal>.</para>


</RefSect1>

<RefSect1><Title>Author</Title>

<para>
Norman Walsh, &lt;ndw@nwalsh.com&gt;
</para>
</RefSect1>
<RefSect1><Title>Source Code</Title>

<ProgramListing>
(define (ancestor-member nd gilist)
  ;; Returns the first ancestor in a list of GIs
  (if (node-list-empty? nd)
      (empty-node-list)
      (if (member (gi nd) gilist)
	  nd
	  (ancestor-member (parent nd) gilist))))
</ProgramListing>
</RefSect1>

</RefEntry>
