xsl-list
[Top] [All Lists]

Re: [xsl] how to remove the duplicate back page

2011-10-07 07:38:37
Hi Tony,
Thank you for your very thoughtful comments.
Does that mean that the problem is solved?
--> unfortunately, the problem has not been solved properly, as said,
there is duplicate of the back page in the final PDF. triggering a new
page sequence was solved, thanks largely to the code you comitted. To
avoid confusion, I have changed the subject line of this email.
I'm still not sure that I get it, but do you need two fo:page-sequence,
one for everything before the element with 'outputclass="pagebreak"' and
one for the element itself?
--> Sorry if I have mixed the problem and the solutions in my post. My
problem was initially to seek a method by which the element having
'outputclass="pagebreak"' , which should be appearing on the 'Back
Page' in result PDF, must force a new page, because previously,  all
elements were populated within a single page sequence, hence leading
to the fact that in the final PDF, all Heading and sections cannot be
divided, there is no Heading starting a new page. I then figured out I
need to trigger a new FO page sequence for that specific element so as
to force a new page, this has been solved perfectly, thanks to your
code.
However, the side effect, as it now turns out, there is two 'back
page' in the resulting.
My problem has now become how to remove one of them. Once again,
'outputclass="pagebreak" can be attached to as many elements as
needed, while the element that shall be part of the 'Back Page' in the
final PDF must have it. Please refer to the following when you desire
to examine input.
 ---------------------------------------
 <Map>
 <concept id=GUID-1234 outputclass="pagebreak">
  <title> Overview</title>
  <conbody/>
 </concept>
 <concept id=GUID-5678>
   <title>Basics</title>
  <conbody/>
 </concept>
 <concept id=GUID-1342 outputclass="pagebreak">-------------> This
belongs to the 'Back Page' on a new page.
 <title>Explore and get support</title>
 <conbody/>
 </concept>
 </map>
 ---------------------------------------
I apologize if this post has been sloppy and poorly written in the
past couple of days.
Hope this clarifies.
Ray
2011/10/7 Tony Graham <tgraham(_at_)mentea(_dot_)net>:
On Thu, October 6, 2011 4:06 pm, team wise wrote:
...
<xsl:template name="insert.lastchapter">
  <xsl:param name="content"/>

What does $content do?  You don't seem to be using it.
--->Absolutely right. refactored or bought from ‘insert.chapter’
named template , it is not used here.

Then you can omit it without ill-effect: you can use
xsl:call-template/xsl:with-param without there being a corresponding
xsl:template/xsl:param.  If you don't have a xsl:param for a parameter
(and also don't try to use it without having a xsl:param) the XSLT
processor won't complain.

...
It's also not clear to me whether there's anything that comes after the
last element that has 'outputclass="pagebreak"'.
--->Let me clarify.  It  could be the case that after the last element
that has 'outputclass="pagebreak"', there is another element featuring
that attribute and value. Content featuring  attribute’ outputclass
=’pagebreak’” can be either last node or any node within a node tree

Okay.

(
in practice, a merged DITA XML is input ) in other words, it is
randomly attached  as authors work with DITA XML and attach that
attribute value at will. On the other hand, it is desirable that the
last content must have 'outputclass="pagebreak"'.

You could add code so markup after the last 'outputclass="pagebreak"'
could be handled.  It seems to me that right now it would be silently
dropped if it existed.

...
       <xsl:apply-templates select=". |
preceding-sibling::*[count(preceding-sibling::*[contains(@outputclass,
'pagebreak')]) = $position - 1]" />
    <fo:flow flow-name="region.body">

I would have thought that the xsl:apply-templates would have gone here,
not before the fo:flow.
---->I think you are right,. the entire construct works just fine,
when it comes to trigger a new page sequence to enable the last page
effect.

Does that mean that the problem is solved?

Is it the case that all you really need is 'break-after="page"' or
'break-after="odd-page"' [1] on the fo:block for the element that has
'outputclass="pagebreak"'?
---> I think  is 'break-after="page"' on the fo:block for the element that
has
 'outputclass="pagebreak"'  is exactly what I am trying to accomplish.
 The repeated last page in the final PDF is the side effect arising
from the newly introduced named template that enables the desired last
page effect.
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

I don't understand "prevent <fo:flow flow-name"region.body"> from
flowing
in the last node".
---> To the best of my knowledge, I see that <fo:flow> allows to flow
in content that is made up of all topic DITA XML of various types.
Instead of excluding the last topic XML "Explore and get more support"
or the last node, it pulled in all topics.

I'm still not sure that I get it, but do you need two fo:page-sequence,
one for everything before the element with 'outputclass="pagebreak"' and
one for the element itself?

<xsl:template name="insert.lastchapter">
     <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"
           master-reference="chapter-master"
           color="rgb-icc(#CMYK,0%,0%,0%,80%)">>
        </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>
         <fo:page-sequence initial-page-number="auto" format="1"
           master-reference="chapter-master"
         axf:background-color="{$background_colour}"
          color="rgb-icc(#CMYK,0%,0%,0%,0%)">
      <xsl:apply-templates />
    </fo:page-sequence>
 </xsl:for-each>
  </xsl:if>
</xsl:template>


Regards,


Tony Graham                                   tgraham(_at_)mentea(_dot_)net
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
   XML, XSL FO and XSLT consulting, training and programming


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Keep an Exacting Eye for Detail

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [xsl] how to remove the duplicate back page, team wise <=