TIVI-153: Add docbook-style-dssl as dep for iputils
[profile/ivi/docbook-style-dsssl.git] / common / dbl1nl.dsl
1 <!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
2 <!ENTITY % nl.words
3   PUBLIC "-//Norman Walsh//ENTITIES DocBook Stylesheet Localization//NL"
4          "dbl1nl.ent">
5 %nl.words;
6 ]>
7
8 <style-sheet>
9 <style-specification id="docbook-l10n-nl">
10 <style-specification-body>
11
12 ;; $Id: dbl1nl.dsl,v 1.2 2001/06/20 12:50:47 nwalsh Exp $
13 ;;
14 ;; This file is part of the Modular DocBook Stylesheet distribution.
15 ;; See ../README or http://nwalsh.com/docbook/dsssl/
16 ;;
17
18 ;; ----------------------------- Localization -----------------------------
19 ;;
20 ;; This is the Dutch localization
21 ;;
22 ;; If you create a new version of this file, please send it to
23 ;; Norman Walsh, ndw@nwalsh.com
24
25 ;; Contributors:
26 ;; Hugo van der Kooij, hvdkooij@caiw.nl
27 ;; Frederik Fouvry, fouvry@essex.ac.uk
28
29 ;; The generated text for cross references to elements.  See dblink.dsl
30 ;; for a discussion of how substitution is performed on the %x 
31 ;; keywords.
32 ;;
33
34 (define (nl-author-string #!optional (author (current-node)))
35   ;; Return a formatted string representation of the contents of:
36   ;; AUTHOR:
37   ;;   Handles Honorific, FirstName, SurName, and Lineage.
38   ;;     If %author-othername-in-middle% is #t, also OtherName
39   ;;   Handles *only* the first of each.
40   ;;   Format is "Honorific. FirstName [OtherName] SurName, Lineage"
41   ;; CORPAUTHOR:
42   ;;   returns (data corpauthor)
43   (let* ((h_nl (select-elements (descendants author) (normalize "honorific")))
44          (f_nl (select-elements (descendants author) (normalize "firstname")))
45          (o_nl (select-elements (descendants author) (normalize "othername")))
46          (s_nl (select-elements (descendants author) (normalize "surname")))
47          (l_nl (select-elements (descendants author) (normalize "lineage")))
48          (has_h (not (node-list-empty? h_nl)))
49          (has_f (not (node-list-empty? f_nl)))
50          (has_o (and %author-othername-in-middle%
51                      (not (node-list-empty? o_nl))))
52          (has_s (not (node-list-empty? s_nl)))
53          (has_l (not (node-list-empty? l_nl))))
54     (if (or (equal? (gi author) (normalize "author"))
55             (equal? (gi author) (normalize "editor"))
56             (equal? (gi author) (normalize "othercredit")))
57         (string-append
58          (if has_h (string-append (data-of (node-list-first h_nl)) 
59                                   %honorific-punctuation%) "")
60          (if has_f (string-append 
61                     (if has_h " " "") 
62                     (data-of (node-list-first f_nl))) "")
63          (if has_o (string-append
64                     (if (or has_h has_f) " " "")
65                     (data-of (node-list-first o_nl))) "")
66          (if has_s (string-append 
67                     (if (or has_h has_f has_o) " " "")
68                     (data-of (node-list-first s_nl))) "")
69          (if has_l (string-append ", " (data-of (node-list-first l_nl))) ""))
70         (data-of author))))
71
72 (define (nl-xref-strings)
73   (list (list (normalize "appendix")    (if %chapter-autolabel%
74                                             "&Appendix; %n"
75                                             "&appendix; %t"))
76         (list (normalize "article")     (string-append %gentext-nl-start-quote%
77                                                        "%t"
78                                                        %gentext-nl-end-quote%))
79         (list (normalize "bibliography") "%t")
80         (list (normalize "book")        "%t")
81         (list (normalize "chapter")     (if %chapter-autolabel%
82                                             "&Chapter; %n"
83                                             "&chapter; %t"))
84         (list (normalize "equation")    "&Equation; %n")
85         (list (normalize "example")     "&Example; %n")
86         (list (normalize "figure")      "&Figure; %n")
87         (list (normalize "glossary")    "%t")
88         (list (normalize "index")       "%t")
89         (list (normalize "listitem")    "%n")
90         (list (normalize "part")        "&Part; %n")
91         (list (normalize "preface")     "%t")
92         (list (normalize "procedure")   "&Procedure; %n, %t")
93         (list (normalize "reference")   "&Reference; %n, %t")
94         (list (normalize "section")     (if %section-autolabel%
95                                             "&Section; %n"
96                                             "&section; %t"))
97         (list (normalize "sect1")       (if %section-autolabel%
98                                             "&Section; %n"
99                                             "&section; %t"))
100         (list (normalize "sect2")       (if %section-autolabel%
101                                             "&Section; %n"
102                                             "&section; %t"))
103         (list (normalize "sect3")       (if %section-autolabel%
104                                             "&Section; %n"
105                                             "&section; %t"))
106         (list (normalize "sect4")       (if %section-autolabel%
107                                             "&Section; %n"
108                                             "&section; %t"))
109         (list (normalize "sect5")       (if %section-autolabel%
110                                             "&Section; %n"
111                                             "&section; %t"))
112         (list (normalize "simplesect")  (if %section-autolabel%
113                                             "&Section; %n"
114                                             "&section; %t"))
115         (list (normalize "sidebar")     "&sidebar; %t")
116         (list (normalize "step")        "&step; %n")
117         (list (normalize "table")       "&Table; %n")))
118
119 (define (gentext-nl-xref-strings gind)
120   (let* ((giname (if (string? gind) gind (gi gind)))
121          (name   (normalize giname))
122          (xref   (assoc name (nl-xref-strings))))
123     (if xref
124         (car (cdr xref))
125         (let* ((msg    (string-append "[&xrefto; "
126                                       (if giname giname "&nonexistantelement;")
127                                       " &unsupported;]"))
128                (err    (node-list-error msg (current-node))))
129           msg))))
130
131 (define (nl-auto-xref-indirect-connector before)
132   (literal " &in; "))
133
134 ;; Should the TOC come first or last?
135 ;;
136 (define %generate-nl-toc-in-front% #t)
137
138 ;; gentext-element-name returns the generated text that should be 
139 ;; used to make reference to the selected element.
140 ;;
141
142 (define (nl-element-name)
143   (list
144    (list (normalize "abstract")         "&Abstract;")
145    (list (normalize "answer")           "&Answer;")
146    (list (normalize "appendix")         "&Appendix;")
147    (list (normalize "article")          "&Article;")
148    (list (normalize "bibliography")     "&Bibliography;")
149    (list (normalize "book")             "&Book;")
150    (list (normalize "calloutlist")      "")
151    (list (normalize "caution")          "&Caution;")
152    (list (normalize "chapter")          "&Chapter;")
153    (list (normalize "copyright")        "&Copyright;")
154    (list (normalize "dedication")       "&Dedication;")
155    (list (normalize "edition")          "&Edition;")
156    (list (normalize "equation")         "&Equation;")
157    (list (normalize "example")          "&Example;")
158    (list (normalize "figure")           "&Figure;")
159    (list (normalize "glossary")         "&Glossary;")
160    (list (normalize "glosssee")         "&GlossSee;")
161    (list (normalize "glossseealso")     "&GlossSeeAlso;")
162    (list (normalize "important")        "&Important;")
163    (list (normalize "index")            "&Index;")
164    (list (normalize "colophon")         "&Colophon;")
165    (list (normalize "setindex")         "&SetIndex;")
166    (list (normalize "isbn")             "&isbn;")
167    (list (normalize "legalnotice")      "&LegalNotice;")
168    (list (normalize "msgaud")           "&MsgAud;")
169    (list (normalize "msglevel")         "&MsgLevel;")
170    (list (normalize "msgorig")          "&MsgOrig;")
171    (list (normalize "note")             "&Note;")
172    (list (normalize "part")             "&Part;")
173    (list (normalize "preface")          "&Preface;")
174    (list (normalize "procedure")        "&Procedure;")
175    (list (normalize "pubdate")          "&Published;")
176    (list (normalize "question")         "&Question;")
177    (list (normalize "refentry")         "&RefEntry;")
178    (list (normalize "reference")        "&Reference;")
179    (list (normalize "refname")          "&RefName;")
180    (list (normalize "revhistory")       "&RevHistory;")
181    (list (normalize "refsect1")         "&RefSection;")
182    (list (normalize "refsect2")         "&RefSection;")
183    (list (normalize "refsect3")         "&RefSection;")
184    (list (normalize "refsynopsisdiv")   "&RefSynopsisDiv;")
185    (list (normalize "revision")         "&Revision;")
186    (list (normalize "sect1")            "&Section;")
187    (list (normalize "sect2")            "&Section;")
188    (list (normalize "sect3")            "&Section;")
189    (list (normalize "sect4")            "&Section;")
190    (list (normalize "sect5")            "&Section;")
191    (list (normalize "section")          "&Section;")
192    (list (normalize "simplesect")       "&Section;")
193    (list (normalize "seeie")            "&See;")
194    (list (normalize "seealsoie")        "&Seealso;")
195    (list (normalize "set")              "&Set;")
196    (list (normalize "sidebar")          "&Sidebar;")
197    (list (normalize "step")             "&step;")
198    (list (normalize "table")            "&Table;")
199    (list (normalize "tip")              "&Tip;")
200    (list (normalize "toc")              "&TableofContents;")
201    (list (normalize "warning")          "&Warning;")
202    ))
203
204 (define (gentext-nl-element-name gind)
205   (let* ((giname (if (string? gind) gind (gi gind)))
206          (name   (normalize giname))
207          (pname  (assoc name (nl-element-name))))
208     (if pname
209         (car (cdr pname))
210         (let* ((msg (string-append 
211                      "gentext-nl-element-name: &unexpectedelementname;: "
212                      name))
213                (err (node-list-error msg (current-node))))
214           msg))))
215
216 ;; gentext-element-name-space returns gentext-element-name with a 
217 ;; trailing space, if gentext-element-name isn't "".
218 ;;
219 (define (gentext-nl-element-name-space giname)
220   (string-with-space (gentext-element-name giname)))
221
222 ;; gentext-intra-label-sep returns the seperator to be inserted
223 ;; between multiple occurances of a label (or parts of a label)
224 ;; for the specified element.  Most of these are for enumerated
225 ;; labels like "Figure 2-4", but this function is used elsewhere
226 ;; (e.g. REFNAME) with a little abuse.
227 ;;
228
229 (define (local-nl-intra-label-sep)
230   (list))
231
232 (define (nl-intra-label-sep)
233   (list
234    (list (normalize "equation")         "-")
235    (list (normalize "informalequation") "-")
236    (list (normalize "example")          "-")
237    (list (normalize "figure")           "-")
238    (list (normalize "listitem")         ".")
239    (list (normalize "procedure")        ".")
240    (list (normalize "refentry")         ".")
241    (list (normalize "reference")        ".")
242    (list (normalize "refname")          ", ")
243    (list (normalize "refsect1")         ".")
244    (list (normalize "refsect2")         ".")
245    (list (normalize "refsect3")         ".")
246    (list (normalize "sect1")            ".")
247    (list (normalize "sect2")            ".")
248    (list (normalize "sect3")            ".")
249    (list (normalize "sect4")            ".")
250    (list (normalize "sect5")            ".")
251    (list (normalize "section")          ".")
252    (list (normalize "simplesect")       ".")
253    (list (normalize "step")             ".")
254    (list (normalize "table")            "-")
255    (list (normalize "_pagenumber")      "-")
256    ))
257
258 (define (gentext-nl-intra-label-sep gind)
259   (let* ((giname (if (string? gind) gind (gi gind)))
260          (name   (normalize giname))
261          (lsep   (assoc name (local-nl-intra-label-sep)))
262          (sep    (assoc name (nl-intra-label-sep))))
263     (if lsep
264         (car (cdr lsep))
265         (if sep
266             (car (cdr sep))
267             ""))))
268
269 ;; gentext-label-title-sep returns the seperator to be inserted
270 ;; between a label and the text following the label for the
271 ;; specified element.  Most of these are for use between
272 ;; enumerated labels and titles like "1. Chapter One Title", but
273 ;; this function is used elsewhere (e.g. NOTE) with a little
274 ;; abuse.
275 ;;
276
277 (define (local-nl-label-title-sep)
278   (list))
279
280 (define (nl-label-title-sep)
281   (list
282    (list (normalize "abstract")         ": ")
283    (list (normalize "answer")           " ")
284    (list (normalize "appendix")         ". ")
285    (list (normalize "caution")          "")
286    (list (normalize "chapter")          ". ")
287    (list (normalize "equation")         ". ")
288    (list (normalize "example")          ". ")
289    (list (normalize "figure")           ". ")
290    (list (normalize "footnote")         ". ")
291    (list (normalize "glosssee")         ": ")
292    (list (normalize "glossseealso")     ": ")
293    (list (normalize "important")        ": ")
294    (list (normalize "note")             ": ")
295    (list (normalize "orderedlist")      ". ")
296    (list (normalize "part")             ". ")
297    (list (normalize "procedure")        ". ")
298    (list (normalize "prefix")           ". ")
299    (list (normalize "question")         " ")
300    (list (normalize "refentry")         "")
301    (list (normalize "reference")        ". ")
302    (list (normalize "refsect1")         ". ")
303    (list (normalize "refsect2")         ". ")
304    (list (normalize "refsect3")         ". ")
305    (list (normalize "sect1")            ". ")
306    (list (normalize "sect2")            ". ")
307    (list (normalize "sect3")            ". ")
308    (list (normalize "sect4")            ". ")
309    (list (normalize "sect5")            ". ")
310    (list (normalize "section")          ". ")
311    (list (normalize "simplesect")       ". ")
312    (list (normalize "seeie")            " ")
313    (list (normalize "seealsoie")        " ")
314    (list (normalize "step")             ". ")
315    (list (normalize "table")            ". ")
316    (list (normalize "tip")              ": ")
317    (list (normalize "warning")          "")
318    ))
319
320 (define (gentext-nl-label-title-sep gind)
321   (let* ((giname (if (string? gind) gind (gi gind)))
322          (name   (normalize giname))
323          (lsep   (assoc name (local-nl-label-title-sep)))
324          (sep    (assoc name (nl-label-title-sep))))
325     (if lsep
326       (car (cdr lsep))
327       (if sep
328           (car (cdr sep))
329           ""))))
330
331 (define (nl-label-number-format-list)
332   (list
333    (list (normalize "set")              "1")
334    (list (normalize "book")             "1")
335    (list (normalize "prefix")           "1")
336    (list (normalize "part")             "I")
337    (list (normalize "chapter")          "1")
338    (list (normalize "appendix")         "A")
339    (list (normalize "reference")        "I")
340    (list (normalize "example")          "1")
341    (list (normalize "figure")           "1")
342    (list (normalize "table")            "1")
343    (list (normalize "procedure")        "1")
344    (list (normalize "step")             "1")
345    (list (normalize "refsect1")         "1")
346    (list (normalize "refsect2")         "1")
347    (list (normalize "refsect3")         "1")
348    (list (normalize "sect1")            "1")
349    (list (normalize "sect2")            "1")
350    (list (normalize "sect3")            "1")
351    (list (normalize "sect4")            "1")
352    (list (normalize "sect5")            "1")
353    (list (normalize "section")          "1")
354    ))
355
356 (define (nl-label-number-format gind)
357   (let* ((giname (if (string? gind) gind (gi gind)))
358          (name   (normalize giname))
359          (format (assoc name (nl-label-number-format-list))))
360     (if format
361         (car (cdr format))
362         "1")))
363
364 (define (nl-lot-title)
365   (list
366    (list (normalize "table")            "&ListofTables;")
367    (list (normalize "example")          "&ListofExamples;")
368    (list (normalize "figure")           "&ListofFigures;")
369    (list (normalize "equation")         "&ListofEquations;")
370    ))
371
372 (define ($lot-title-nl$ gind)
373   (let* ((giname (if (string? gind) gind (gi gind)))
374          (name   (normalize giname))
375          (title  (assoc name (nl-lot-title))))
376     (if title
377         (car (cdr title))
378         (let* ((msg (string-append "&ListofUnknown;: " name))
379                (err (node-list-error msg (current-node))))
380           msg))))
381
382 (define %gentext-nl-start-quote% (dingbat "ldquo"))
383
384 (define %gentext-nl-end-quote% (dingbat "rdquo"))
385
386 (define %gentext-nl-start-nested-quote% (dingbat "lsquo"))
387
388 (define %gentext-nl-end-nested-quote% (dingbat "rsquo"))
389
390 (define %gentext-nl-by% "&by;") ;; e.g. Copyright 1997 "by" A. Nonymous
391                            ;; Authored "by" Jane Doe
392
393 (define %gentext-nl-edited-by% "&Editedby;")
394                            ;; "Edited by" Jane Doe
395
396 (define %gentext-nl-revised-by% "&Revisedby;")
397                            ;; "Revised by" Jane Doe
398
399 (define %gentext-nl-page% "")
400
401 (define %gentext-nl-and% "&and;")
402
403 (define %gentext-nl-listcomma% "&listcomma;")
404
405 (define %gentext-nl-lastlistcomma% "&lastlistcomma;")
406
407 (define %gentext-nl-bibl-pages% "&Pgs;")
408
409 (define %gentext-nl-endnotes% "&Notes;")
410
411 (define %gentext-nl-table-endnotes% "&TableNotes;:")
412
413 (define %gentext-nl-index-see% "&See;")
414
415 (define %gentext-nl-index-seealso% "&SeeAlso;")
416
417
418 (define (gentext-nl-nav-prev prev) 
419   (make sequence (literal "&nav-prev;")))
420
421 (define (gentext-nl-nav-prev-sibling prevsib) 
422   (make sequence (literal "&nav-prev-sibling;")))
423
424 (define (gentext-nl-nav-next-sibling nextsib)
425   (make sequence (literal "&nav-next-sibling;")))
426
427 (define (gentext-nl-nav-next next)
428   (make sequence (literal "&nav-next;")))
429
430 (define (gentext-nl-nav-up up)
431   (make sequence (literal "&nav-up;")))
432
433 (define (gentext-nl-nav-home home)
434   (make sequence (literal "&nav-home;")))
435
436
437
438 </style-specification-body>
439 </style-specification>
440 </style-sheet>