The Modular DocBook Stylesheets
PrevDSSSL LibraryNext

absolute-child-number

Name

absolute-child-number — Returns the absolute child number of the specified node

Synopsis

(absolute-child-number snl)

Description

Returns the child number, regardless of gi, of snl within its parent.

Isn't there a better way to get this?

snl

The node (singleton node list) whose child number is desired.

Author

Norman Walsh, <norm@berkshire.net>

Source Code

(define (absolute-child-number snl)
  ;; Returns the absolute child number of the specified node
  (let loop ((nl (children (parent snl))) (count 1))
    (if (node-list-empty? nl)
	#f
	(if (node-list=? (node-list-first nl) snl)
	    count
	    (loop (node-list-rest nl) (+ count 1))))))

PrevHomeNext
%library-version%Upancestor-member