Skip to content

Commit 5f1f30d

Browse files
committed
Reorganize XSLT stylesheet support. Put common things into a separate
file (instead of repeating), add XSL-FO stylesheet and appropriate make rules.
1 parent 0a265e4 commit 5f1f30d

File tree

5 files changed

+112
-157
lines changed

5 files changed

+112
-157
lines changed

doc/src/sgml/Makefile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# PostgreSQL documentation makefile
44
#
5-
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.82 2006/12/10 01:53:15 petere Exp $
5+
# $PostgreSQL: pgsql/doc/src/sgml/Makefile,v 1.83 2006/12/10 16:01:06 petere Exp $
66
#
77
#----------------------------------------------------------------------------
88

@@ -207,7 +207,7 @@ regress_README.html: regress.sgml
207207

208208

209209
##
210-
## Experimental XML stuff
210+
## XSLT processing
211211
##
212212

213213
OSX = osx # (may be called sx or sgml2xml on some systems)
@@ -219,11 +219,16 @@ postgres.xml: postgres.sgml $(GENERATED_SGML)
219219
-e '1a\' -e '<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">' \
220220
>$@
221221

222-
testxml: stylesheet.xsl postgres.xml
223-
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
222+
override XSLTPROCFLAGS += --stringparam pg.version '$(VERSION)'
223+
224+
xslthtml: stylesheet.xsl postgres.xml
225+
$(XSLTPROC) $(XSLTPROCFLAGS) $^
224226

225227
htmlhelp: stylesheet-hh.xsl postgres.xml
226-
$(XSLTPROC) $(XSLTPROCFLAGS) --stringparam pg.version '$(VERSION)' $^
228+
$(XSLTPROC) $(XSLTPROCFLAGS) $^
229+
230+
%.fo: stylesheet-fo.xsl %.xml
231+
$(XSLTPROC) $(XSLTPROCFLAGS) -o $@ $^
227232

228233

229234
##
@@ -271,7 +276,7 @@ clean distclean maintainer-clean:
271276
rm -f HTML.index $(GENERATED_SGML)
272277
# text
273278
rm -f INSTALL HISTORY regress_README
274-
# XML
275-
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk
279+
# XSLT
280+
rm -f postgres.xml htmlhelp.hhp toc.hhc index.hhk *.fo
276281
# Texinfo
277282
rm -f *.texixml *.texi *.info db2texi.refs

doc/src/sgml/stylesheet-common.xsl

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
version="1.0">
4+
5+
<!--
6+
This file contains XSLT stylesheet customizations that are common to
7+
all output formats (HTML, HTML Help, XSL-FO, etc.).
8+
-->
9+
10+
11+
<!-- Parameters -->
12+
13+
<xsl:param name="pg.fast" select="'0'"/>
14+
15+
<!--
16+
<xsl:param name="draft.mode">
17+
<xsl:choose>
18+
<xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
19+
<xsl:otherwise>no</xsl:otherwise>
20+
</xsl:choose>
21+
</xsl:param>
22+
-->
23+
24+
<xsl:param name="show.comments">
25+
<xsl:choose>
26+
<xsl:when test="contains($pg.version, 'devel')">1</xsl:when>
27+
<xsl:otherwise>0</xsl:otherwise>
28+
</xsl:choose>
29+
</xsl:param>
30+
31+
<xsl:param name="callout.graphics" select="'0'"></xsl:param>
32+
<xsl:param name="toc.section.depth">2</xsl:param>
33+
<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
34+
<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
35+
<xsl:param name="preface.autolabel" select="1 - $pg.fast"></xsl:param>
36+
<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
37+
<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
38+
<xsl:param name="refentry.xref.manvolnum" select="0"/>
39+
<xsl:param name="formal.procedures" select="0"></xsl:param>
40+
<xsl:param name="punct.honorific" select="''"></xsl:param>
41+
42+
43+
<!-- Change display of some elements -->
44+
45+
<xsl:template match="command">
46+
<xsl:call-template name="inline.monoseq"/>
47+
</xsl:template>
48+
49+
<xsl:template match="productname">
50+
<xsl:call-template name="inline.charseq"/>
51+
</xsl:template>
52+
53+
<xsl:template match="structfield">
54+
<xsl:call-template name="inline.monoseq"/>
55+
</xsl:template>
56+
57+
<xsl:template match="structname">
58+
<xsl:call-template name="inline.monoseq"/>
59+
</xsl:template>
60+
61+
<xsl:template match="symbol">
62+
<xsl:call-template name="inline.monoseq"/>
63+
</xsl:template>
64+
65+
<xsl:template match="systemitem">
66+
<xsl:call-template name="inline.charseq"/>
67+
</xsl:template>
68+
69+
<xsl:template match="token">
70+
<xsl:call-template name="inline.monoseq"/>
71+
</xsl:template>
72+
73+
<xsl:template match="type">
74+
<xsl:call-template name="inline.monoseq"/>
75+
</xsl:template>
76+
77+
<xsl:template match="programlisting/emphasis">
78+
<xsl:call-template name="inline.boldseq"/>
79+
</xsl:template>
80+
81+
82+
<!-- Special support for Tcl synopses -->
83+
84+
<xsl:template match="optional[@role='tcl']">
85+
?<xsl:call-template name="inline.charseq"/>?
86+
</xsl:template>
87+
88+
</xsl:stylesheet>

