Commit 285563a5 authored by Phillip Webb's avatar Phillip Webb

Use embedded docbook XSLT files

Switch from external docbook XSLT to those shipped as part of the
Maven plugin.

Fixes gh-1942
parent 608b1e65
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net" xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl" xmlns:d="http://docbook.org/ns/docbook"
exclude-result-prefixes="xslthl d"
version='1.0'> version='1.0'>
<!-- Extensions --> <!-- Extensions -->
...@@ -39,6 +40,6 @@ ...@@ -39,6 +40,6 @@
<xsl:param name="toc.section.depth">3</xsl:param> <xsl:param name="toc.section.depth">3</xsl:param>
<!-- Hide revhistory --> <!-- Hide revhistory -->
<xsl:template match="revhistory" mode="titlepage.mode"/> <xsl:template match="d:revhistory" mode="titlepage.mode"/>
</xsl:stylesheet> </xsl:stylesheet>
...@@ -21,7 +21,8 @@ under the License. ...@@ -21,7 +21,8 @@ under the License.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net" xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl" xmlns:d="http://docbook.org/ns/docbook"
exclude-result-prefixes="xslthl d"
version='1.0'> version='1.0'>
<xsl:import href="urn:docbkx:stylesheet"/> <xsl:import href="urn:docbkx:stylesheet"/>
......
...@@ -22,7 +22,7 @@ under the License. ...@@ -22,7 +22,7 @@ under the License.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'> version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/> <xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="html.xsl"/> <xsl:import href="html.xsl"/>
<xsl:param name="html.stylesheet">css/manual-multipage.css</xsl:param> <xsl:param name="html.stylesheet">css/manual-multipage.css</xsl:param>
......
...@@ -22,7 +22,7 @@ under the License. ...@@ -22,7 +22,7 @@ under the License.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'> version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/> <xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="html.xsl"/> <xsl:import href="html.xsl"/>
<xsl:param name="html.stylesheet">css/manual-singlepage.css</xsl:param> <xsl:param name="html.stylesheet">css/manual-singlepage.css</xsl:param>
......
...@@ -21,10 +21,11 @@ under the License. ...@@ -21,10 +21,11 @@ under the License.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xslthl="http://xslthl.sf.net" xmlns:xslthl="http://xslthl.sf.net"
xmlns:d="http://docbook.org/ns/docbook"
exclude-result-prefixes="xslthl" exclude-result-prefixes="xslthl"
version='1.0'> version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/highlight.xsl"/> <xsl:import href="urn:docbkx:stylesheet/highlight.xsl"/>
<xsl:import href="common.xsl"/> <xsl:import href="common.xsl"/>
<!-- Only use scaling in FO --> <!-- Only use scaling in FO -->
...@@ -99,7 +100,7 @@ under the License. ...@@ -99,7 +100,7 @@ under the License.
</xsl:template> </xsl:template>
<!-- Custom Title Page --> <!-- Custom Title Page -->
<xsl:template match="author" mode="titlepage.mode"> <xsl:template match="d:author" mode="titlepage.mode">
<xsl:if test="name(preceding-sibling::*[1]) = 'author'"> <xsl:if test="name(preceding-sibling::*[1]) = 'author'">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
</xsl:if> </xsl:if>
...@@ -108,7 +109,7 @@ under the License. ...@@ -108,7 +109,7 @@ under the License.
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/> <xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
</span> </span>
</xsl:template> </xsl:template>
<xsl:template match="authorgroup" mode="titlepage.mode"> <xsl:template match="d:authorgroup" mode="titlepage.mode">
<div class="{name(.)}"> <div class="{name(.)}">
<h2>Authors</h2> <h2>Authors</h2>
<xsl:apply-templates mode="titlepage.mode"/> <xsl:apply-templates mode="titlepage.mode"/>
......
...@@ -23,11 +23,13 @@ under the License. ...@@ -23,11 +23,13 @@ under the License.
xmlns:d="http://docbook.org/ns/docbook" xmlns:d="http://docbook.org/ns/docbook"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xslthl="http://xslthl.sf.net" xmlns:xslthl="http://xslthl.sf.net"
exclude-result-prefixes="xslthl d" xmlns:xlink='http://www.w3.org/1999/xlink'
xmlns:exsl="http://exslt.org/common"
exclude-result-prefixes="exsl xslthl d xlink"
version='1.0'> version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> <xsl:import href="urn:docbkx:stylesheet"/>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/highlight.xsl"/> <xsl:import href="urn:docbkx:stylesheet/highlight.xsl"/>
<xsl:import href="common.xsl"/> <xsl:import href="common.xsl"/>
<!-- Extensions --> <!-- Extensions -->
...@@ -48,6 +50,14 @@ under the License. ...@@ -48,6 +50,14 @@ under the License.
<xsl:attribute name="keep-together.within-column">auto</xsl:attribute> <xsl:attribute name="keep-together.within-column">auto</xsl:attribute>
</xsl:attribute-set> </xsl:attribute-set>
<!-- use color links and sensible rendering -->
<xsl:attribute-set name="xref.properties">
<xsl:attribute name="text-decoration">underline</xsl:attribute>
<xsl:attribute name="color">#204060</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="ulink.show" select="0"></xsl:param>
<xsl:param name="ulink.footnotes" select="0"></xsl:param>
<!-- TITLE PAGE --> <!-- TITLE PAGE -->
<xsl:template name="book.titlepage.recto"> <xsl:template name="book.titlepage.recto">
...@@ -65,27 +75,27 @@ under the License. ...@@ -65,27 +75,27 @@ under the License.
/> />
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="20pt" font-weight="bold" padding="10mm"> <fo:block font-family="Helvetica" font-size="20pt" font-weight="bold" padding="10mm">
<xsl:value-of select="bookinfo/title"/> <xsl:value-of select="d:info/d:title"/>
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="14pt" padding-before="2mm"> <fo:block font-family="Helvetica" font-size="14pt" padding-before="2mm">
<xsl:value-of select="bookinfo/subtitle"/> <xsl:value-of select="d:info/d:subtitle"/>
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="14pt" padding="2mm"> <fo:block font-family="Helvetica" font-size="14pt" padding="2mm">
<xsl:value-of select="bookinfo/releaseinfo"/> <xsl:value-of select="d:info/d:releaseinfo"/>
</fo:block> </fo:block>
</fo:table-cell> </fo:table-cell>
</fo:table-row> </fo:table-row>
<fo:table-row> <fo:table-row>
<fo:table-cell text-align="center"> <fo:table-cell text-align="center">
<fo:block font-family="Helvetica" font-size="14pt" padding="5mm"> <fo:block font-family="Helvetica" font-size="14pt" padding="5mm">
<xsl:value-of select="bookinfo/pubdate"/> <xsl:value-of select="d:info/d:pubdate"/>
</fo:block> </fo:block>
</fo:table-cell> </fo:table-cell>
</fo:table-row> </fo:table-row>
<fo:table-row> <fo:table-row>
<fo:table-cell text-align="center"> <fo:table-cell text-align="center">
<fo:block font-family="Helvetica" font-size="10pt" padding="10mm"> <fo:block font-family="Helvetica" font-size="10pt" padding="10mm">
<xsl:for-each select="bookinfo/authorgroup/author"> <xsl:for-each select="d:info/d:authorgroup/d:author">
<xsl:if test="position() > 1"> <xsl:if test="position() > 1">
<xsl:text>, </xsl:text> <xsl:text>, </xsl:text>
</xsl:if> </xsl:if>
...@@ -94,15 +104,15 @@ under the License. ...@@ -94,15 +104,15 @@ under the License.
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="10pt" padding="5mm"> <fo:block font-family="Helvetica" font-size="10pt" padding="5mm">
<xsl:value-of select="bookinfo/pubdate"/> <xsl:value-of select="d:info/d:pubdate"/>
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="10pt" padding="5mm" padding-before="25em"> <fo:block font-family="Helvetica" font-size="10pt" padding="5mm" padding-before="25em">
<xsl:text>Copyright &#xA9; </xsl:text><xsl:value-of select="bookinfo/copyright"/> <xsl:text>Copyright &#xA9; </xsl:text><xsl:value-of select="d:info/d:copyright"/>
</fo:block> </fo:block>
<fo:block font-family="Helvetica" font-size="8pt" padding="1mm"> <fo:block font-family="Helvetica" font-size="8pt" padding="1mm">
<xsl:value-of select="bookinfo/legalnotice"/> <xsl:value-of select="d:info/d:legalnotice"/>
</fo:block> </fo:block>
</fo:table-cell> </fo:table-cell>
</fo:table-row> </fo:table-row>
...@@ -139,8 +149,8 @@ under the License. ...@@ -139,8 +149,8 @@ under the License.
<xsl:variable name="Version"> <xsl:variable name="Version">
<xsl:choose> <xsl:choose>
<xsl:when test="//title"> <xsl:when test="//d:title">
<xsl:value-of select="//title"/><xsl:text> </xsl:text> <xsl:value-of select="//d:title"/><xsl:text> </xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>please define title in your docbook file!</xsl:text> <xsl:text>please define title in your docbook file!</xsl:text>
...@@ -188,8 +198,8 @@ under the License. ...@@ -188,8 +198,8 @@ under the License.
<xsl:variable name="Version"> <xsl:variable name="Version">
<xsl:choose> <xsl:choose>
<xsl:when test="//releaseinfo"> <xsl:when test="//d:releaseinfo">
<xsl:value-of select="//releaseinfo"/> <xsl:value-of select="//d:releaseinfo"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
</xsl:otherwise> </xsl:otherwise>
...@@ -198,8 +208,8 @@ under the License. ...@@ -198,8 +208,8 @@ under the License.
<xsl:variable name="Title"> <xsl:variable name="Title">
<xsl:choose> <xsl:choose>
<xsl:when test="//productname"> <xsl:when test="//d:productname">
<xsl:value-of select="//productname"/><xsl:text> </xsl:text> <xsl:value-of select="//d:productname"/><xsl:text> </xsl:text>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:text>please define title in your docbook file!</xsl:text> <xsl:text>please define title in your docbook file!</xsl:text>
...@@ -296,7 +306,7 @@ under the License. ...@@ -296,7 +306,7 @@ under the License.
<!-- Why is the font-size for chapters hardcoded in the XSL FO templates? <!-- Why is the font-size for chapters hardcoded in the XSL FO templates?
Let's remove it, so this sucker can use our attribute-set only... --> Let's remove it, so this sucker can use our attribute-set only... -->
<xsl:template match="title" mode="chapter.titlepage.recto.auto.mode"> <xsl:template match="d:title" mode="chapter.titlepage.recto.auto.mode">
<fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format"
xsl:use-attribute-sets="chapter.titlepage.recto.style"> xsl:use-attribute-sets="chapter.titlepage.recto.style">
<xsl:call-template name="component.title"> <xsl:call-template name="component.title">
...@@ -496,42 +506,6 @@ under the License. ...@@ -496,42 +506,6 @@ under the License.
</l:l10n> </l:l10n>
</l:i18n> </l:i18n>
<xsl:param name="ulink.footnotes">true</xsl:param>
<!-- COLORED AND HYPHENATED LINKS -->
<xsl:template match="ulink">
<fo:basic-link external-destination="{@url}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
<xsl:template match="link">
<fo:basic-link internal-destination="{@linkend}"
xsl:use-attribute-sets="xref.properties"
text-decoration="underline"
color="blue">
<xsl:choose>
<xsl:when test="count(child::node())=0">
<xsl:value-of select="@linkend"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates/>
</xsl:otherwise>
</xsl:choose>
</fo:basic-link>
</xsl:template>
<!-- admon --> <!-- admon -->
<xsl:param name="admon.graphics" select="0"/> <xsl:param name="admon.graphics" select="0"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment