/
tabular-docbook.xsl
5051 lines (4460 loc) · 182 KB
/
tabular-docbook.xsl
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:html='http://www.w3.org/1999/xhtml'
xmlns:doc='http://nwalsh.com/xsl/documentation/1.0'
xmlns:suwl='http://nwalsh.com/xslt/ext/com.nwalsh.saxon.UnwrapLinks'
exclude-result-prefixes='doc html'
version='1.0'>
<!--
This is a docbook XSL stylesheet customization that embeds the
DocBook document chunking formalism within the DocBook Website
formalism, in order to extend the hierarchical tabular navigation
menu of Docbook website to the chunked sections of website
embedded books, parts or articles.
Caveat: Website really likes unique IDs on all chunkable nodes.
As a bonus, it still works for Website 'webpage' documents too!
Webpages are explicitly unchunkable
Actually if you omit to define the 'autolayout-file' parameter string
you may well find yourself with a stand-alone chunked tabular book,
of a sort ...
Customization by Doug du Boulay (2005) ddb@owari.msl.titech.ac.jp
Be freeeee...
-->
<!--
<xsl:import href='xbel.xsl'/>
<xsl:include href='VERSION'/>
<xsl:include href='head.xsl'/>
<xsl:include href='rss.xsl'/>
<xsl:include href='olink.xsl'/>
-->
<xsl:preserve-space elements='*'/>
<xsl:strip-space elements='website webpage'/>
<xsl:output method='html'
indent='no'/>
<!-- ====================================================================== -->
<!--
|
|file: html/admon.xsl
| replace "base.dir" with "$target.doc.dir.path"
|
-->
<!--
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html='http://www.w3.org/1999/xhtml'
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
exclude-result-prefixes="doc html"
version="1.0">
<xsl:output method="html"/>
-->
<!-- ==================================================================== -->
<xsl:param name="website" select="''"/> <!-- part of a larger website -->
<xsl:param name="tabular" select="'0'"/> <!-- for the website tabular toc style -->
<xsl:param name="website.database.document"
select="'website.database.xml'"/>
<!-- ==================================================================== -->
<xsl:param name="header.hr" select="1"/>
<doc:param name="header.hr" xmlns="">
<refpurpose>Toggle <HR> after header</refpurpose>
<refdescription>
<para>If non-zero, an <HR> is generated at the top of each web page,
after the heaader.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="footer.hr" select="1"/>
<doc:param name="footer.hr" xmlns="">
<refpurpose>Toggle <HR> before footer</refpurpose>
<refdescription>
<para>If non-zero, an <HR> is generated at the bottom of each web page,
before the footer.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="feedback.href"></xsl:param>
<doc:param name="feedback.href" xmlns="">
<refpurpose>HREF for feedback link</refpurpose>
<refdescription>
<para>The <varname>feedback.href</varname> value is used as the value
for the <sgmltag class="attribute">href</sgmltag> attribute on the feedback
link. If <varname>feedback.href</varname>
is empty, no feedback link is generated.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="feedback.with.ids" select="0"/>
<doc:param name="feedback.with.ids" xmlns="">
<refpurpose>Toggle use of IDs in feedback</refpurpose>
<refdescription>
<para>If <varname>feedback.with.ids</varname> is non-zero, the ID of the
current page will be added to the feedback link. This can be used, for
example, if the <varname>feedback.href</varname> is a CGI script.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="feedback.link.text">Feedback</xsl:param>
<doc:param name="feedback.link.text" xmlns="">
<refpurpose>The text of the feedback link</refpurpose>
<refdescription>
<para>The contents of this variable is used as the text of the feedback
link if <varname>feedback.href</varname> is not empty. If
<varname>feedback.href</varname> is empty, no feedback link is
generated.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="filename-prefix" select="''"/>
<doc:param name="filename-prefix" xmlns="">
<refpurpose>Prefix added to all filenames</refpurpose>
<refdescription>
<para>To produce the <quote>text-only</quote> (that is, non-tabular) layout
of a website simultaneously with the tabular layout, the filenames have to
be distinguished. That's accomplished by adding the
<varname>filename-prefix</varname> to the front of each filename.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="autolayout-file" select="'autolayout.xml'"/>
<doc:param name="autolayout-file" xmlns="">
<refpurpose>Identifies the autolayout.xml file</refpurpose>
<refdescription>
<para>When the source pages are spread over several directories, this
parameter can be set (for example, from the command line of a batch-mode
XSLT processor) to indicate the location of the autolayout.xml file.</para>
<para>FIXME: for browser-based use, there needs to be a PI for this...
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="output-root" select="'.'"/>
<doc:param name="ouput-root" xmlns="">
<refpurpose>Specifies the root directory of the website</refpurpose>
<refdescription>
<para>When using the XSLT processor to manage dependencies and construct
the website, this parameter can be used to indicate the root directory
where the resulting pages are placed.</para>
<para>Only applies when XSLT-based chunking is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="dry-run" select="'0'"/>
<doc:param name="dry-run" xmlns="">
<refpurpose>Indicates that no files should be produced</refpurpose>
<refdescription>
<para>When using the XSLT processor to manage dependencies and construct
the website, this parameter can be used to suppress the generation of
new and updated files. Effectively, this allows you to see what the
stylesheet would do, without actually making any changes.</para>
<para>Only applies when XSLT-based chunking is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="rebuild-all" select="'0'"/>
<doc:param name="" xmlns="">
<refpurpose>Indicates that all files should be produced</refpurpose>
<refdescription>
<para>When using the XSLT processor to manage dependencies and construct
the website, this parameter can be used to regenerate the whole website,
updating even pages that don't appear to need to be updated.</para>
<para>The dependency extension only looks at the source documents. So
if you change something in the stylesheet, for example, that has a global
effect, you can use this parameter to force the stylesheet to rebuild the
whole website.
</para>
<para>Only applies when XSLT-based chunking is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="nav.table.summary">Navigation</xsl:param>
<doc:param name="nav.table.summary" xmlns="">
<refpurpose>HTML Table summary attribute value for navigation tables</refpurpose>
<refdescription>
<para>The value of this parameter is used as the value of the table
summary attribute for the navigation table.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="navtocwidth">220</xsl:param>
<doc:param name="navtocwidth" xmlns="">
<refpurpose>Specifies the width of the navigation table TOC</refpurpose>
<refdescription>
<para>The width, in pixels, of the navigation column.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="navbodywidth"></xsl:param>
<doc:param name="navbodywidth" xmlns="">
<refpurpose>Specifies the width of the navigation table body</refpurpose>
<refdescription>
<para>The width of the body column.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="textbgcolor">white</xsl:param>
<doc:param name="textbgcolor" xmlns="">
<refpurpose>The background color of the table body</refpurpose>
<refdescription>
<para>The background color of the table body.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="navbgcolor">#4080FF</xsl:param>
<doc:param name="navbgcolor" xmlns="">
<refpurpose>The background color of the navigation TOC</refpurpose>
<refdescription>
<para>The background color of the navigation TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.spacer.graphic" select="1"/>
<doc:param name="toc.space.graphic" xmlns="">
<refpurpose>Use graphic for TOC spacer?</refpurpose>
<refdescription>
<para>If non-zero, the indentation in the TOC will be accomplished
with the graphic identified by <varname>toc.spacer.image</varname>.
</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.spacer.text">   </xsl:param>
<doc:param name="toc.spacer.text" xmlns="">
<refpurpose>The text for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.spacer.graphic</varname> is zero, this text string
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.spacer.image">graphics/blank.gif</xsl:param>
<doc:param name="toc.spacer.image" xmlns="">
<refpurpose>The image for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.spacer.graphic</varname> is non-zero, this image
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.pointer.graphic" select="1"/>
<doc:param name="toc.space.graphic" xmlns="">
<refpurpose>Use graphic for TOC pointer?</refpurpose>
<refdescription>
<para>If non-zero, the indentation in the TOC will be accomplished
with the graphic identified by <varname>toc.pointer.image</varname>.
</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.pointer.text">   </xsl:param>
<doc:param name="toc.pointer.text" xmlns="">
<refpurpose>The text for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.pointer.graphic</varname> is zero, this text string
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.pointer.image">graphics/blank.gif</xsl:param>
<doc:param name="toc.pointer.image" xmlns="">
<refpurpose>The image for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.pointer.graphic</varname> is non-zero, this image
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.blank.graphic" select="1"/>
<doc:param name="toc.space.graphic" xmlns="">
<refpurpose>Use graphic for TOC blank?</refpurpose>
<refdescription>
<para>If non-zero, the indentation in the TOC will be accomplished
with the graphic identified by <varname>toc.blank.image</varname>.
</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.blank.text">   </xsl:param>
<doc:param name="toc.blank.text" xmlns="">
<refpurpose>The text for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.blank.graphic</varname> is zero, this text string
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="toc.blank.image">graphics/blank.gif</xsl:param>
<doc:param name="toc.blank.image" xmlns="">
<refpurpose>The image for spacing the TOC</refpurpose>
<refdescription>
<para>If <varname>toc.blank.graphic</varname> is non-zero, this image
will be used to indent the TOC.</para>
<para>Only applies with the tabular presentation is being used.</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="suppress.homepage.title" select="'1'"/>
<doc:param name="" xmlns="">
<refpurpose></refpurpose>
<refdescription>
<para></para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:attribute-set name="body.attributes">
<xsl:attribute name="bgcolor">white</xsl:attribute>
<xsl:attribute name="text">black</xsl:attribute>
<xsl:attribute name="link">#0000FF</xsl:attribute>
<xsl:attribute name="vlink">#840084</xsl:attribute>
<xsl:attribute name="alink">#0000FF</xsl:attribute>
</xsl:attribute-set>
<doc:attribute-set name="body.attributes" xmlns="">
<refpurpose>DEPRECATED</refpurpose>
<refdescription>
<para></para>
</refdescription>
</doc:attribute-set>
<!-- ==================================================================== -->
<xsl:param name="sequential.links" select="'0'"/>
<doc:param name="sequential.links" xmlns="">
<refpurpose></refpurpose>
<refdescription>
<para></para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="currentpage.marker" select="'@'"/>
<doc:param name="currentpage.marker" xmlns="">
<refpurpose></refpurpose>
<refdescription>
<para></para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="banner.before.navigation" select="1"/>
<doc:param name="banner.before.navigation" xmlns="">
<refpurpose></refpurpose>
<refdescription>
<para></para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="table.spacer.image" select="'graphics/spacer.gif'"/>
<doc:param name="table.spacer.image" xmlns="">
<refpurpose>Invisible pixel for tabular accessibility</refpurpose>
<refdescription>
<para>This is the 1x1 pixel, transparent pixel used for
<ulink url="http://diveintoaccessibility.org/day_10_presenting_your_main_content_first.html">the table trick</ulink> to increase the accessibility of the tabular
website presentation.
</para>
</refdescription>
</doc:param>
<!-- ==================================================================== -->
<xsl:param name="tabular.chunk.root.banner.filename" select="'graphics/banner.png'"/>
<xsl:param name="tabular.chunk.root.banner.altval" select="'doc root node'"/>
<xsl:param name="tabular.chunk.toroot.banner.filename" select="'graphics/homebanner.png'"/>
<xsl:param name="tabular.chunk.toroot.banner.altval" select="'to doc root node'"/>
<!-- ==================================================================== -->
<xsl:variable name="autolayout" select="document($autolayout-file,/)/autolayout"/>
<xsl:variable name="src-rootnode" select="/*"/>
<xsl:variable name="src-rootnode-id" select="$src-rootnode/@id"/>
<xsl:variable name="target-dir-path">
<xsl:message>
<xsl:text>source rootnode id is: </xsl:text>
<xsl:value-of select="$src-rootnode-id"/>
</xsl:message>
<xsl:message>
<xsl:text>autolayout file is: </xsl:text>
<xsl:value-of select="$autolayout-file"/>
</xsl:message>
<xsl:message>
<xsl:text>autolayout root node: </xsl:text>
<xsl:value-of select="$autolayout/descendant::toc/@id"/>
</xsl:message>
<xsl:choose>
<xsl:when test="$autolayout != '' and $website != ''" >
<xsl:variable name="temp">
<xsl:call-template name="root-rel-path">
<xsl:with-param name="page" select="$autolayout//*[@id = $src-rootnode-id]"/>
</xsl:call-template>
</xsl:variable>
<xsl:message>
<xsl:text>target-dir-path is: </xsl:text>
<xsl:value-of select="$temp"/>
</xsl:message>
<xsl:value-of select="$temp"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$base.dir"/>
<xsl:message>
<xsl:text>target-dir-path is: </xsl:text>
<xsl:value-of select="$base.dir"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--
</xsl:stylesheet>
-->
<!-- ====================================================================== -->
<!--
|
|file: html/website-tabular.xsl
|
-->
<!--
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html='http://www.w3.org/1999/xhtml'
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
exclude-result-prefixes="html doc"
version="1.0">
-->
<!-- ==================================================================== -->
<!-- Netscape gets badly confused if it sees a CSS style... -->
<xsl:param name="admon.style" select="''"/>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="admon.graphics.path">graphics/</xsl:param>
<xsl:param name="admon.graphics.extension">.gif</xsl:param>
<xsl:attribute-set name="table.properties">
<xsl:attribute name="border">0</xsl:attribute>
<xsl:attribute name="cellpadding">0</xsl:attribute>
<xsl:attribute name="cellspacing">0</xsl:attribute>
<xsl:attribute name="width">100%</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.navigation.cell.properties">
<xsl:attribute name="valign">top</xsl:attribute>
<xsl:attribute name="align">left</xsl:attribute>
<!-- width is set with $navotocwidth -->
<xsl:attribute name="bgcolor">
<xsl:choose>
<xsl:when test="/webpage/config[@param='navbgcolor']/@value[. != '']">
<xsl:value-of select="/webpage/config[@param='navbgcolor']/@value"/>
</xsl:when>
<xsl:when test="$autolayout/autolayout/config[@param='navbgcolor']/@value[. != '']">
<xsl:value-of select="$autolayout/autolayout/config[@param='navbgcolor']/@value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$navbgcolor"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:attribute-set>
<xsl:attribute-set name="table.body.cell.properties">
<xsl:attribute name="valign">top</xsl:attribute>
<xsl:attribute name="align">left</xsl:attribute>
<!-- width is set with $navobodywidth -->
<xsl:attribute name="bgcolor">
<xsl:value-of select="$textbgcolor"/>
</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="body.columns" select="2"/>
<!-- ==================================================================== -->
<xsl:template name="home.navhead">
<xsl:text>Navhead</xsl:text>
</xsl:template>
<xsl:template name="home.navhead.upperright">
<xsl:text>Upper-right</xsl:text>
</xsl:template>
<xsl:template name="home.navhead.cell">
<td width="50%" valign="middle" align="left">
<xsl:call-template name="home.navhead"/>
</td>
</xsl:template>
<xsl:template name="home.navhead.upperright.cell">
<td width="50%" valign="middle" align="right">
<xsl:call-template name="home.navhead.upperright"/>
</td>
</xsl:template>
<xsl:template name="home.navhead.separator">
<hr/>
</xsl:template>
<xsl:template name="hspacer">
<!-- nop -->
</xsl:template>
<xsl:template match="config[@param='filename']" mode="head.mode">
</xsl:template>
<xsl:template match="webtoc">
<!-- nop -->
</xsl:template>
<!--
</xsl:stylesheet>
-->
<!-- ====================================================================== -->
<!--
|
|file: html/website-tabular-toc.xsl
| build-navtoc - what an ugly hack. But it works!
|
-->
<!--
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
-->
<xsl:param name="nav.graphics" select="1"/>
<xsl:param name="nav.pointer" select="1"/>
<xsl:param name="nav.revisionflag" select="1"/>
<xsl:param name="toc.spacer.text">   </xsl:param>
<xsl:param name="toc.spacer.image">graphics/blank.gif</xsl:param>
<xsl:param name="nav.icon.path">graphics/navicons/</xsl:param>
<xsl:param name="nav.icon.extension">.gif</xsl:param>
<!-- styles: folder, folder16, plusminus, triangle, arrow -->
<xsl:param name="nav.icon.style">triangle</xsl:param>
<xsl:param name="nav.text.spacer"> </xsl:param>
<xsl:param name="nav.text.current.open">+</xsl:param>
<xsl:param name="nav.text.current.page">+</xsl:param>
<xsl:param name="nav.text.other.open"> </xsl:param>
<xsl:param name="nav.text.other.closed"> </xsl:param>
<xsl:param name="nav.text.other.page"> </xsl:param>
<xsl:param name="nav.text.revisionflag.added">New</xsl:param>
<xsl:param name="nav.text.revisionflag.changed">Changed</xsl:param>
<xsl:param name="nav.text.revisionflag.deleted"></xsl:param>
<xsl:param name="nav.text.revisionflag.off"></xsl:param>
<xsl:param name="nav.text.pointer"><-</xsl:param>
<xsl:param name="toc.expand.depth" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="toc/title|tocentry/title|titleabbrev">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="toc" />
<xsl:template match="tocentry"/>
<!-- ==================================================================== -->
<!-- The build-navtoc recurses, starting from the autolayout/toc node,
down the tocentry hierarchy before jumping to relevent, chunkable
first child nodes of the target document being chunked, before
progressing recursively down the chapters and sections to the
chunk with id $targetid (oh, and its first level children, if any).
-->
<xsl:template name="build-navtoc">
<xsl:param name="context" select="."/>
<xsl:param name="targetdepth" select="count(ancestor::*)"/>
<xsl:param name="docid" select="$src-rootnode-id"/>
<xsl:param name="toc" select="$src-rootnode"/>
<xsl:param name="node" select="."/>
<xsl:param name="toclevel" select="count(ancestor::*)"/>
<xsl:param name="relpath" select="''"/>
<xsl:variable name="revisionflag" select="@revisionflag"/>
<xsl:variable name="page" select="."/>
<xsl:variable name="pageid">
<xsl:choose>
<xsl:when test="not($autolayout)">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$node"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$node/@id"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="contextid">
<xsl:choose>
<xsl:when test="not($autolayout)">
<xsl:call-template name="object.id">
<xsl:with-param name="object" select="$context"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$context/@id"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- select this tocentry or first unskipped child -->
<!-- or next closest sibbling tocentry -->
<!-- or any passed in document $node that isn't a tocentry -->
<!--
select="($node/descendant-or-self::tocentry[@tocskip = '']
|$node/following::tocentry[@tocskip='']
|$node[not(name($node) ='tocentry')] )[1]"/>
-->
<xsl:variable name="target"
select="($node/descendant-or-self::tocentry[not(@tocskip) or @tocskip = '']
|$node/following::tocentry[not(@tocskip) or @tocskip = '']
|$node[not(name($node) ='tocentry')] )[1]"/>
<!--
<xsl:message>
<xsl:text>xxxx </xsl:text>
<xsl:text>node </xsl:text>
<xsl:value-of select="name($node)"/>
<xsl:text>target </xsl:text>
<xsl:value-of select="name($target)"/>
<xsl:text>value </xsl:text>
<xsl:copy-of select="$target"/>
</xsl:message>
-->
<xsl:variable name="isdescendant"> <!-- this node is a descendant of the target node? -->
<xsl:choose>
<xsl:when test="$node/ancestor::*[@id=$contextid]">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="hasdescendant"> <!-- this node has chunked or chunkable children? -->
<xsl:choose>
<xsl:when test="name($node) = 'toc' ">0</xsl:when> <!-- it does, but ignore it -->
<xsl:when test="name($node) = 'tocentry' and $node/descendant::tocentry != ''">1</xsl:when>
<xsl:when test="name($node) = 'tocentry' and $node/@multisect != ''">1</xsl:when>
<xsl:when test="name($node) = 'tocentry'"> <!-- its a tocentry leaf and a document root -->
<xsl:choose>
<xsl:when test="$pageid != $docid">0</xsl:when> <!-- HELP! not this doc, so no idea -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="name($src-rootnode)='webpage'">0</xsl:when>
<xsl:when test=" $src-rootnode/appendix
|$src-rootnode/article
|$src-rootnode/bibliography
|$src-rootnode/book
|$src-rootnode/chapter
|$src-rootnode/colophon
|$src-rootnode/glossary
|$src-rootnode/index
|$src-rootnode/part
|$src-rootnode/preface
|$src-rootnode/refentry
|$src-rootnode/reference
|$src-rootnode/sect1
|$src-rootnode/sect2
|$src-rootnode/sect3
|$src-rootnode/sect4
|$src-rootnode/sect5
|$src-rootnode/section
|$src-rootnode/set
|$src-rootnode/setindex">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise> <!-- $target is in currently being chunked doc -->
<xsl:choose>
<xsl:when test="$onechunk != 0">0</xsl:when>
<xsl:when test="$node/article/bibliography
|$node/article/glossary
|$node/article/index
|$node/book/bibliography
|$node/book/glossary
|$node/book/index">1</xsl:when>
<xsl:when test="$node/section
|$node/appendix
|$node/article
|$node/bibliography[$node[article] or $node[book]]
|$node/book
|$node/chapter
|$node/colophon
|$node/glossary[$node[article] or $node[book]]
|$node/index[$node[article] or $node[book]]
|$node/part
|$node/preface
|$node/refentry
|$node/reference
|$node/sect1[$chunk.section.depth > 0]
|$node/sect2[$chunk.section.depth > 1]
|$node/sect3[$chunk.section.depth > 2]
|$node/sect4[$chunk.section.depth > 3]
|$node/sect5[$chunk.section.depth > 4]
|$node/section[$chunk.section.depth > count($node/ancestor::section)]
|$node/set
|$node/setindex">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- this $target is an ancestor of the $context/@id webpage/chunk -->
<xsl:variable name="isancestor">
<xsl:choose>
<!-- for docid in sub-tocentry or sectionid in subsection -->
<xsl:when test="name($node)='tocentry' or name($node)='toc'">
<xsl:choose>
<xsl:when test="$node/descendant::*[@id=$contextid]">1</xsl:when>
<xsl:when test="$node/descendant-or-self::*[@id=$docid]">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- for sectionid in subsection of leaf tocentry doc -->
<xsl:when test="$context/ancestor::*[@id = $node/@id]">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="use.toc.expand.depth">
<xsl:variable name="config-param"
select="$autolayout/config[@param='toc.expand.depth']/@value"/>
<xsl:choose>
<!-- toc.expand.depth attribute is not in DTD -->
<xsl:when test="ancestor::toc/@toc.expand.depth">
<xsl:value-of select="ancestor::toc/@toc.expand.depth"/>
</xsl:when>
<xsl:when test="floor($config-param) > 0">
<xsl:value-of select="$config-param"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$toc.expand.depth"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="is.open">
<xsl:choose>
<xsl:when test="$contextid = $pageid
or $isancestor='1'
or $toclevel < $use.toc.expand.depth">1</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:message>
<xsl:text> Navtoc </xsl:text>
<xsl:value-of select="name(.)"/>
<xsl:text> (targetid=</xsl:text>
<xsl:value-of select="$contextid"/>
<xsl:text>,docid=</xsl:text>
<xsl:value-of select="$docid"/>
<!--
<xsl:text>,toclevel=</xsl:text>
<xsl:value-of select="$toclevel"/>
<xsl:text>,relpath=</xsl:text>
<xsl:value-of select="$relpath"/>
-->
<xsl:text>,pageid=</xsl:text>
<xsl:value-of select="$pageid"/>
<!--
<xsl:text>,targetdepth=</xsl:text>
<xsl:value-of select="$targetdepth"/>
-->
<xsl:text>) </xsl:text>
</xsl:message>
<!-- xsl:message>
<xsl:text> Vars:(is.open=</xsl:text>
<xsl:value-of select="$is.open"/>
<xsl:text>,isancestor=</xsl:text>
<xsl:value-of select="$isancestor"/>
<xsl:text>,isdescendant=</xsl:text>
<xsl:value-of select="$isdescendant"/>
<xsl:text>,hasdescendant=</xsl:text>
<xsl:value-of select="$hasdescendant"/>
<xsl:text>)</xsl:text>
</xsl:message -->
<!-- For any entry in the TOC:
1. It is the current page
a. it is a leaf current/leaf
b. it is an open page current/open
2. It is not the current page
a. it is a leaf other/leaf
b. it is an open page other/open
c. it is a closed page other/closed
-->
<xsl:variable name="preceding-icon">
<xsl:value-of select="$relpath"/>
<xsl:value-of select="$nav.icon.path"/>
<xsl:value-of select="$nav.icon.style"/>
<xsl:choose>
<xsl:when test="$pageid=$contextid">
<xsl:choose>
<xsl:when test="$hasdescendant != 0">
<xsl:text>/current/open</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/current/leaf</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$hasdescendant = 0">
<xsl:text>/other/leaf</xsl:text>
</xsl:when>
<xsl:when test="$is.open != 0">
<xsl:text>/other/open</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>/other/closed</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$nav.icon.extension"/>
</xsl:variable>
<xsl:variable name="preceding-text">
<xsl:choose>
<xsl:when test="$pageid=$contextid">
<xsl:choose>
<xsl:when test="$hasdescendant != 0">
<xsl:value-of select="$nav.text.current.open"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nav.text.current.page"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$is.open != 0"> <!-- xsl:when test="$isancestor != 0" -->
<xsl:value-of select="$nav.text.other.open"/>
</xsl:when>
<xsl:when test="$hasdescendant != 0">
<xsl:value-of select="$nav.text.other.closed"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nav.text.other.page"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="following-icon">
<xsl:value-of select="$relpath"/>
<xsl:value-of select="$nav.icon.path"/>
<xsl:value-of select="$nav.icon.style"/>
<xsl:text>/current/pointer</xsl:text>
<xsl:value-of select="$nav.icon.extension"/>
</xsl:variable>
<xsl:variable name="following-text">
<xsl:value-of select="$nav.text.pointer"/>
</xsl:variable>
<xsl:variable name="revisionflag-icon">
<xsl:value-of select="$relpath"/>
<xsl:value-of select="$nav.icon.path"/>
<xsl:value-of select="$nav.icon.style"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="$revisionflag"/>
<xsl:value-of select="$nav.icon.extension"/>
</xsl:variable>
<xsl:variable name="revisionflag-text">
<xsl:choose>
<xsl:when test="$revisionflag = 'changed'">
<xsl:value-of select="$nav.text.revisionflag.changed"/>
</xsl:when>
<xsl:when test="$revisionflag = 'added'">
<xsl:value-of select="$nav.text.revisionflag.added"/>
</xsl:when>
<xsl:when test="$revisionflag = 'deleted'">
<xsl:value-of select="$nav.text.revisionflag.deleted"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$nav.text.revisionflag.off"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<span>
<xsl:if test="$toclevel = 1">
<xsl:attribute name="class">
<xsl:text>toplevel</xsl:text>
</xsl:attribute>