doc/src/sgml/stylesheet-fo.xsl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
version="1.0"
4+
xmlns:fo="http://www.w3.org/1999/XSL/Format">
5+
6+
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
7+
<xsl:include href="stylesheet-common.xsl" />
8+
9+
</xsl:stylesheet>

doc/src/sgml/stylesheet-hh.xsl

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,21 @@
55
exclude-result-prefixes="#default">
66

77
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl"/>
8+
<xsl:include href="stylesheet-common.xsl" />
89

910
<!-- Parameters -->
1011
<xsl:param name="htmlhelp.use.hhk" select="'1'"/>
11-
<xsl:param name="pg.fast" select="'0'"/>
1212

13-
<!--
14-
<xsl:param name="draft.mode">
15-
<xsl:choose>
16-
<xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
17-
<xsl:otherwise>no</xsl:otherwise>
18-
</xsl:choose>
19-
</xsl:param>
20-
-->
21-
22-
<xsl:param name="show.comments">
23-
<xsl:choose>
24-
<xsl:when test="contains($pg.version, 'devel')">1</xsl:when>
25-
<xsl:otherwise>0</xsl:otherwise>
26-
</xsl:choose>
27-
</xsl:param>
28-
29-
30-
<xsl:param name="callout.graphics" select="'0'"></xsl:param>
31-
<xsl:param name="toc.section.depth">2</xsl:param>
32-
<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
33-
<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
34-
<xsl:param name="preface.autolabel" select="1 - $pg.fast"></xsl:param>
35-
<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
36-
<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
3713
<xsl:param name="html.stylesheet" select="'stylesheet.css'"></xsl:param>
3814
<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
3915
<xsl:param name="make.valid.html" select="1"></xsl:param>
4016
<xsl:param name="generate.id.attributes" select="1"></xsl:param>
4117
<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
42-
<xsl:param name="refentry.xref.manvolnum" select="0"/>
4318
<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
44-
<xsl:param name="formal.procedures" select="0"></xsl:param>
45-
<xsl:param name="punct.honorific" select="''"></xsl:param>
4619
<xsl:param name="chunker.output.indent" select="'yes'"/>
4720
<xsl:param name="chunk.quietly" select="1"></xsl:param>
4821

4922

50-
<!-- Change display of some elements -->
51-
52-
<xsl:template match="command">
53-
<xsl:call-template name="inline.monoseq"/>
54-
</xsl:template>
55-
56-
<xsl:template match="productname">
57-
<xsl:call-template name="inline.charseq"/>
58-
</xsl:template>
59-
60-
<xsl:template match="structfield">
61-
<xsl:call-template name="inline.monoseq"/>
62-
</xsl:template>
63-
64-
<xsl:template match="structname">
65-
<xsl:call-template name="inline.monoseq"/>
66-
</xsl:template>
67-
68-
<xsl:template match="symbol">
69-
<xsl:call-template name="inline.monoseq"/>
70-
</xsl:template>
71-
72-
<xsl:template match="systemitem">
73-
<xsl:call-template name="inline.charseq"/>
74-
</xsl:template>
75-
76-
<xsl:template match="token">
77-
<xsl:call-template name="inline.monoseq"/>
78-
</xsl:template>
79-
80-
<xsl:template match="type">
81-
<xsl:call-template name="inline.monoseq"/>
82-
</xsl:template>
83-
84-
<xsl:template match="programlisting/emphasis">
85-
<xsl:call-template name="inline.boldseq"/>
86-
</xsl:template>
87-
88-
89-
<!-- Special support for Tcl synopses -->
90-
91-
<xsl:template match="optional[@role='tcl']">
92-
?<xsl:call-template name="inline.charseq"/>?
93-
</xsl:template>
94-
95-
9623
<!--
9724
Format multiple terms in varlistentry vertically, instead
9825
of comma-separated.

