Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 6b3585ea67ce3e79c9049b5b33294cdd > files > 661

docbook-style-dsssl-doc-1.79-16.mga7.noarch.rpm

<RefEntry id="node-list-X3Estring">
<!-- This file is generated automatically from the DSSSL source. -->
<!-- Do not edit this file! -->
<?html-filename node-2-string.html>

<RefMeta>
  <RefEntryTitle>node-list->string</RefEntryTitle>
  <RefMiscInfo Role="file">dblib.dsl</RefMiscInfo>
</RefMeta>

<RefNameDiv>
  <RefName>node-list->string</RefName>
  <RefPurpose>Return a string representation of the node list</RefPurpose>
</RefNameDiv>

<RefSynopsisDiv><Title>Synopsis</Title>
<Synopsis>
(node-list->string nodelist)
</Synopsis>
</RefSynopsisDiv>

<RefSect1><Title>Description</Title>

<para>
Builds a string representation of the node list and returns it.
The representation is 
</para>
<para>
"gi(firstchildgi()secondchildgi(firstgrandchildgi())) secondgi()..."
</para>
<para>
This is a debugging function, in case that wasn't obvious...</para>


</RefSect1>

<RefSect1><Title>Author</Title>

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

<ProgramListing>
(define (node-list->string nodelist)
  ;; Return a string representation of the node list
  (let loop ((nl nodelist) (res ""))
    (if (node-list-empty? nl)
	res
	(loop (node-list-rest nl)
	      (string-append res 
			     (if (gi (node-list-first nl))
				 (string-append
				  (gi (node-list-first nl))
				  "("
				  (node-list->string 
				   (children (node-list-first nl)))
				  ")")
				 ""))))))
</ProgramListing>
</RefSect1>

</RefEntry>