123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <?xml version="1.0"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:exsl="http://exslt.org/common"
- xmlns:set="http://exslt.org/sets"
- exclude-result-prefixes="exsl set"
- version="1.0">
- <xsl:template match="/" mode="insert.fo.fnum">
- <xsl:param name="mark" select="'?'"/>
- <xsl:apply-templates mode="insert.fo.fnum">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="*" mode="insert.fo.fnum">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="insert.fo.fnum">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="fo:block" mode="insert.fo.fnum">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy>
- <xsl:for-each select="@*">
- <xsl:choose>
- <xsl:when test="starts-with(name(.), 'space-before')"/>
- <xsl:when test="starts-with(name(.), 'space-after')"/>
- <xsl:when test="starts-with(name(.), 'font-size')"/>
- <xsl:otherwise>
- <xsl:copy-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:if test="not(preceding::fo:block)">
- <xsl:copy-of select="$mark"/>
- </xsl:if>
- <xsl:apply-templates mode="insert.fo.fnum">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.fnum">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy/>
- </xsl:template>
- <xsl:template match="/" mode="insert.fo.block">
- <xsl:param name="mark" select="'?'"/>
- <xsl:apply-templates mode="insert.fo.block">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="*" mode="insert.fo.block">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="insert.fo.block">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="fo:block" mode="insert.fo.block">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:if test="not(preceding::fo:block)">
- <xsl:copy-of select="$mark"/>
- </xsl:if>
- <xsl:apply-templates mode="insert.fo.block">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.block">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy/>
- </xsl:template>
- <xsl:template match="/" mode="insert.fo.text">
- <xsl:param name="mark" select="'?'"/>
- <xsl:apply-templates mode="insert.fo.text">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="*" mode="insert.fo.text">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="insert.fo.text">
- <xsl:with-param name="mark" select="$mark"/>
- </xsl:apply-templates>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="text()|processing-instruction()|comment()" mode="insert.fo.text">
- <xsl:param name="mark" select="'?'"/>
- <xsl:if test="not(preceding::text())">
- <xsl:copy-of select="$mark"/>
- </xsl:if>
- <xsl:copy/>
- </xsl:template>
- <xsl:template match="processing-instruction()|comment()" mode="insert.fo.text">
- <xsl:param name="mark" select="'?'"/>
- <xsl:copy/>
- </xsl:template>
- </xsl:stylesheet>
|