|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
xmlns:exsl="http://exslt.org/common"
|
|
Packit Service |
76cb02 |
exclude-result-prefixes="exsl" version='1.0'>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
XSLT Stylesheet DocBook -> LaTeX
|
|
Packit Service |
76cb02 |
############################################################################ -->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
The first <cover> is assumed to be for the front page, the second one is
|
|
Packit Service |
76cb02 |
for the back page.
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
The implementation tries to match the DocBook 4 method that uses
|
|
Packit Service |
76cb02 |
<mediaobject>s with role='cover' to represent a cover, but it ignores those
|
|
Packit Service |
76cb02 |
elements if <cover> elements are found.
|
|
Packit Service |
76cb02 |
-->
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="front.cover">
|
|
Packit Service |
76cb02 |
<xsl:param name="info" select="/*/*[contains(name(.), 'info')]"/>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="make.cover">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="idx" select="1"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="info" select="$info"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="back.cover">
|
|
Packit Service |
76cb02 |
<xsl:param name="info" select="/*/*[contains(name(.), 'info')]"/>
|
|
Packit Service |
76cb02 |
<xsl:call-template name="make.cover">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="idx" select="2"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="info" select="$info"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template name="make.cover">
|
|
Packit Service |
76cb02 |
<xsl:param name="idx" select="1"/>
|
|
Packit Service |
76cb02 |
<xsl:param name="info"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="covers" select="$info/cover"/>
|
|
Packit Service |
76cb02 |
<xsl:variable name="medias" select="$info//mediaobject[@role='cover']"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:choose>
|
|
Packit Service |
76cb02 |
<xsl:when test="count($covers) >= $idx">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="$covers[$idx]/mediaobject" mode="cover"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
<xsl:when test="count($medias) >= $idx">
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="$medias[$idx]" mode="cover"/>
|
|
Packit Service |
76cb02 |
</xsl:when>
|
|
Packit Service |
76cb02 |
</xsl:choose>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="mediaobject" mode="cover">
|
|
Packit Service |
76cb02 |
<xsl:variable name="idx">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="mediaobject.select.idx">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="role" select="'front-large'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:variable>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:variable name="img" select="imageobject[position()=$idx]"/>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:text>\putoncover{</xsl:text>
|
|
Packit Service |
76cb02 |
<xsl:apply-templates select="$img/imagedata" mode="cover"/>
|
|
Packit Service |
76cb02 |
<xsl:text>}
</xsl:text>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
<xsl:template match="imagedata" mode="cover">
|
|
Packit Service |
76cb02 |
<xsl:call-template name="imagedata">
|
|
Packit Service |
76cb02 |
<xsl:with-param name="layout.width" select="'\paperwidth'"/>
|
|
Packit Service |
76cb02 |
<xsl:with-param name="layout.height" select="'\paperheight'"/>
|
|
Packit Service |
76cb02 |
</xsl:call-template>
|
|
Packit Service |
76cb02 |
</xsl:template>
|
|
Packit Service |
76cb02 |
|
|
Packit Service |
76cb02 |
</xsl:stylesheet>
|