Cleanup of stylesheets. Changed path to docbook.dsl.
[yaz-moved-to-github.git] / doc / yazphp.dsl
1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY docbook.dsl SYSTEM "../../docbook-dsssl/html/docbook.dsl"
3   CDATA DSSSL>
4 ]>
5 <!--
6   $Id: yazphp.dsl,v 1.2 2001-07-20 21:33:45 adam Exp $
7 -->
8 <style-sheet>
9 <style-specification use="docbook">
10 <style-specification-body>
11
12 (define %html-ext% ".php")
13 (define %shade-verbatim% #t)
14
15 (define (php-code code)
16   (make processing-instruction
17     data: (string-append "php " code "?")))
18
19 (define (html-document title-sosofo body-sosofo)
20   (let* (;; Let's look these up once, so that we can avoid calculating
21          ;; them over and over again.
22          (prev         (prev-chunk-element))
23          (next         (next-chunk-element))
24          (prevm        (prev-major-component-chunk-element))
25          (nextm        (next-major-component-chunk-element))
26          (navlist      (list prev next prevm nextm))
27          
28          ;; Let's make it possible to control the output even in the
29          ;; nochunks case. Note: in the nochunks case, (chunk?) will
30          ;; return #t for only the root element.
31          (make-entity? (and (or (not nochunks) rootchunk)
32                             (chunk?)))
33          
34          (make-head?   (or make-entity?
35                            (and nochunks
36                                 (node-list=? (current-node)
37                                              (sgml-root-element)))))
38          (doc-sosofo 
39           (if make-head?
40               (make sequence
41                 (php-code "require \"../id_common.inc\"")
42                 (make element gi: "HTML"
43                       (make element gi: "HEAD"
44                             (make element gi: "TITLE " title-sosofo)
45                             ($standard-html-header$ prev next prevm nextm))
46                       (make element gi: "BODY"
47                             attributes: (append
48                                          (list (list "CLASS" (gi)))
49                                          %body-attr%)
50                             (header-navigation (current-node) navlist)
51                             body-sosofo
52                             (footer-navigation (current-node) navlist)
53                             )
54                       )
55                 (php-code "id_footer();")
56                 )
57               body-sosofo
58               )
59           )
60          )
61     (if make-entity?
62         (make entity
63           system-id: (html-entity-file (html-file))
64           (if %html-pubid%
65               (make document-type
66                 name: "HTML"
67                 public-id: %html-pubid%)
68               (empty-sosofo))
69           doc-sosofo)
70         (if (node-list=? (current-node) (sgml-root-element))
71             (make sequence
72               (if %html-pubid%
73                   (make document-type
74                     name: "HTML"
75                     public-id: %html-pubid%)
76                   (empty-sosofo))
77               doc-sosofo)
78             doc-sosofo))))
79
80 </style-specification-body>
81 </style-specification>
82 <external-specification id="docbook" document="docbook.dsl">
83 </style-sheet>
84