fix MPPDF-36 : maven pdf fails with footer in navigation.xml.
fix MPPDF-24 : Internal links failed. fix MPPDF-13 : img src attributes are not made relative to the xdoc source. Patch from Lukas Theussl reviewed by aheritier git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@189713 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
5a88d9b4bc
commit
b7370ff5a9
3 files changed
+323
-20
No files matched your search
@@ -54,6 +54,7 @@
|
||||
</xsl:template>
|
||||
<xsl:template name="body-chapter-heading">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="chapter"/>
|
||||
<xsl:variable name="gutter">0.125</xsl:variable>
|
||||
<xsl:variable name="leftMargin">
|
||||
@@ -81,7 +82,7 @@
|
||||
</fo:list-item>
|
||||
</fo:list-block>
|
||||
</fo:block>
|
||||
<fo:block space-after.optimum="5em">
|
||||
<fo:block space-after.optimum="0em">
|
||||
<!-- Add a rule underneath -->
|
||||
<fo:leader xsl:use-attribute-sets="chapter.rule"/>
|
||||
</fo:block>
|
||||
@@ -89,15 +90,23 @@
|
||||
<!-- Templates for rendering xdoc tags -->
|
||||
<xsl:template match="document/body">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
<xsl:template match="section">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:block xsl:use-attribute-sets="body.h1">
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="transLink">
|
||||
<xsl:value-of select="translate(@name,' ','_')"/>
|
||||
</xsl:param>
|
||||
<fo:block xsl:use-attribute-sets="body.h1" id="{$fileName}#{$transLink}">
|
||||
<xsl:value-of select="@name"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="body.text">
|
||||
@@ -105,12 +114,19 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="subsection">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:block xsl:use-attribute-sets="body.h2">
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="transLink">
|
||||
<xsl:value-of select="translate(@name,' ','_')"/>
|
||||
</xsl:param>
|
||||
<fo:block xsl:use-attribute-sets="body.h2" id="{$fileName}#{$transLink}">
|
||||
<xsl:value-of select="@name"/>
|
||||
</fo:block>
|
||||
<fo:block xsl:use-attribute-sets="body.text">
|
||||
@@ -118,6 +134,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
@@ -141,47 +160,86 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="p">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="body.text normal.paragraph">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="source">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="body.source">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="pre">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="body.source">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="img[@src]">
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="dirName">
|
||||
<xsl:call-template name="substring-before-last">
|
||||
<xsl:with-param name="text" select="$fileName"/>
|
||||
<xsl:with-param name="chars">/</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:param>
|
||||
<!-- Resolve the location of the image source relative to the location of the current document -->
|
||||
<xsl:param name="ref" select="translate(normalize-space(@src),'\','/')"/>
|
||||
<xsl:variable name="source">
|
||||
<xsl:choose>
|
||||
<xsl:when test="substring(normalize-space(@src),1,3) = '../'">
|
||||
<xsl:value-of select="translate(substring-after(normalize-space(@src),'../'),'\','/')"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="substring(normalize-space(@src),1,3) = '..\'">
|
||||
<xsl:value-of select="translate(substring-after(normalize-space(@src),'..\'),'\','/')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@src"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($ref, './')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($dirName) = 0">
|
||||
<xsl:value-of select="substring-after($ref,'./')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($dirName, '/', substring-after($ref,'./'))"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($ref, '../')">
|
||||
<xsl:call-template name="resolveLink">
|
||||
<xsl:with-param name="dirName" select="$dirName"/>
|
||||
<xsl:with-param name="href" select="$ref"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($dirName) = 0">
|
||||
<xsl:value-of select="$ref"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($dirName, '/', $ref)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="width">
|
||||
<xsl:value-of select="substring-before(concat(normalize-space(@width),'p'),'p') div $imageDpi"/>
|
||||
@@ -224,156 +282,350 @@
|
||||
<!-- Templates for handling XHTML tags -->
|
||||
<xsl:template match="a[@href and (starts-with(@href, 'http') or starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:basic-link external-destination="{@href}">
|
||||
<fo:inline xsl:use-attribute-sets="href.external">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</fo:basic-link>
|
||||
</xsl:template>
|
||||
<xsl:template match="a[@href and starts-with(@href, '#')]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:basic-link internal-destination="{$chapterNumber}{@href}{generate-id()}">
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:basic-link internal-destination="{$fileName}{@href}">
|
||||
<fo:inline xsl:use-attribute-sets="href.internal">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</fo:basic-link>
|
||||
</xsl:template>
|
||||
<xsl:template match="a[@href and not(starts-with(@href, 'http')) and not(starts-with(@href, 'mailto')) and not(starts-with(@href, 'ftp')) and not(starts-with(@href, '#'))]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:basic-link internal-destination="{@href}{generate-id()}">
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="dirName">
|
||||
<xsl:call-template name="substring-before-last">
|
||||
<xsl:with-param name="text" select="$fileName"/>
|
||||
<xsl:with-param name="chars">/</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:param>
|
||||
<!-- Resolve the location of the link relative to the location of the current document -->
|
||||
<xsl:param name="ref" select="translate(normalize-space(@href),'\','/')"/>
|
||||
<xsl:param name="href">
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($ref, './')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($dirName) = 0">
|
||||
<xsl:value-of select="substring-after($ref,'./')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($dirName, '/', substring-after($ref,'./'))"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="starts-with($ref, '../')">
|
||||
<xsl:call-template name="resolveLink">
|
||||
<xsl:with-param name="dirName" select="$dirName"/>
|
||||
<xsl:with-param name="href" select="$ref"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($dirName) = 0">
|
||||
<xsl:value-of select="$ref"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($dirName, '/', $ref)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:param>
|
||||
<fo:basic-link internal-destination="{$href}">
|
||||
<fo:inline xsl:use-attribute-sets="href.internal">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</fo:basic-link>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="resolveLink">
|
||||
<xsl:param name="dirName"/>
|
||||
<xsl:param name="href"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($href, '../')">
|
||||
<xsl:call-template name="resolveLink">
|
||||
<xsl:with-param name="dirName">
|
||||
<xsl:call-template name="substring-before-last">
|
||||
<xsl:with-param name="text" select="$dirName"/>
|
||||
<xsl:with-param name="chars">/</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="href" select="substring-after($href,'../')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($dirName) = 0">
|
||||
<xsl:value-of select="$href"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="concat($dirName, '/', $href)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="substring-before-last">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:param name="chars"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($text) = 0"/>
|
||||
<xsl:when test="string-length($chars) = 0">
|
||||
<xsl:value-of select="$text"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($text, $chars)">
|
||||
<xsl:call-template name="substring-before-last-aux">
|
||||
<xsl:with-param name="text" select="$text"/>
|
||||
<xsl:with-param name="chars" select="$chars"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!--<xsl:value-of select="$text"/>-->
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="substring-before-last-aux">
|
||||
<xsl:param name="text"/>
|
||||
<xsl:param name="chars"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length($text) = 0"/>
|
||||
<xsl:when test="contains($text, $chars)">
|
||||
<xsl:variable name="after">
|
||||
<xsl:call-template name="substring-before-last-aux">
|
||||
<xsl:with-param name="text" select="substring-after($text, $chars)"/>
|
||||
<xsl:with-param name="chars" select="$chars"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<xsl:value-of select="substring-before($text, $chars)"/>
|
||||
<xsl:if test="string-length($after) > 0">
|
||||
<xsl:value-of select="$chars"/>
|
||||
<xsl:copy-of select="$after"/>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:otherwise/>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="a[@name]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:block id="{$chapterNumber}#{@name}{generate-id()}">
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:param name="name" select="translate(normalize-space(@name),'\','/')"/>
|
||||
<fo:block id="{$fileName}#{$name}">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="br">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block/>
|
||||
</xsl:template>
|
||||
<xsl:template match="em | i">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-style="italic">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="b | strong[ancestor::table]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-weight="bold">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="strong[ancestor::p|ancestor::li|ancestor::dl|ancestor::dt|ancestor::dd]">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-weight="bold" xsl:use-attribute-sets="body.strong">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="strong">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-weight="bold">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="sub">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline baseline-shift="sub">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="sup">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<fo:inline baseline-shift="sup">
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline baseline-shift="super">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="tt|code">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline xsl:use-attribute-sets="body.pre">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="code[@class='indent']">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="code.indent">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="var">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-style="italic">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="div">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
<xsl:template match="big">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-size="larger">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="small">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:inline font-size="smaller">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:inline>
|
||||
</xsl:template>
|
||||
<xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block/>
|
||||
@@ -384,6 +636,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
@@ -391,16 +646,21 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="ul | ol">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:list-block xsl:use-attribute-sets="list">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:list-block>
|
||||
</xsl:template>
|
||||
<xsl:template match="ul/li">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block>
|
||||
@@ -415,6 +675,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
@@ -422,6 +685,7 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="ol/li">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:list-item xsl:use-attribute-sets="list.item">
|
||||
<fo:list-item-label>
|
||||
<fo:block>
|
||||
@@ -434,6 +698,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</fo:list-item-body>
|
||||
@@ -441,31 +708,43 @@
|
||||
</xsl:template>
|
||||
<xsl:template match="dl">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="dl">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="dt">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="dt">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
<xsl:template match="dd">
|
||||
<xsl:param name="chapterNumber"/>
|
||||
<xsl:param name="fileName"/>
|
||||
<fo:block xsl:use-attribute-sets="dd">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</fo:block>
|
||||
</xsl:template>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<xsl:variable name="colorMediumGray">#A9A9A9</xsl:variable>
|
||||
<xsl:variable name="colorLightGray">#D3D3D3</xsl:variable>
|
||||
<xsl:variable name="colorWarmGrey11">#4b4542</xsl:variable>
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>
|
||||
<xsl:output method="xml" encoding="UTF-8" indent="no" omit-xml-declaration="no"/>
|
||||
<!-- Templates -->
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="project"/>
|
||||
@@ -68,12 +68,18 @@
|
||||
<xsl:template match="project/body/menu">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
<xsl:template match="project/body/footer">
|
||||
<!-- Ignore footer -->
|
||||
</xsl:template>
|
||||
<xsl:template match="project/body/menu/item">
|
||||
<!-- Renders the xml xdoc document -->
|
||||
<xsl:call-template name="render-xdoc">
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
@@ -83,6 +89,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
@@ -92,10 +101,14 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:number count="menu"/>.<xsl:number count="menu/item"/>.<xsl:number count="menu/item/item"/>.<xsl:number count="menu/item/item/item"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="substring-after(translate(normalize-space(@href),'\','/'),'/')"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
<xsl:template name="render-xdoc">
|
||||
<xsl:param name="chapterNumber">Foo</xsl:param>
|
||||
<xsl:param name="fileName">Bar</xsl:param>
|
||||
<!-- Set the page number to start at. Normally this is 'auto'
|
||||
unless we are at the very first xdoc, in which case we reset it to 1 -->
|
||||
<xsl:variable name="pageStart">
|
||||
@@ -140,12 +153,16 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="chapter">
|
||||
<xsl:value-of select="@name"/>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
<!-- Render the associated xdoc -->
|
||||
<fo:block id="{@href}{generate-id()}">
|
||||
<fo:block id="{@href}{generate-id()}"/>
|
||||
<fo:block id="{$fileName}">
|
||||
<xsl:choose>
|
||||
<xsl:when test="not(starts-with($href, 'http'))">
|
||||
<xsl:variable name="documentPath" select="concat(normalize-space($basePath),normalize-space( $documentName), '.xml')"/>
|
||||
@@ -157,6 +174,9 @@
|
||||
<xsl:with-param name="chapterNumber">
|
||||
<xsl:value-of select="$chapterNumber"/>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="fileName">
|
||||
<xsl:value-of select="$fileName"/>
|
||||
</xsl:with-param>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
<body>
|
||||
<release version="2.3" date="In SVN">
|
||||
<action dev="aheritier" type="update" issue="MPPDF-38">Use the ant task for the xsl transformation and remove xerces and xalan dependencies. People using java 5 will have to use this release with maven 1.1 or maven 1.0 with at the most the PDF plugin 2.2.X.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPPDF-36" due-to="Lukas Theussl">maven pdf fails with footer in navigation.xml.</action>
|
||||
<action dev="aheritier" type="update">Use the ant task for the fop transformation and remove xalan dependency.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPPDF-30" due-to="Lukas Theussl">The first row of table is not rendered.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPPDF-24" due-to="Lukas Theussl">Internal links failed.</action>
|
||||
<action dev="aheritier" type="fix" issue="MPPDF-13" due-to="Lukas Theussl">img src attributes are not made relative to the xdoc source.</action>
|
||||
</release>
|
||||
<release version="2.2.1" date="2004-10-30">
|
||||
<action dev="aheritier" type="fix" issue="MPPDF-21">The content of style tag was printed on the PDF file.</action>
|
||||
|
||||
Reference in new issue
Block a user