aheritier 2004/10/26 14:08:52
Modified: pdf/src/plugin-resources fo-body.xslt
pdf/src/plugin-test/test02/xdocs test.xml
pdf/xdocs changes.xml
Log:
Fix MPPDF-21
Revision Changes Path
1.10 +442 -442 maven-plugins/pdf/src/plugin-resources/fo-body.xslt
Index: fo-body.xslt
===================================================================
RCS file: /home/cvs/maven-plugins/pdf/src/plugin-resources/fo-body.xslt,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- fo-body.xslt 21 Sep 2004 22:15:53 -0000 1.9
+++ fo-body.xslt 26 Oct 2004 21:08:52 -0000 1.10
@@ -16,458 +16,458 @@
* 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">
- <!-- Templates for rendering headers, footers, and chapter headings -->
- <xsl:template name="body-header">
- <xsl:param name="headerText"/>
- <xsl:param name="pageNumber"/>
- <xsl:variable name="leftCol" select="0.9 * $maxBodyWidth"/>
- <xsl:variable name="rightCol" select="0.1 * $maxBodyWidth"/>
- <fo:static-content flow-name="xsl-region-before">
- <fo:table table-layout="fixed">
- <fo:table-column column-width="{$leftCol}in"/>
- <fo:table-column column-width="{$rightCol}in"/>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell>
- <fo:block xsl:use-attribute-sets="header.style">
- <xsl:value-of
select="normalize-space($headerText)"/>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell>
- <fo:block xsl:use-attribute-sets="page.number">
- <fo:page-number/>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- </fo:table-body>
- </fo:table>
- </fo:static-content>
- </xsl:template>
- <xsl:template name="body-footer">
- <xsl:param name="footerText"/>
- <fo:static-content flow-name="xsl-region-after">
- <fo:block xsl:use-attribute-sets="footer.style">
- <xsl:value-of select="normalize-space($footerText)"/>
+ <!-- Templates for rendering headers, footers, and chapter headings -->
+ <xsl:template name="body-header">
+ <xsl:param name="headerText"/>
+ <xsl:param name="pageNumber"/>
+ <xsl:variable name="leftCol" select="0.9 * $maxBodyWidth"/>
+ <xsl:variable name="rightCol" select="0.1 * $maxBodyWidth"/>
+ <fo:static-content flow-name="xsl-region-before">
+ <fo:table table-layout="fixed">
+ <fo:table-column column-width="{$leftCol}in"/>
+ <fo:table-column column-width="{$rightCol}in"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block xsl:use-attribute-sets="header.style">
+ <xsl:value-of select="normalize-space($headerText)"/>
+ </fo:block>
+ </fo:table-cell>
+ <fo:table-cell>
+ <fo:block xsl:use-attribute-sets="page.number">
+ <fo:page-number/>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+ </fo:static-content>
+ </xsl:template>
+ <xsl:template name="body-footer">
+ <xsl:param name="footerText"/>
+ <fo:static-content flow-name="xsl-region-after">
+ <fo:block xsl:use-attribute-sets="footer.style">
+ <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: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: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 space-after.optimum="5em">
+ <!-- Add a rule underneath -->
+ <fo:leader xsl:use-attribute-sets="chapter.rule"/>
+ </fo:block>
+ </xsl:template>
+ <!-- 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="[EMAIL PROTECTED]'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="[EMAIL PROTECTED]'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="[EMAIL PROTECTED]'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="[EMAIL PROTECTED]">
+ <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: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: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 space-after.optimum="5em">
- <!-- Add a rule underneath -->
- <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:template>
- <!-- Templates for rendering xdoc tags -->
- <xsl:template match="document/body">
- <xsl:param name="chapterNumber"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:external-graphic src="{normalize-space($source)}"
height="{$realheight}" width="{$realwidth}" content-height="auto"
content-width="auto"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- Templates for handling XHTML tags -->
+ <xsl:template match="[EMAIL PROTECTED] and (starts-with(@href, 'http') or
starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]">
+ <xsl:param name="chapterNumber"/>
+ <fo:basic-link external-destination="[EMAIL PROTECTED]">
+ <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:apply-templates>
+ </fo:inline>
+ </fo:basic-link>
+ </xsl:template>
+ <xsl:template match="[EMAIL PROTECTED] and starts-with(@href, '#')]">
+ <xsl:param name="chapterNumber"/>
+ <fo:basic-link internal-destination="[EMAIL PROTECTED]()}">
+ <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="[EMAIL PROTECTED] 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="[EMAIL PROTECTED]()}">
+ <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="[EMAIL PROTECTED]">
+ <xsl:param name="chapterNumber"/>
+ <fo:block id="[EMAIL PROTECTED]()}">
+ <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/>
+ </xsl:template>
+ <xsl:template match="em | i">
+ <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="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: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="[EMAIL PROTECTED]'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="[EMAIL PROTECTED]'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="[EMAIL PROTECTED]'h5']">
- <xsl:param name="chapterNumber"/>
- <fo:block xsl:use-attribute-sets="body.h5">
- <xsl:value-of select="normalize-space(.)"/>
+ </xsl:apply-templates>
</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="[EMAIL PROTECTED]">
- <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:external-graphic src="{normalize-space($source)}"
height="{$realheight}" width="{$realwidth}" content-height="auto"
content-width="auto"/>
- </fo:block>
- </xsl:when>
- <xsl:otherwise>
- <fo:external-graphic src="{normalize-space($source)}"
height="{$realheight}" width="{$realwidth}" content-height="auto"
content-width="auto"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Templates for handling XHTML tags -->
- <xsl:template match="[EMAIL PROTECTED] and (starts-with(@href, 'http') or
starts-with(@href, 'mailto') or starts-with(@href, 'ftp'))]">
- <xsl:param name="chapterNumber"/>
- <fo:basic-link external-destination="[EMAIL PROTECTED]">
- <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:apply-templates>
- </fo:inline>
- </fo:basic-link>
- </xsl:template>
- <xsl:template match="[EMAIL PROTECTED] and starts-with(@href, '#')]">
- <xsl:param name="chapterNumber"/>
- <fo:basic-link internal-destination="[EMAIL PROTECTED]()}">
- <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="[EMAIL PROTECTED] 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="[EMAIL PROTECTED]()}">
- <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="[EMAIL PROTECTED]">
- <xsl:param name="chapterNumber"/>
- <fo:block id="[EMAIL PROTECTED]()}">
- <xsl:apply-templates>
- <xsl:with-param name="chapterNumber">
- <xsl:value-of select="$chapterNumber"/>
- </xsl:with-param>
- </xsl:apply-templates>
+ </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>•</xsl:text>
+ </xsl:if>
</fo:block>
- </xsl:template>
- <xsl:template match="br">
- <xsl:param name="chapterNumber"/>
- <fo:block/>
- </xsl:template>
- <xsl:template match="em | i">
- <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="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>•</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: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>
- </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: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>
- </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: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>
- </xsl:template>
+ </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>
1.2 +10 -0 maven-plugins/pdf/src/plugin-test/test02/xdocs/test.xml
Index: test.xml
===================================================================
RCS file: /home/cvs/maven-plugins/pdf/src/plugin-test/test02/xdocs/test.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- test.xml 23 Sep 2004 00:42:23 -0000 1.1
+++ test.xml 26 Oct 2004 21:08:52 -0000 1.2
@@ -57,5 +57,15 @@
</p>
</subsection>
</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>
</document>
1.24 +2 -1 maven-plugins/pdf/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/pdf/xdocs/changes.xml,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- changes.xml 14 Oct 2004 20:05:21 -0000 1.23
+++ changes.xml 26 Oct 2004 21:08:52 -0000 1.24
@@ -22,7 +22,8 @@
<author email="[EMAIL PROTECTED]">dIon Gillard</author>
</properties>
<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>
</release>
<release version="2.2" date="2004-09-27">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]