[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] how to trigger a new page sequence, depending on specific input conditions


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 23:06:39 +0800

Hi Tony and Brfandon,
In response to both of your comments, please read my reply as described
below.

I hope that all thread of my past emails are collectively exhaustive.

Thank you very much indeed!
>> 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"/>
>
> What does $content do?  You don't seem to be using it.
--->o Absolutely right. refactored or bought from binsert.chapterb
named template , it is not used here.
>
>>       <xsl:if test="$outputformat = 'UG_Booklet_Print'">
>>         <xsl:for-each select="*[contains(@outputclass, 'pagebreak')]">
>
> It's still not clear to me how much is being repeated that isn't wanted,
> but this will process only the last element that has
> 'outputclass="pagebreak"' [2]:
--->Let me clarify.  There is no repeated element or content that is
not wanted.  Your piece of code works just fine.
>   <xsl:for-each select="*[contains(@outputclass, 'pagebreak')][last()]">
>
> 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  attributeb outputclass
=bpagebreakbb can be either last node or any node within a node tree (
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"'.

>>          <xsl:variable name="position" select="position()" />
>>           <fo:page-sequence initial-page-number="auto" format="1">
>>             <xsl:attribute
>> name="master-reference">chapter-master</xsl:attribute>
>
> That could have been a literal attribute.-->
>
> ...
>>        <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.
>>      </fo:flow>
>>      </fo:page-sequence>
>>   </xsl:for-each>
>>    </xsl:if>
>> </xsl:template>
>
> 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.
>
> Regards,
>
>
> Tony Graham                                   tgraham@xxxxxxxxxx
> Consultant                                 http://www.mentea.net
> Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
>  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
>    XML, XSL FO and XSLT consulting, training and programming
>
> [1] http://www.w3.org/TR/xsl11/#break-after
> [2] And, if you keep the current contents of the xsl:for-each,
>    maybe some of its siblings as well.
>
>



--
Keep an Exacting Eye for Detail


Current Thread
Keywords