Fix MPPDF-21

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@116189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2004-10-26 21:08:52 +00:00
parent 1ddfda58ae
commit d3534dfd77
3 changed files with 456 additions and 445 deletions

View File

@ -16,458 +16,458 @@
* limitations under the License. * limitations under the License.
*/ */
--> -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">
<!-- Templates for rendering headers, footers, and chapter headings --> <!-- Templates for rendering headers, footers, and chapter headings -->
<xsl:template name="body-header"> <xsl:template name="body-header">
<xsl:param name="headerText"/> <xsl:param name="headerText"/>
<xsl:param name="pageNumber"/> <xsl:param name="pageNumber"/>
<xsl:variable name="leftCol" select="0.9 * $maxBodyWidth"/> <xsl:variable name="leftCol" select="0.9 * $maxBodyWidth"/>
<xsl:variable name="rightCol" select="0.1 * $maxBodyWidth"/> <xsl:variable name="rightCol" select="0.1 * $maxBodyWidth"/>
<fo:static-content flow-name="xsl-region-before"> <fo:static-content flow-name="xsl-region-before">
<fo:table table-layout="fixed"> <fo:table table-layout="fixed">
<fo:table-column column-width="{$leftCol}in"/> <fo:table-column column-width="{$leftCol}in"/>
<fo:table-column column-width="{$rightCol}in"/> <fo:table-column column-width="{$rightCol}in"/>
<fo:table-body> <fo:table-body>
<fo:table-row> <fo:table-row>
<fo:table-cell> <fo:table-cell>
<fo:block xsl:use-attribute-sets="header.style"> <fo:block xsl:use-attribute-sets="header.style">
<xsl:value-of select="normalize-space($headerText)"/> <xsl:value-of select="normalize-space($headerText)"/>
</fo:block> </fo:block>
</fo:table-cell> </fo:table-cell>
<fo:table-cell> <fo:table-cell>
<fo:block xsl:use-attribute-sets="page.number"> <fo:block xsl:use-attribute-sets="page.number">
<fo:page-number/> <fo:page-number/>
</fo:block> </fo:block>
</fo:table-cell> </fo:table-cell>
</fo:table-row> </fo:table-row>
</fo:table-body> </fo:table-body>
</fo:table> </fo:table>
</fo:static-content> </fo:static-content>
</xsl:template> </xsl:template>
<xsl:template name="body-footer"> <xsl:template name="body-footer">
<xsl:param name="footerText"/> <xsl:param name="footerText"/>
<fo:static-content flow-name="xsl-region-after"> <fo:static-content flow-name="xsl-region-after">
<fo:block xsl:use-attribute-sets="footer.style"> <fo:block xsl:use-attribute-sets="footer.style">
<xsl:value-of select="normalize-space($footerText)"/> <xsl:value-of select="normalize-space($footerText)"/>
</fo:block>
</fo:static-content>
</xsl:template>
<xsl:template name="body-chapter-heading">
<xsl:param name="chapterNumber"/>
<xsl:param name="chapter"/>
<xsl:variable name="gutter">0.125</xsl:variable>
<xsl:variable name="leftMargin">
<xsl:value-of select="$bodySideMargins"/>
</xsl:variable>
<xsl:variable name="rightMargin">
<xsl:value-of select="$bodySideMargins"/>
</xsl:variable>
<xsl:variable name="bodyWidth">
<xsl:value-of select="$maxBodyWidth"/>
</xsl:variable>
<fo:block>
<fo:list-block provisional-distance-between-starts="{$leftMargin}in" provisional-label-separation="{$gutter}in">
<fo:list-item>
<fo:list-item-label end-indent="{$bodyWidth + $gutter}in">
<fo:block xsl:use-attribute-sets="outdented.number.style">
<xsl:value-of select="normalize-space($chapterNumber)"/>
</fo:block> </fo:block>
</fo:static-content> </fo:list-item-label>
</xsl:template> <fo:list-item-body>
<xsl:template name="body-chapter-heading"> <fo:block xsl:use-attribute-sets="chapter.title">
<xsl:param name="chapterNumber"/> <xsl:value-of select="normalize-space($chapter)"/>
<xsl:param name="chapter"/> </fo:block>
<xsl:variable name="gutter">0.125</xsl:variable> </fo:list-item-body>
<xsl:variable name="leftMargin"> </fo:list-item>
<xsl:value-of select="$bodySideMargins"/> </fo:list-block>
</xsl:variable> </fo:block>
<xsl:variable name="rightMargin"> <fo:block space-after.optimum="5em">
<xsl:value-of select="$bodySideMargins"/> <!-- Add a rule underneath -->
</xsl:variable> <fo:leader xsl:use-attribute-sets="chapter.rule"/>
<xsl:variable name="bodyWidth"> </fo:block>
<xsl:value-of select="$maxBodyWidth"/> </xsl:template>
</xsl:variable> <!-- Templates for rendering xdoc tags -->
<xsl:template match="document/body">
<xsl:param name="chapterNumber"/>
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</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:value-of select="@name"/>
</fo:block>
<fo:block xsl:use-attribute-sets="body.text">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</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:value-of select="@name"/>
</fo:block>
<fo:block xsl:use-attribute-sets="body.text">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="p[@style='h3']">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.h3">
<xsl:value-of select="normalize-space(.)"/>
</fo:block>
</xsl:template>
<xsl:template match="p[@style='h4']">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.h4">
<xsl:value-of select="normalize-space(.)"/>
</fo:block>
</xsl:template>
<xsl:template match="p[@style='h5']">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.h5">
<xsl:value-of select="normalize-space(.)"/>
</fo:block>
</xsl:template>
<xsl:template match="p">
<xsl:param name="chapterNumber"/>
<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:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="source">
<xsl:param name="chapterNumber"/>
<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:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="pre">
<xsl:param name="chapterNumber"/>
<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:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="img[@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:variable>
<xsl:variable name="width">
<xsl:value-of select="substring-before(concat(normalize-space(@width),'p'),'p') div $imageDpi"/>
</xsl:variable>
<xsl:variable name="height">
<xsl:value-of select="substring-before(concat(normalize-space(@height),'p'),'p') div $imageDpi"/>
</xsl:variable>
<xsl:variable name="realwidth">
<xsl:choose>
<xsl:when test="normalize-space($width) = 'NaN'">
<xsl:value-of select="'auto'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$width"/>in
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="realheight">
<xsl:choose>
<xsl:when test="normalize-space($height) = 'NaN'">
<xsl:value-of select="'auto'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$height"/>in
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Enclose image in a block if parent is a section or subsection element -->
<xsl:choose>
<xsl:when test="parent::section | parent::subsection">
<fo:block> <fo:block>
<fo:list-block provisional-distance-between-starts="{$leftMargin}in" provisional-label-separation="{$gutter}in"> <fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/>
<fo:list-item>
<fo:list-item-label end-indent="{$bodyWidth + $gutter}in">
<fo:block xsl:use-attribute-sets="outdented.number.style">
<xsl:value-of select="normalize-space($chapterNumber)"/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body>
<fo:block xsl:use-attribute-sets="chapter.title">
<xsl:value-of select="normalize-space($chapter)"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</fo:block> </fo:block>
<fo:block space-after.optimum="5em"> </xsl:when>
<!-- Add a rule underneath --> <xsl:otherwise>
<fo:leader xsl:use-attribute-sets="chapter.rule"/> <fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/>
</fo:block> </xsl:otherwise>
</xsl:template> </xsl:choose>
<!-- Templates for rendering xdoc tags --> </xsl:template>
<xsl:template match="document/body"> <!-- Templates for handling XHTML tags -->
<xsl:param name="chapterNumber"/> <xsl:template match="a[@href and (starts-with(@href, 'http') or starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]">
<xsl:param name="chapterNumber"/>
<fo:basic-link external-destination="{@href}">
<fo:inline xsl:use-attribute-sets="href.external">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="chapterNumber"> <xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/> <xsl:value-of select="$chapterNumber"/>
</xsl:with-param> </xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </fo:inline>
<xsl:template match="section"> </fo:basic-link>
<xsl:param name="chapterNumber"/> </xsl:template>
<fo:block xsl:use-attribute-sets="body.h1"> <xsl:template match="a[@href and starts-with(@href, '#')]">
<xsl:value-of select="@name"/> <xsl:param name="chapterNumber"/>
</fo:block> <fo:basic-link internal-destination="{$chapterNumber}{@href}{generate-id()}">
<fo:block xsl:use-attribute-sets="body.text"> <fo:inline xsl:use-attribute-sets="href.internal">
<xsl:apply-templates> <xsl:apply-templates>
<xsl:with-param name="chapterNumber"> <xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/> <xsl:value-of select="$chapterNumber"/>
</xsl:with-param> </xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
</fo:block> </fo:inline>
</xsl:template> </fo:basic-link>
<xsl:template match="subsection"> </xsl:template>
<xsl:param name="chapterNumber"/> <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, '#'))]">
<fo:block xsl:use-attribute-sets="body.h2"> <xsl:param name="chapterNumber"/>
<xsl:value-of select="@name"/> <fo:basic-link internal-destination="{@href}{generate-id()}">
</fo:block> <fo:inline xsl:use-attribute-sets="href.internal">
<fo:block xsl:use-attribute-sets="body.text"> <xsl:apply-templates>
<xsl:apply-templates> <xsl:with-param name="chapterNumber">
<xsl:with-param name="chapterNumber"> <xsl:value-of select="$chapterNumber"/>
<xsl:value-of select="$chapterNumber"/> </xsl:with-param>
</xsl:with-param> </xsl:apply-templates>
</xsl:apply-templates> </fo:inline>
</fo:block> </fo:basic-link>
</xsl:template> </xsl:template>
<xsl:template match="p[@style='h3']"> <xsl:template match="a[@name]">
<xsl:param name="chapterNumber"/> <xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.h3"> <fo:block id="{$chapterNumber}#{@name}{generate-id()}">
<xsl:value-of select="normalize-space(.)"/> <xsl:apply-templates>
</fo:block> <xsl:with-param name="chapterNumber">
</xsl:template> <xsl:value-of select="$chapterNumber"/>
<xsl:template match="p[@style='h4']"> </xsl:with-param>
<xsl:param name="chapterNumber"/> </xsl:apply-templates>
<fo:block xsl:use-attribute-sets="body.h4"> </fo:block>
<xsl:value-of select="normalize-space(.)"/> </xsl:template>
</fo:block> <xsl:template match="br">
</xsl:template> <xsl:param name="chapterNumber"/>
<xsl:template match="p[@style='h5']"> <fo:block/>
<xsl:param name="chapterNumber"/> </xsl:template>
<fo:block xsl:use-attribute-sets="body.h5"> <xsl:template match="em | i">
<xsl:value-of select="normalize-space(.)"/> <xsl:param name="chapterNumber"/>
</fo:block> <fo:inline font-style="italic">
</xsl:template> <xsl:apply-templates>
<xsl:template match="p"> <xsl:with-param name="chapterNumber">
<xsl:param name="chapterNumber"/> <xsl:value-of select="$chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.text normal.paragraph"> </xsl:with-param>
<xsl:apply-templates> </xsl:apply-templates>
<xsl:with-param name="chapterNumber"> </fo:inline>
<xsl:value-of select="$chapterNumber"/> </xsl:template>
</xsl:with-param> <xsl:template match="b | strong[ancestor::table]">
</xsl:apply-templates> <xsl:param name="chapterNumber"/>
</fo:block> <fo:inline font-weight="bold">
</xsl:template> <xsl:apply-templates>
<xsl:template match="source"> <xsl:with-param name="chapterNumber">
<xsl:param name="chapterNumber"/> <xsl:value-of select="$chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.source"> </xsl:with-param>
<xsl:apply-templates> </xsl:apply-templates>
<xsl:with-param name="chapterNumber"> </fo:inline>
<xsl:value-of select="$chapterNumber"/> </xsl:template>
</xsl:with-param> <xsl:template match="strong[ancestor::p|ancestor::li|ancestor::dl|ancestor::dt|ancestor::dd]">
</xsl:apply-templates> <xsl:param name="chapterNumber"/>
</fo:block> <fo:inline font-weight="bold" xsl:use-attribute-sets="body.strong">
</xsl:template> <xsl:apply-templates>
<xsl:template match="pre"> <xsl:with-param name="chapterNumber">
<xsl:param name="chapterNumber"/> <xsl:value-of select="$chapterNumber"/>
<fo:block xsl:use-attribute-sets="body.source"> </xsl:with-param>
<xsl:apply-templates> </xsl:apply-templates>
<xsl:with-param name="chapterNumber"> </fo:inline>
<xsl:value-of select="$chapterNumber"/> </xsl:template>
</xsl:with-param> <xsl:template match="strong">
</xsl:apply-templates> <xsl:param name="chapterNumber"/>
</fo:block> <fo:inline font-weight="bold">
</xsl:template> <xsl:apply-templates>
<xsl:template match="img[@src]"> <xsl:with-param name="chapterNumber">
<xsl:variable name="source"> <xsl:value-of select="$chapterNumber"/>
<xsl:choose> </xsl:with-param>
<xsl:when test="substring(normalize-space(@src),1,3) = '../'"> </xsl:apply-templates>
<xsl:value-of select="translate(substring-after(normalize-space(@src),'../'),'\','/')"/> </fo:inline>
</xsl:when> </xsl:template>
<xsl:when test="substring(normalize-space(@src),1,3) = '..\'"> <xsl:template match="sub">
<xsl:value-of select="translate(substring-after(normalize-space(@src),'..\'),'\','/')"/> <xsl:param name="chapterNumber"/>
</xsl:when> <fo:inline baseline-shift="sub">
<xsl:otherwise> <xsl:apply-templates>
<xsl:value-of select="@src"/> <xsl:with-param name="chapterNumber">
</xsl:otherwise> <xsl:value-of select="$chapterNumber"/>
</xsl:choose> </xsl:with-param>
</xsl:variable> </xsl:apply-templates>
<xsl:variable name="width"> </fo:inline>
<xsl:value-of select="substring-before(concat(normalize-space(@width),'p'),'p') div $imageDpi"/> </xsl:template>
</xsl:variable> <xsl:template match="sup">
<xsl:variable name="height"> <xsl:param name="chapterNumber"/>
<xsl:value-of select="substring-before(concat(normalize-space(@height),'p'),'p') div $imageDpi"/> <fo:inline baseline-shift="sup">
</xsl:variable> <xsl:apply-templates>
<xsl:variable name="realwidth"> <xsl:with-param name="chapterNumber">
<xsl:choose> <xsl:value-of select="$chapterNumber"/>
<xsl:when test="normalize-space($width) = 'NaN'"> </xsl:with-param>
<xsl:value-of select="'auto'"/> </xsl:apply-templates>
</xsl:when> </fo:inline>
<xsl:otherwise> </xsl:template>
<xsl:value-of select="$width"/>in <xsl:template match="tt|code">
</xsl:otherwise> <xsl:param name="chapterNumber"/>
</xsl:choose> <fo:inline xsl:use-attribute-sets="body.pre">
</xsl:variable> <xsl:apply-templates>
<xsl:variable name="realheight"> <xsl:with-param name="chapterNumber">
<xsl:choose> <xsl:value-of select="$chapterNumber"/>
<xsl:when test="normalize-space($height) = 'NaN'"> </xsl:with-param>
<xsl:value-of select="'auto'"/> </xsl:apply-templates>
</xsl:when> </fo:inline>
<xsl:otherwise> </xsl:template>
<xsl:value-of select="$height"/>in <xsl:template match="var">
</xsl:otherwise> <xsl:param name="chapterNumber"/>
</xsl:choose> <fo:inline font-style="italic">
</xsl:variable> <xsl:apply-templates>
<!-- Enclose image in a block if parent is a section or subsection element --> <xsl:with-param name="chapterNumber">
<xsl:choose> <xsl:value-of select="$chapterNumber"/>
<xsl:when test="parent::section | parent::subsection"> </xsl:with-param>
<fo:block> </xsl:apply-templates>
<fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/> </fo:inline>
</fo:block> </xsl:template>
</xsl:when> <xsl:template match="big">
<xsl:otherwise> <xsl:param name="chapterNumber"/>
<fo:external-graphic src="{normalize-space($source)}" height="{$realheight}" width="{$realwidth}" content-height="auto" content-width="auto"/> <fo:inline font-size="larger">
</xsl:otherwise> <xsl:apply-templates>
</xsl:choose> <xsl:with-param name="chapterNumber">
</xsl:template> <xsl:value-of select="$chapterNumber"/>
<!-- Templates for handling XHTML tags --> </xsl:with-param>
<xsl:template match="a[@href and (starts-with(@href, 'http') or starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]"> </xsl:apply-templates>
<xsl:param name="chapterNumber"/> </fo:inline>
<fo:basic-link external-destination="{@href}"> </xsl:template>
<fo:inline xsl:use-attribute-sets="href.external"> <xsl:template match="small">
<xsl:apply-templates> <xsl:param name="chapterNumber"/>
<xsl:with-param name="chapterNumber"> <fo:inline font-size="smaller">
<xsl:value-of select="$chapterNumber"/> <xsl:apply-templates>
</xsl:with-param> <xsl:with-param name="chapterNumber">
</xsl:apply-templates> <xsl:value-of select="$chapterNumber"/>
</fo:inline> </xsl:with-param>
</fo:basic-link> </xsl:apply-templates>
</xsl:template> </fo:inline>
<xsl:template match="a[@href and starts-with(@href, '#')]"> </xsl:template>
<xsl:param name="chapterNumber"/> <xsl:template match="ul/ul | ul/ol | ol/ul | ol/ol">
<fo:basic-link internal-destination="{$chapterNumber}{@href}{generate-id()}"> <xsl:param name="chapterNumber"/>
<fo:inline xsl:use-attribute-sets="href.internal"> <fo:list-item xsl:use-attribute-sets="list.item">
<xsl:apply-templates> <fo:list-item-label>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</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()}">
<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:apply-templates>
</fo:inline>
</fo:basic-link>
</xsl:template>
<xsl:template match="a[@name]">
<xsl:param name="chapterNumber"/>
<fo:block id="{$chapterNumber}#{@name}{generate-id()}">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="br">
<xsl:param name="chapterNumber"/>
<fo:block/> <fo:block/>
</xsl:template> </fo:list-item-label>
<xsl:template match="em | i"> <fo:list-item-body start-indent="body-start()">
<xsl:param name="chapterNumber"/> <fo:block>
<fo:inline font-style="italic"> <xsl:apply-templates>
<xsl:apply-templates> <xsl:with-param name="chapterNumber">
<xsl:with-param name="chapterNumber"> <xsl:value-of select="$chapterNumber"/>
<xsl:value-of select="$chapterNumber"/> </xsl:with-param>
</xsl:with-param> </xsl:apply-templates>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="b | strong[ancestor::table]">
<xsl:param name="chapterNumber"/>
<fo:inline font-weight="bold">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</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"/>
<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:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="strong">
<xsl:param name="chapterNumber"/>
<fo:inline font-weight="bold">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="sub">
<xsl:param name="chapterNumber"/>
<fo:inline baseline-shift="sub">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="sup">
<xsl:param name="chapterNumber"/>
<fo:inline baseline-shift="sup">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="tt|code">
<xsl:param name="chapterNumber"/>
<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:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="var">
<xsl:param name="chapterNumber"/>
<fo:inline font-style="italic">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="big">
<xsl:param name="chapterNumber"/>
<fo:inline font-size="larger">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:inline>
</xsl:template>
<xsl:template match="small">
<xsl:param name="chapterNumber"/>
<fo:inline font-size="smaller">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</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"/>
<fo:list-item xsl:use-attribute-sets="list.item">
<fo:list-item-label>
<fo:block/>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="ul | ol">
<xsl:param name="chapterNumber"/>
<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:apply-templates>
</fo:list-block>
</xsl:template>
<xsl:template match="ul/li">
<xsl:param name="chapterNumber"/>
<fo:list-item xsl:use-attribute-sets="list.item">
<fo:list-item-label>
<fo:block>
<xsl:if test="not(@style='list-style: none')">
<xsl:text>&#8226;</xsl:text>
</xsl:if>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="ol/li">
<xsl:param name="chapterNumber"/>
<fo:list-item xsl:use-attribute-sets="list.item">
<fo:list-item-label>
<fo:block>
<xsl:number format="1."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="dl">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="dl">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block> </fo:block>
</xsl:template> </fo:list-item-body>
<xsl:template match="dt"> </fo:list-item>
<xsl:param name="chapterNumber"/> </xsl:template>
<fo:block xsl:use-attribute-sets="dt"> <xsl:template match="ul | ol">
<xsl:apply-templates> <xsl:param name="chapterNumber"/>
<xsl:with-param name="chapterNumber"> <fo:list-block xsl:use-attribute-sets="list">
<xsl:value-of select="$chapterNumber"/> <xsl:apply-templates>
</xsl:with-param> <xsl:with-param name="chapterNumber">
</xsl:apply-templates> <xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:list-block>
</xsl:template>
<xsl:template match="ul/li">
<xsl:param name="chapterNumber"/>
<fo:list-item xsl:use-attribute-sets="list.item">
<fo:list-item-label>
<fo:block>
<xsl:if test="not(@style='list-style: none')">
<xsl:text>&#8226;</xsl:text>
</xsl:if>
</fo:block> </fo:block>
</xsl:template> </fo:list-item-label>
<xsl:template match="dd"> <fo:list-item-body start-indent="body-start()">
<xsl:param name="chapterNumber"/> <fo:block>
<fo:block xsl:use-attribute-sets="dd"> <xsl:apply-templates>
<xsl:apply-templates> <xsl:with-param name="chapterNumber">
<xsl:with-param name="chapterNumber"> <xsl:value-of select="$chapterNumber"/>
<xsl:value-of select="$chapterNumber"/> </xsl:with-param>
</xsl:with-param> </xsl:apply-templates>
</xsl:apply-templates>
</fo:block> </fo:block>
</xsl:template> </fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="ol/li">
<xsl:param name="chapterNumber"/>
<fo:list-item xsl:use-attribute-sets="list.item">
<fo:list-item-label>
<fo:block>
<xsl:number format="1."/>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="dl">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="dl">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="dt">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="dt">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="dd">
<xsl:param name="chapterNumber"/>
<fo:block xsl:use-attribute-sets="dd">
<xsl:apply-templates>
<xsl:with-param name="chapterNumber">
<xsl:value-of select="$chapterNumber"/>
</xsl:with-param>
</xsl:apply-templates>
</fo:block>
</xsl:template>
<xsl:template match="style"/>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -57,5 +57,15 @@
</p> </p>
</subsection> </subsection>
</section> </section>
<section name="Test for MPPDF-21">
<p>
<style type="text/css">
img.screenshot {
padding: 10px;
}
</style>
<img class="screenshot" src="images/maven.gif"/>
</p>
</section>
</body> </body>
</document> </document>

View File

@ -22,7 +22,8 @@
<author email="dion@apache.org">dIon Gillard</author> <author email="dion@apache.org">dIon Gillard</author>
</properties> </properties>
<body> <body>
<release version="2.3-SNAPSHOT" date="2004-09-27"> <release version="2.3-SNAPSHOT" date="In CVS">
<action dev="aheritier" type="fix" issue="MPPDF-21">The content of style tag was printed on the PDF file.</action>
<action dev="aheritier" type="fix" issue="MPPDF-16" due-to="Archimedes Trajano">JDK 5.0 incompatibility. XSLT is now called from Jelly.</action> <action dev="aheritier" type="fix" issue="MPPDF-16" due-to="Archimedes Trajano">JDK 5.0 incompatibility. XSLT is now called from Jelly.</action>
</release> </release>
<release version="2.2" date="2004-09-27"> <release version="2.2" date="2004-09-27">