[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to trigger a new page sequence, depending on

Subject: Re: how to trigger a new page sequence, depending on specific input conditions
From: team wise <dfanster@xxxxxxxxx>
Date: Wed, 5 Oct 2011 21:50:25 +0800
Re:  how to trigger a new page sequence
Hi Tony,
I have been much indebted to your insightful troubeshooting hints!
Sorry about this repeated interruption, but I wish to keep up with the
momentum we 've built up to solve the problem, ultimately.
As said last night by email offline, I was very close to solve the
problem, nevertheless the resulting PDF came with 'two last pages'
instead of a single one, which is not desirable. One of 'last page'
was generated with the desirable rendering effect. Note that
<xsl:message>21</xsl:message> was taken as a marker to verify that
effect, when running against the FO processor, AHF.

I herewith attach the named template 'insert.lastchapter' originating
from the code you suggested and the origional named 'insert.chapter'
template, respectively. 'insert.lastchapter' is intended to trigger a
new page sequence and the 'insert.chapter' is designed as normal page
sequence to flow content.

 <xsl:template name="insert.chapter">
    <xsl:param name="content"/>
     <xsl:variable name="position" select="position()" />
    <!-- Necessary to identify language here when combining different
language publications in a single publication -->
    <xsl:variable name="current-language"><xsl:call-template
name="get.current.language"/></xsl:variable>
<fo:page-sequence initial-page-number="auto" format="1">
      <xsl:attribute name="master-reference">chapter-master</xsl:attribute>
  <fo:flow flow-name="region.body">
   <xsl:choose>
            <xsl:when test="(contains($outputformat,
'UG_Booklet_Print') and position() != 'last()')">
              <xsl:for-each select="*[contains(@refclass, ' map/topicref ')]">
              <!-- Necessary to identify language here when combining
different languages in a single publication -->
              <xsl:variable name="topic-language"><xsl:call-template
name="get.current.language"/></xsl:variable>
              <xsl:choose>
                <xsl:when test="@only-for-language">
                  <xsl:choose>
                    <xsl:when test="contains(@only-for-language,
$topic-language)">
                      <xsl:apply-templates select="."/>
                    </xsl:when>
                    <xsl:otherwise/>
                  </xsl:choose>
                </xsl:when>
                <xsl:when test="contains(@outputclass, 'support') or
                                contains(@outputclass, 'accessories') or
                                contains(@outputclass, 'cover') or
                                contains(@outputclass, 'warranty') or
                                contains(@outputclass, 'legal_introtexts') or
                                contains(@id,
'GUID-DDB0F1C0-9B28-43FB-9B79-E9836299D2CE') or
                                contains(@id,
'GUID-1535CC3F-3B17-4D8B-9452-D2FDD988577A') or
                                contains(@outputclass, 'remove-from-output')"/>
                <!-- Below: Do not format the following topics in
itself, but their content,
                     they are containers for information to be formatted -->
                <xsl:when test="@id =
'GUID-8B987545-B343-4B40-B852-2CEFEBC4FE9E' or
                                @id =
'GUID-9B08C5DF-5C36-41C4-90B0-27B79F005469'">
                  <xsl:apply-templates
select="child::*[contains(@refclass, ' map/topicref ')]"/>
                </xsl:when>
                <xsl:otherwise>
                  <!-- Important: Do not wrap this apply-templates in
anything, otherwise PSMI will not work! -->
                  <xsl:apply-templates select="."/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:for-each>
             </xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
    </fo:flow>
    </fo:page-sequence>
  </xsl:template>

<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>
I apologize if this might be too lengthy or deep to delve into. Or it
is improper to take so much your or anyone's volunteered time.
In closing, I would grealty appreciate if you could advise how to
remove the 'last page' with the rendering effect that was not
desirable.
Best regards,
Ray

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.