/usr/share/sgml/docbook/stylesheet/dsssl/modular/html/dbpi.dsl is in docbook-dsssl 1.79-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ;; $Id: dbpi.dsl,v 1.2 2003/04/28 05:18:24 adicarlo Exp $
;;
;; This file is part of the Modular DocBook Stylesheet distribution.
;; See ../README or http://nwalsh.com/docbook/dsssl/
;;
(define (pi-value component piname)
;; Returns the value of the (?piname value) PI (if one exists)
;; as a child of component, otherwise returns #f
;;
(let loop ((nl (select-by-class (children component) 'pi)))
(if (node-list-empty? nl)
#f
(let ((pidata (node-property 'system-data (node-list-first nl))))
(if (and (> (string-length pidata) (string-length piname))
(equal? piname
(substring pidata 0 (string-length piname))))
(substring pidata
(+ (string-length piname) 1)
(string-length pidata))
(loop (node-list-rest nl)))))))
(define (inherited-pi-value component piname)
(let loop ((value #f) (nd component))
(if (or value (node-list-empty? nd))
value
(loop (pi-value nd piname) (parent nd)))))
(define (dbhtml-findvalue pi-field-list name)
;; pi-field-list is '(pitarget name1 value1 name2 value2 ...)
(let loop ((slist (cdr pi-field-list)))
(if (or (null? slist)
(not (pair? slist)))
#f
(if (string=? (car slist) name)
(car (cdr slist))
(loop (cdr (cdr slist)))))))
(define (dbhtml-value component name)
;; Returns the value of "name='value'" in the <?dbhtml ...> PI
(let loop ((nl (select-by-class (children component) 'pi)))
(if (node-list-empty? nl)
#f
(let* ((pidata (node-property 'system-data (node-list-first nl)))
(pilist (if (and (> (string-length pidata) 7)
(string=? (substring pidata 0 7) "dbhtml "))
(parse-starttag-pi pidata)
'()))
(value (if (null? pilist) #f (dbhtml-findvalue pilist name))))
(if value
value
(loop (node-list-rest nl)))))))
(define (inherited-dbhtml-value component name)
(let loop ((value #f) (nd component))
(if (or value (node-list-empty? nd))
value
(loop (dbhtml-value nd name) (parent nd)))))
;; EOF dbpi.dsl
|