Subject: Re: [xsl] how to trigger a new page sequence, depending on specific input conditions From: team wise <dfanster@xxxxxxxxx> Date: Thu, 6 Oct 2011 20:29:33 +0800 |
Hi XSL list, Thanks to Tony's generous help, I have been very close to solving the problem I have when outputing a desirable PDF using XSL FO. However, I am still stuck in the final step. To facilitate this problem solving endeavor,I am trying to make the problem statement as succint as possible to get started quickly. Problem: FO implementations that are comprised of two separate <fo:page-sequence>, among others result in PDF that contains two back page. Solutions I have taken so far, which do not work as expected, are explained below: First, here is the 'insert.lastchapter' named template that triggers a new page sequence for the 'back page' only, which works just fine. Note that 'insert.lastchapter' is pretty much duplicate of the 'insert.chapter', which is briefly explained below. <xsl:template name="insert.lastchapter"> <xsl:param name="content"/> <xsl:if test="$outputformat = 'UG_Booklet_Print'"> <xsl:for-each select="*[contains(@outputclass, 'pagebreak')]"> <xsl:variable name="position" select="position()" /> <fo:page-sequence initial-page-number="auto" format="1"> <xsl:attribute name="master-reference">chapter-master</xsl:attribute> <xsl:choose> <xsl:when test="position() = last()"> <xsl:attribute name="axf:background-color"> <xsl:message>21</xsl:message> <xsl:value-of select="$background_colour"/></xsl:attribute> <xsl:attribute name="color">rgb-icc(#CMYK,0%,0%,0%,0%)</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="color">rgb-icc(#CMYK,0%,0%,0%,80%)</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select=". | preceding-sibling::*[count(preceding-sibling::*[contains(@outputclass, 'pagebreak')]) = $position - 1]" /> <fo:flow flow-name="region.body"> </fo:flow> </fo:page-sequence> </xsl:for-each> </xsl:if> </xsl:template> Second, as indicated below, to prevent <fo:flow flow-name"region.body"> from flowing in the last node to appear on the last page or the back page repeatedly within 'insert.chapter', I have tried <xsl:when test="(contains($outputformat, 'UG_Booklet_Print') and position() != 'last()')"> or <xsl:when test="contains($outputformat, 'UG_Booklet_Print') and not (position() = last())"> within <xsl:for-each select="*[contains(@refclass, ' map/topicref ')]">...</xsl:for-each> , which is of no avail, unfortunately. As it has taken me a while to solve it, I am asking if anyone who is able to help me out? The input to FO is effectively a merged 'DITA XML' that features this node tree: <map> <concept> <title>Getting started</title> ... </concept> <Reference> <title>Android Market</title> ... </Reference> <concept> <title>Exploring and get support</title> </concept> </map> Thanks. Ray
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to trigger a new page, team wise | Thread | Re: [xsl] how to trigger a new page, Brandon Ibach |
Re: [xsl] Identifying unique attrib, Mark | Date | Re: [xsl] how to trigger a new page, Brandon Ibach |
Month |