sgml-root-element — Returns the node that is the root element of the current document
Synopsis
(sgml-root-element)
Description
Return the root element of the document by walking up from
wherever we are. (Isn't this built-in to DSSSL somehow???)
Author
Norman Walsh, <ndw@nwalsh.com>
Source Code
(define (sgml-root-element)
;; Returns the node that is the root element of the current document
(let loop ((root (current-node)))
(if (node-list-empty? (parent root))
root
(loop (parent root)))))