doc/src/sgml/stylesheet.xsl

Lines changed: 2 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -5,94 +5,20 @@
55
exclude-result-prefixes="#default">
66

77
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
8+
<xsl:include href="stylesheet-common.xsl" />
89

9-
<!-- Parameters -->
10-
11-
<xsl:param name="pg.fast" select="'0'"/>
12-
13-
<!--
14-
<xsl:param name="draft.mode">
15-
<xsl:choose>
16-
<xsl:when test="contains($pg.version, 'devel')">yes</xsl:when>
17-
<xsl:otherwise>no</xsl:otherwise>
18-
</xsl:choose>
19-
</xsl:param>
20-
-->
2110

22-
<xsl:param name="show.comments">
23-
<xsl:choose>
24-
<xsl:when test="contains($pg.version, 'devel')">1</xsl:when>
25-
<xsl:otherwise>0</xsl:otherwise>
26-
</xsl:choose>
27-
</xsl:param>
28-
29-
30-
<xsl:param name="callout.graphics" select="'0'"></xsl:param>
31-
<xsl:param name="toc.section.depth">2</xsl:param>
32-
<xsl:param name="linenumbering.extension" select="'0'"></xsl:param>
33-
<xsl:param name="generate.index" select="1 - $pg.fast"></xsl:param>
34-
<xsl:param name="preface.autolabel" select="1 - $pg.fast"></xsl:param>
35-
<xsl:param name="section.autolabel" select="1 - $pg.fast"></xsl:param>
36-
<xsl:param name="section.label.includes.component.label" select="1 - $pg.fast"></xsl:param>
11+
<!-- Parameters -->
3712
<xsl:param name="html.stylesheet" select="'stylesheet.css'"></xsl:param>
3813
<xsl:param name="use.id.as.filename" select="'1'"></xsl:param>
3914
<xsl:param name="make.valid.html" select="1"></xsl:param>
4015
<xsl:param name="generate.id.attributes" select="1"></xsl:param>
4116
<xsl:param name="generate.legalnotice.link" select="1"></xsl:param>
42-
<xsl:param name="refentry.xref.manvolnum" select="0"/>
4317
<xsl:param name="link.mailto.url">pgsql-docs@postgresql.org</xsl:param>
44-
<xsl:param name="formal.procedures" select="0"></xsl:param>
45-
<xsl:param name="punct.honorific" select="''"></xsl:param>
4618
<xsl:param name="chunker.output.indent" select="'yes'"/>
4719
<xsl:param name="chunk.quietly" select="1"></xsl:param>
4820

4921

50-
<!-- Change display of some elements -->
51-
52-
<xsl:template match="command">
53-
<xsl:call-template name="inline.monoseq"/>
54-
</xsl:template>
55-
56-
<xsl:template match="productname">
57-
<xsl:call-template name="inline.charseq"/>
58-
</xsl:template>
59-
60-
<xsl:template match="structfield">
61-
<xsl:call-template name="inline.monoseq"/>
62-
</xsl:template>
63-
64-
<xsl:template match="structname">
65-
<xsl:call-template name="inline.monoseq"/>
66-
</xsl:template>
67-
68-
<xsl:template match="symbol">
69-
<xsl:call-template name="inline.monoseq"/>
70-
</xsl:template>
71-
72-
<xsl:template match="systemitem">
73-
<xsl:call-template name="inline.charseq"/>
74-
</xsl:template>
75-
76-
<xsl:template match="token">
77-
<xsl:call-template name="inline.monoseq"/>
78-
</xsl:template>
79-
80-
<xsl:template match="type">
81-
<xsl:call-template name="inline.monoseq"/>
82-
</xsl:template>
83-
84-
<xsl:template match="programlisting/emphasis">
85-
<xsl:call-template name="inline.boldseq"/>
86-
</xsl:template>
87-
88-
89-
<!-- Special support for Tcl synopses -->
90-
91-
<xsl:template match="optional[@role='tcl']">
92-
?<xsl:call-template name="inline.charseq"/>?
93-
</xsl:template>
94-
95-
9622
<!--
9723
Format multiple terms in varlistentry vertically, instead
9824
of comma-separated.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy