2006-12-10 17:01:06 +01:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2024-01-22 10:41:33 +01:00
|
|
|
<!DOCTYPE xsl:stylesheet [
|
|
|
|
<!ENTITY % common.entities SYSTEM "http://docbook.sourceforge.net/release/xsl/current/common/entities.ent">
|
|
|
|
%common.entities;
|
|
|
|
]>
|
2006-12-10 17:01:06 +01:00
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
|
|
version="1.0"
|
|
|
|
xmlns:fo="http://www.w3.org/1999/XSL/Format">
|
|
|
|
|
|
|
|
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
|
|
|
|
<xsl:include href="stylesheet-common.xsl" />
|
|
|
|
|
2013-09-11 16:20:27 +02:00
|
|
|
<xsl:param name="fop1.extensions" select="1"></xsl:param>
|
|
|
|
<xsl:param name="tablecolumns.extension" select="0"></xsl:param>
|
|
|
|
<xsl:param name="toc.max.depth">3</xsl:param>
|
|
|
|
<xsl:param name="ulink.footnotes" select="1"></xsl:param>
|
|
|
|
<xsl:param name="use.extensions" select="1"></xsl:param>
|
|
|
|
<xsl:param name="variablelist.as.blocks" select="1"></xsl:param>
|
2020-05-10 22:20:28 +02:00
|
|
|
<xsl:param name="orderedlist.label.width">1.5em</xsl:param>
|
2013-09-11 16:20:27 +02:00
|
|
|
|
|
|
|
<xsl:attribute-set name="monospace.verbatim.properties"
|
|
|
|
use-attribute-sets="verbatim.properties monospace.properties">
|
|
|
|
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
|
|
|
|
</xsl:attribute-set>
|
|
|
|
|
2017-03-27 19:33:36 +02:00
|
|
|
<xsl:attribute-set name="nongraphical.admonition.properties">
|
|
|
|
<xsl:attribute name="border-style">solid</xsl:attribute>
|
|
|
|
<xsl:attribute name="border-width">1pt</xsl:attribute>
|
|
|
|
<xsl:attribute name="border-color">black</xsl:attribute>
|
|
|
|
<xsl:attribute name="padding-start">12pt</xsl:attribute>
|
|
|
|
<xsl:attribute name="padding-end">12pt</xsl:attribute>
|
|
|
|
<xsl:attribute name="padding-top">6pt</xsl:attribute>
|
|
|
|
<xsl:attribute name="padding-bottom">6pt</xsl:attribute>
|
|
|
|
</xsl:attribute-set>
|
|
|
|
|
|
|
|
<xsl:attribute-set name="admonition.title.properties">
|
|
|
|
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
|
|
</xsl:attribute-set>
|
|
|
|
|
2020-05-06 18:23:43 +02:00
|
|
|
<!-- Make all tables default to left alignment, for consistency with HTML -->
|
|
|
|
<xsl:attribute-set name="table.table.properties">
|
|
|
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
|
|
|
</xsl:attribute-set>
|
|
|
|
|
2017-04-06 18:27:45 +02:00
|
|
|
<!-- fix missing space after vertical simplelist
|
|
|
|
https://github.com/docbook/xslt10-stylesheets/issues/31 -->
|
|
|
|
<xsl:attribute-set name="normal.para.spacing">
|
|
|
|
<xsl:attribute name="space-after.optimum">1em</xsl:attribute>
|
|
|
|
<xsl:attribute name="space-after.minimum">0.8em</xsl:attribute>
|
|
|
|
<xsl:attribute name="space-after.maximum">1.2em</xsl:attribute>
|
|
|
|
</xsl:attribute-set>
|
|
|
|
|
2012-04-30 20:12:28 +02:00
|
|
|
<!-- Change display of some elements -->
|
|
|
|
|
|
|
|
<xsl:template match="command">
|
|
|
|
<xsl:call-template name="inline.monoseq"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
2017-03-26 20:54:56 +02:00
|
|
|
<xsl:template match="confgroup" mode="bibliography.mode">
|
|
|
|
<fo:inline>
|
|
|
|
<xsl:apply-templates select="conftitle/text()" mode="bibliography.mode"/>
|
|
|
|
<xsl:text>, </xsl:text>
|
|
|
|
<xsl:apply-templates select="confdates/text()" mode="bibliography.mode"/>
|
|
|
|
<xsl:value-of select="$biblioentry.item.separator"/>
|
|
|
|
</fo:inline>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="isbn" mode="bibliography.mode">
|
|
|
|
<fo:inline>
|
|
|
|
<xsl:text>ISBN </xsl:text>
|
|
|
|
<xsl:apply-templates mode="bibliography.mode"/>
|
|
|
|
<xsl:value-of select="$biblioentry.item.separator"/>
|
|
|
|
</fo:inline>
|
|
|
|
</xsl:template>
|
Doc: introduce new layout for tables of functions and operators.
We've long fought with the draconian space limitations of our
traditional table layout for describing SQL functions and operators.
This commit introduces a new approach, though so far I've only applied
it to a few of those tables. The new way makes use of DocBook's support
for different layouts in different rows of a table, and allows the
descriptions and examples for a function or operator to run to several
lines without as much ugliness and wasted space as before.
The core layout concept is now
Name Signature
Description
Example Example Result
so that a function or operator really has three table rows not one,
but we group them to look like one row by having the name column
have only one entry for all three rows. (Actually, there could be
four or more rows if you wanted to have more than one example, which
is another thing that was painful before but works easily now.)
This is handled by a "morerows" annotation on the name entry, which
isn't perfect (notably, the toolchain is not smart enough to avoid
breaking these row groups across PDF pages) but there seems no better
solution in DocBook. The name column is normally fairly narrow,
allowing plenty of space for the other column(s), and not wasting too
much space when one of the other components runs to multiple lines.
The varying row layout is managed by defining named "spans" and then
tagging entries with a "spanname" of "name", "sig", "desc", "example",
or "exresult". This provides a bit of semantic annotation to go with
the formatting improvement, which seems like a good thing. (It seems
that we have to re-define these spans afresh for each table, which is
annoying, but it's not any worse than the duplication involved in
the table headers. At least that gives us an opportunity to vary the
relative column widths per-table, which is handy since function tables
sometimes need much wider name columns than operator tables.)
Signature entries should be written in the style
<function>fname</function>(<type>typename</type> ...)
<returnvalue>typename</returnvalue>
The <returnvalue> tag produces a right arrow before the result type
name. (I'll document that convention in a user-visible place later.)
While this provides significantly more horizontal space than before
for examples, it's still true that PDF output is a lot narrower than
typical webpage viewing windows, so some examples need to be broken
in places where there is no whitespace. I've added &zwsp; markers in
suitable places to allow the tables to render warning-free in PDF.
I've so far converted only the date/time operator, date/time function,
and enum function tables in sections 9.9 and 9.10; these were chosen
to provide a reasonable sample of the formatting problems that need
to be solved. Assuming that this looks good on the website and doesn't
provoke howls of anguish, I'll work on the other similar tables in the
near future.
There's a moderate amount of new editorial content in this patch along
with the raw formatting changes; for instance I had to write text
descriptions for operators that lacked them. I failed to resist the
temptation to improve some other descriptions and examples, too.
Patch by me, with thanks to Alexander Lakhin for assistance with
figuring out some formatting issues.
Discussion: https://postgr.es/m/9326.1581457869@sss.pgh.pa.us
2020-04-13 00:03:20 +02:00
|
|
|
|
2023-03-20 14:01:09 +01:00
|
|
|
<!-- Make every sect1 in contrib get a page break -->
|
|
|
|
<xsl:template match="id('contrib')/sect1">
|
|
|
|
<fo:block break-after='page'/>
|
|
|
|
<xsl:apply-imports/>
|
|
|
|
</xsl:template>
|
|
|
|
|
2020-04-30 06:34:05 +02:00
|
|
|
<!-- formatting for entries in tables of functions -->
|
|
|
|
<xsl:template match="entry[@role='func_table_entry']/para">
|
|
|
|
<fo:block margin-left="4em" text-align="left">
|
|
|
|
<xsl:if test="self::para[@role='func_signature']">
|
2020-04-18 21:36:43 +02:00
|
|
|
<xsl:attribute name="text-indent">-3.5em</xsl:attribute>
|
2020-04-30 06:34:05 +02:00
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</fo:block>
|
Doc: revise formatting of function/operator tables.
The table layout ideas proposed in commit e894c6183 were not as widely
popular as I'd hoped. After discussion, we've settled on a layout
that's effectively a single-column table with cell contents much like a
<varlistentry> description of the function or operator; though we're not
actually using <varlistentry>, because it'd add way too much vertical
space. Instead the effect is accomplished using line-break processing
instructions to separate the description and example(s), plus CSS or FO
customizations to produce indentation of all but the first line in each
cell. While technically this is a bit grotty, it does have the
advantage that we won't need to write nearly as much boilerplate markup.
This patch updates tables 9.30, 9.31, and 9.33 (which were touched by
the previous patch) to the revised style, and additionally converts
table 9.10. A lot of work still remains to do, but hopefully it won't
be too controversial.
Thanks to Andrew Dunstan, Pierre Giraud, Robert Haas, Alvaro Herrera,
David Johnston, Jonathan Katz, Isaac Morland for valuable ideas.
Discussion: https://postgr.es/m/8691.1586798003@sss.pgh.pa.us
2020-04-18 02:50:26 +02:00
|
|
|
</xsl:template>
|
|
|
|
|
2020-05-14 05:03:39 +02:00
|
|
|
<!-- formatting for entries in tables of catalog/view columns -->
|
|
|
|
<xsl:template match="entry[@role='catalog_table_entry']/para">
|
|
|
|
<fo:block margin-left="4em" text-align="left">
|
|
|
|
<xsl:if test="self::para[@role='column_definition']">
|
|
|
|
<xsl:attribute name="text-indent">-3.5em</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:apply-templates/>
|
|
|
|
</fo:block>
|
|
|
|
</xsl:template>
|
|
|
|
|
Doc: introduce new layout for tables of functions and operators.
We've long fought with the draconian space limitations of our
traditional table layout for describing SQL functions and operators.
This commit introduces a new approach, though so far I've only applied
it to a few of those tables. The new way makes use of DocBook's support
for different layouts in different rows of a table, and allows the
descriptions and examples for a function or operator to run to several
lines without as much ugliness and wasted space as before.
The core layout concept is now
Name Signature
Description
Example Example Result
so that a function or operator really has three table rows not one,
but we group them to look like one row by having the name column
have only one entry for all three rows. (Actually, there could be
four or more rows if you wanted to have more than one example, which
is another thing that was painful before but works easily now.)
This is handled by a "morerows" annotation on the name entry, which
isn't perfect (notably, the toolchain is not smart enough to avoid
breaking these row groups across PDF pages) but there seems no better
solution in DocBook. The name column is normally fairly narrow,
allowing plenty of space for the other column(s), and not wasting too
much space when one of the other components runs to multiple lines.
The varying row layout is managed by defining named "spans" and then
tagging entries with a "spanname" of "name", "sig", "desc", "example",
or "exresult". This provides a bit of semantic annotation to go with
the formatting improvement, which seems like a good thing. (It seems
that we have to re-define these spans afresh for each table, which is
annoying, but it's not any worse than the duplication involved in
the table headers. At least that gives us an opportunity to vary the
relative column widths per-table, which is handy since function tables
sometimes need much wider name columns than operator tables.)
Signature entries should be written in the style
<function>fname</function>(<type>typename</type> ...)
<returnvalue>typename</returnvalue>
The <returnvalue> tag produces a right arrow before the result type
name. (I'll document that convention in a user-visible place later.)
While this provides significantly more horizontal space than before
for examples, it's still true that PDF output is a lot narrower than
typical webpage viewing windows, so some examples need to be broken
in places where there is no whitespace. I've added &zwsp; markers in
suitable places to allow the tables to render warning-free in PDF.
I've so far converted only the date/time operator, date/time function,
and enum function tables in sections 9.9 and 9.10; these were chosen
to provide a reasonable sample of the formatting problems that need
to be solved. Assuming that this looks good on the website and doesn't
provoke howls of anguish, I'll work on the other similar tables in the
near future.
There's a moderate amount of new editorial content in this patch along
with the raw formatting changes; for instance I had to write text
descriptions for operators that lacked them. I failed to resist the
temptation to improve some other descriptions and examples, too.
Patch by me, with thanks to Alexander Lakhin for assistance with
figuring out some formatting issues.
Discussion: https://postgr.es/m/9326.1581457869@sss.pgh.pa.us
2020-04-13 00:03:20 +02:00
|
|
|
<!-- overrides stylesheet-common.xsl -->
|
|
|
|
<!-- FOP needs us to be explicit about the font to use for right arrow -->
|
|
|
|
<xsl:template match="returnvalue">
|
|
|
|
<fo:inline font-family="{$symbol.font.family}">→ </fo:inline>
|
|
|
|
<xsl:call-template name="inline.monoseq"/>
|
|
|
|
</xsl:template>
|
Doc: revise formatting of function/operator tables.
The table layout ideas proposed in commit e894c6183 were not as widely
popular as I'd hoped. After discussion, we've settled on a layout
that's effectively a single-column table with cell contents much like a
<varlistentry> description of the function or operator; though we're not
actually using <varlistentry>, because it'd add way too much vertical
space. Instead the effect is accomplished using line-break processing
instructions to separate the description and example(s), plus CSS or FO
customizations to produce indentation of all but the first line in each
cell. While technically this is a bit grotty, it does have the
advantage that we won't need to write nearly as much boilerplate markup.
This patch updates tables 9.30, 9.31, and 9.33 (which were touched by
the previous patch) to the revised style, and additionally converts
table 9.10. A lot of work still remains to do, but hopefully it won't
be too controversial.
Thanks to Andrew Dunstan, Pierre Giraud, Robert Haas, Alvaro Herrera,
David Johnston, Jonathan Katz, Isaac Morland for valuable ideas.
Discussion: https://postgr.es/m/8691.1586798003@sss.pgh.pa.us
2020-04-18 02:50:26 +02:00
|
|
|
|
2020-04-27 17:00:28 +02:00
|
|
|
<!-- FOP needs us to be explicit about use of symbol font in some cases -->
|
|
|
|
<xsl:template match="phrase[@role='symbol_font']">
|
|
|
|
<fo:inline font-family="{$symbol.font.family}"><xsl:value-of select="."/></fo:inline>
|
|
|
|
</xsl:template>
|
2017-03-26 20:54:56 +02:00
|
|
|
|
2015-06-04 02:19:47 +02:00
|
|
|
<!-- bug fix from <https://sourceforge.net/p/docbook/bugs/1360/#831b> -->
|
|
|
|
|
|
|
|
<xsl:template match="varlistentry/term" mode="xref-to">
|
|
|
|
<xsl:param name="verbose" select="1"/>
|
|
|
|
<xsl:apply-templates mode="no.anchor.mode"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
2017-08-15 20:37:44 +02:00
|
|
|
<!-- include refsects in PDF bookmarks
|
|
|
|
(https://github.com/docbook/xslt10-stylesheets/issues/46) -->
|
|
|
|
|
|
|
|
<xsl:template match="refsect1|refsect2|refsect3"
|
|
|
|
mode="bookmark">
|
|
|
|
|
|
|
|
<xsl:variable name="id">
|
|
|
|
<xsl:call-template name="object.id"/>
|
|
|
|
</xsl:variable>
|
|
|
|
<xsl:variable name="bookmark-label">
|
|
|
|
<xsl:apply-templates select="." mode="object.title.markup"/>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<fo:bookmark internal-destination="{$id}">
|
|
|
|
<xsl:attribute name="starting-state">
|
|
|
|
<xsl:value-of select="$bookmarks.state"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<fo:bookmark-title>
|
|
|
|
<xsl:value-of select="normalize-space($bookmark-label)"/>
|
|
|
|
</fo:bookmark-title>
|
|
|
|
<xsl:apply-templates select="*" mode="bookmark"/>
|
|
|
|
</fo:bookmark>
|
|
|
|
</xsl:template>
|
|
|
|
|
2024-01-22 10:41:33 +01:00
|
|
|
<!-- make generated ids reproducible
|
|
|
|
(https://github.com/docbook/xslt10-stylesheets/issues/54) -->
|
|
|
|
|
|
|
|
<!-- from fo/autoidx.xsl -->
|
|
|
|
|
Fix documentation build with older docbook-xsl
Commit b0f0a9432d0 backpatched some code from upstream DocBook XSL to
our customization layer. It turned out that this failed to work with
anything but the latest DocBook XSL upstream version (1.79.*), because
the backpatched code references an XSLT parameter (autolink.index.see)
that is not defined in earlier versions (because the feature it is
used for did not exist yet).
There is no way in XSLT to test whether a parameter is declared before
the stylesheet processor tries and fails to access it. So the
possibilities to fix this would be to either remove the code that uses
the parameter (and thus give up on the feature it is used for) or
declare the parameter in our customization layer. The latter seems
easier, and with a few more lines of code we can backport the entire
autolink.index.see feature, so let's do that. (If we didn't, then
with older stylesheets the parameter will appear as on, but it won't
actually do anything, because of the way the stylesheets are laid out,
so it's less confusing to just make it work.)
With this, the documentation build should work again with docbook-xsl
versions 1.77.*, 1.78.*, and 1.79.* (which already worked before).
Version 1.76.1 already didn't work before all this, so was not
considered here.
Reported-by: Peter Smith <smithpb2250@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/9077b779-a9f8-09c8-6e85-da1ebfba15af@eisentraut.org
2024-02-08 11:37:11 +01:00
|
|
|
<xsl:key name="primaryonly"
|
|
|
|
match="indexterm"
|
|
|
|
use="normalize-space(primary)"/>
|
|
|
|
|
2024-01-22 10:41:33 +01:00
|
|
|
<xsl:template match="indexterm" mode="index-primary">
|
|
|
|
<xsl:param name="scope" select="."/>
|
|
|
|
<xsl:param name="role" select="''"/>
|
|
|
|
<xsl:param name="type" select="''"/>
|
|
|
|
|
|
|
|
<xsl:variable name="key" select="&primary;"/>
|
|
|
|
<xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
|
|
|
|
|
|
|
|
<xsl:variable name="term.separator">
|
|
|
|
<xsl:call-template name="index.separator">
|
|
|
|
<xsl:with-param name="key" select="'index.term.separator'"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:variable name="range.separator">
|
|
|
|
<xsl:call-template name="index.separator">
|
|
|
|
<xsl:with-param name="key" select="'index.range.separator'"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:variable name="number.separator">
|
|
|
|
<xsl:call-template name="index.separator">
|
|
|
|
<xsl:with-param name="key" select="'index.number.separator'"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<fo:block xmlns:rx="http://www.renderx.com/XSL/Extensions" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
|
|
|
|
<xsl:if test="$autolink.index.see != 0">
|
|
|
|
<xsl:attribute name="id">
|
|
|
|
<!-- pgsql-docs: begin -->
|
|
|
|
<xsl:text>ientry-</xsl:text>
|
|
|
|
<xsl:call-template name="object.id"/>
|
|
|
|
<!-- pgsql-docs: end -->
|
|
|
|
</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="$axf.extensions != 0">
|
|
|
|
<xsl:attribute name="axf:suppress-duplicate-page-number">true</xsl:attribute>
|
|
|
|
</xsl:if>
|
|
|
|
|
|
|
|
<xsl:for-each select="$refs/primary">
|
|
|
|
<xsl:if test="@id or @xml:id">
|
|
|
|
<fo:inline id="{(@id|@xml:id)[1]}"/>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:for-each>
|
|
|
|
|
|
|
|
<xsl:value-of select="primary"/>
|
|
|
|
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="$xep.extensions != 0">
|
|
|
|
<xsl:if test="$refs[not(see) and not(secondary)]">
|
|
|
|
<xsl:copy-of select="$term.separator"/>
|
|
|
|
<xsl:variable name="primary" select="&primary;"/>
|
|
|
|
<xsl:variable name="primary.significant" select="concat(&primary;, $significant.flag)"/>
|
|
|
|
<rx:page-index list-separator="{$number.separator}"
|
|
|
|
range-separator="{$range.separator}">
|
|
|
|
<xsl:if test="$refs[@significance='preferred'][not(see) and not(secondary)]">
|
|
|
|
<rx:index-item xsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties"
|
|
|
|
ref-key="{$primary.significant}"/>
|
|
|
|
</xsl:if>
|
|
|
|
<xsl:if test="$refs[not(@significance) or @significance!='preferred'][not(see) and not(secondary)]">
|
|
|
|
<rx:index-item xsl:use-attribute-sets="xep.index.item.properties"
|
|
|
|
ref-key="{$primary}"/>
|
|
|
|
</xsl:if>
|
|
|
|
</rx:page-index>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:variable name="page-number-citations">
|
|
|
|
<xsl:for-each select="$refs[not(see)
|
|
|
|
and not(secondary)]">
|
|
|
|
<xsl:apply-templates select="." mode="reference">
|
|
|
|
<xsl:with-param name="scope" select="$scope"/>
|
|
|
|
<xsl:with-param name="role" select="$role"/>
|
|
|
|
<xsl:with-param name="type" select="$type"/>
|
|
|
|
<xsl:with-param name="position" select="position()"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:for-each>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:copy-of select="$page-number-citations"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
|
|
|
|
<xsl:if test="$refs[not(secondary)]/*[self::see]">
|
|
|
|
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see', concat(&primary;, &sep;, &sep;, &sep;, see))[&scope;][1])]"
|
|
|
|
mode="index-see">
|
|
|
|
<xsl:with-param name="scope" select="$scope"/>
|
|
|
|
<xsl:with-param name="role" select="$role"/>
|
|
|
|
<xsl:with-param name="type" select="$type"/>
|
|
|
|
<xsl:sort select="translate(see, &lowercase;, &uppercase;)"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</xsl:if>
|
|
|
|
|
|
|
|
</fo:block>
|
|
|
|
|
|
|
|
<xsl:if test="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
|
|
|
|
<fo:block start-indent="1pc">
|
|
|
|
<xsl:apply-templates select="$refs[generate-id() = generate-id(key('see-also', concat(&primary;, &sep;, &sep;, &sep;, seealso))[&scope;][1])]"
|
|
|
|
mode="index-seealso">
|
|
|
|
<xsl:with-param name="scope" select="$scope"/>
|
|
|
|
<xsl:with-param name="role" select="$role"/>
|
|
|
|
<xsl:with-param name="type" select="$type"/>
|
|
|
|
<xsl:sort select="translate(seealso, &lowercase;, &uppercase;)"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
<xsl:apply-templates select="$refs[secondary and count(.|key('secondary', concat($key, &sep;, &secondary;))[&scope;][1]) = 1]"
|
|
|
|
mode="index-secondary">
|
|
|
|
<xsl:with-param name="scope" select="$scope"/>
|
|
|
|
<xsl:with-param name="role" select="$role"/>
|
|
|
|
<xsl:with-param name="type" select="$type"/>
|
|
|
|
<xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</fo:block>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="indexterm" mode="index-see">
|
|
|
|
<xsl:param name="scope" select="."/>
|
|
|
|
<xsl:param name="role" select="''"/>
|
|
|
|
<xsl:param name="type" select="''"/>
|
|
|
|
|
|
|
|
<xsl:variable name="see" select="normalize-space(see)"/>
|
|
|
|
|
|
|
|
<!-- can only link to primary, which should appear before comma
|
|
|
|
in see "primary, secondary" entry -->
|
|
|
|
<xsl:variable name="seeprimary">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($see, ',')">
|
|
|
|
<xsl:value-of select="substring-before($see, ',')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$see"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:variable name="seetarget" select="key('primaryonly', $seeprimary)[1]"/>
|
|
|
|
|
|
|
|
<xsl:variable name="linkend">
|
|
|
|
<xsl:if test="$seetarget">
|
|
|
|
<!-- pgsql-docs: begin -->
|
|
|
|
<xsl:text>ientry-</xsl:text>
|
|
|
|
<xsl:call-template name="object.id">
|
|
|
|
<xsl:with-param name="object" select="$seetarget"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<!-- pgsql-docs: end -->
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<fo:inline xmlns:xlink='http://www.w3.org/1999/xlink'>
|
|
|
|
<xsl:text> (</xsl:text>
|
|
|
|
<xsl:call-template name="gentext">
|
|
|
|
<xsl:with-param name="key" select="'see'"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- manual links have precedence -->
|
|
|
|
<xsl:when test="see/@linkend or see/@xlink:href">
|
|
|
|
<xsl:call-template name="simple.xlink">
|
|
|
|
<xsl:with-param name="node" select="see"/>
|
|
|
|
<xsl:with-param name="content" select="$see"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$autolink.index.see = 0">
|
|
|
|
<xsl:value-of select="$see"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$seetarget">
|
|
|
|
<fo:basic-link internal-destination="{$linkend}"
|
|
|
|
xsl:use-attribute-sets="xref.properties">
|
|
|
|
<xsl:value-of select="$see"/>
|
|
|
|
</fo:basic-link>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$see"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>)</xsl:text>
|
|
|
|
</fo:inline>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="indexterm" mode="index-seealso">
|
|
|
|
<xsl:param name="scope" select="."/>
|
|
|
|
<xsl:param name="role" select="''"/>
|
|
|
|
<xsl:param name="type" select="''"/>
|
|
|
|
|
|
|
|
<xsl:for-each select="seealso">
|
|
|
|
<xsl:sort select="translate(., &lowercase;, &uppercase;)"/>
|
|
|
|
|
|
|
|
<xsl:variable name="seealso" select="normalize-space(.)"/>
|
|
|
|
|
|
|
|
<!-- can only link to primary, which should appear before comma
|
|
|
|
in seealso "primary, secondary" entry -->
|
|
|
|
<xsl:variable name="seealsoprimary">
|
|
|
|
<xsl:choose>
|
|
|
|
<xsl:when test="contains($seealso, ',')">
|
|
|
|
<xsl:value-of select="substring-before($seealso, ',')"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$seealso"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<xsl:variable name="seealsotarget" select="key('primaryonly', $seealsoprimary)[1]"/>
|
|
|
|
|
|
|
|
<xsl:variable name="linkend">
|
|
|
|
<xsl:if test="$seealsotarget">
|
|
|
|
<!-- pgsql-docs: begin -->
|
|
|
|
<xsl:text>ientry-</xsl:text>
|
|
|
|
<xsl:call-template name="object.id">
|
|
|
|
<xsl:with-param name="object" select="$seealsotarget"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<!-- pgsql-docs: end -->
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:variable>
|
|
|
|
|
|
|
|
<fo:block xmlns:xlink='http://www.w3.org/1999/xlink'>
|
|
|
|
<xsl:text>(</xsl:text>
|
|
|
|
<xsl:call-template name="gentext">
|
|
|
|
<xsl:with-param name="key" select="'seealso'"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
<xsl:text> </xsl:text>
|
|
|
|
<xsl:choose>
|
|
|
|
<!-- manual links have precedence -->
|
|
|
|
<xsl:when test="@linkend or see/@xlink:href">
|
|
|
|
<xsl:call-template name="simple.xlink">
|
|
|
|
<xsl:with-param name="node" select="."/>
|
|
|
|
<xsl:with-param name="content" select="$seealso"/>
|
|
|
|
</xsl:call-template>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$autolink.index.see = 0">
|
|
|
|
<xsl:value-of select="$seealso"/>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:when test="$seealsotarget">
|
|
|
|
<fo:basic-link internal-destination="{$linkend}"
|
|
|
|
xsl:use-attribute-sets="xref.properties">
|
|
|
|
<xsl:value-of select="$seealso"/>
|
|
|
|
</fo:basic-link>
|
|
|
|
</xsl:when>
|
|
|
|
<xsl:otherwise>
|
|
|
|
<xsl:value-of select="$seealso"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
<xsl:text>)</xsl:text>
|
|
|
|
</fo:block>
|
|
|
|
|
|
|
|
</xsl:for-each>
|
|
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
2006-12-10 17:01:06 +01:00
|
|
|
</xsl:stylesheet>
|