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