RE: -t sgml / table of contents problem - solved.

Subject: RE: -t sgml / table of contents problem - solved.
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Mon, 6 Oct 1997 15:32:11 +0100
Problem solved!!!

Two functions, one to add link, one to create anchor
;; I used 'article' as the prefix to identifier.

(define (add-anchor #!optional (node(current-node)))
 (make element
  gi:"A"
  attributes:(list
              (list "name"
               (string-append "article"
                (format-number (element-number) "1"))))
  (empty-sosofo)))

;; usage
(element (article title)
(make sequence
  (add-anchor)
  (make element gi: "XX"
  (process-children))))

;; create link


(define (add-toc-ref #!optional (node(current-node)))
(make element 
 gi:"A"
 attributes:(list
             (list "href" 
               (string-append "#article" 
                 ( format-number (element-number ) "1"))))
	(process-children)))
;; usage
(mode toc
 (default (empty-sosofo))
 (element body article title)
 (make sequence
  (make element gi: "yy"
  (add-toc-ref))))

Thanks folks

regards, DaveP

 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread