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

Re: XSL-FO Question - fo:retrieve-marker

Subject: Re: XSL-FO Question - fo:retrieve-marker
From: Jeff Sese <jsese@xxxxxxxxxxxx>
Date: Wed, 07 Feb 2007 14:40:47 +0800
Re:  XSL-FO Question - fo:retrieve-marker
Thanks for the tip, i tried it but it still doen't give me my desired output.

I change your sample code a bit, i placed the bottom marker inside a fo:block element to make it valid.

here's a sample fo i'm testing.

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple" page-height="11.69in" page-width="8.27in" margin-left="1in" margin-right="1in">
<fo:region-body margin-top="1in" margin-bottom="1in"/>
<fo:region-before extent="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simple">
<fo:static-content flow-name="xsl-region-before">
<fo:block border-bottom-style="solid" border-bottom-width="1pt" background-color="gray">
<fo:retrieve-marker retrieve-class-name="heading-start" retrieve-boundary="page-sequence" retrieve-position="first-including-carryover"/>
<fo:retrieve-marker retrieve-class-name="heading-end" retrieve-boundary="page-sequence" retrieve-position="last-starting-within-page"/>
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block>
<fo:block>
<fo:marker marker-class-name="heading-start">first heading</fo:marker>
<fo:marker marker-class-name="heading-end"></fo:marker>
</fo:block>
<fo:block text-align="center" font-size="14pt">First Heading</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block break-after="page">Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>
<fo:marker marker-class-name="heading-end">- first heading</fo:marker>
</fo:block>
</fo:block>
<fo:block>
<fo:block>
<fo:marker marker-class-name="heading-start">second heading</fo:marker>
<fo:marker marker-class-name="heading-end"></fo:marker>
</fo:block>
<fo:block text-align="center" font-size="14pt">Second Heading</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block break-after="page">Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>
<fo:marker marker-class-name="heading-end">- second heading</fo:marker>
</fo:block>
</fo:block>
<fo:block>
<fo:block>
<fo:marker marker-class-name="heading-start">third heading</fo:marker>
<fo:marker marker-class-name="heading-end"></fo:marker>
</fo:block>
<fo:block text-align="center" font-size="14pt">Third Heading</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block break-after="page">Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block break-after="page">Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>
<fo:marker marker-class-name="heading-end">- third heading</fo:marker>
</fo:block>
</fo:block>
<fo:block>
<fo:block>
<fo:marker marker-class-name="heading-start">fourth heading</fo:marker>
<fo:marker marker-class-name="heading-end"></fo:marker>
</fo:block>
<fo:block text-align="center" font-size="14pt">Fourth Heading</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>Some text</fo:block>
<fo:block>
<fo:marker marker-class-name="heading-end">- fourth heading</fo:marker>
</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>


a the headers i got where:
page 1: first heading
page 2: second heading
page 3: third heading
page 4: third heading
page 5: fourth heading - fourth heading

but what i need is:
page 1: first heading
page 2: first heading - second heading
page 3: second heading - third heading
page 4: third heading
page 5: third heading - fourth heading

I tried playing with the placement of the markers and the still can't get the right result. Anymore suggestions?

*Jeff Sese*

J.Pietschmann wrote:
Jeff Sese wrote:
then i need to have headers like these:
page 1: title 1 - title 2
page 2: title 2 - title 3
page 3: title 3
page 4: title 3 - title 4

but so far what i get is this:

page 1: title 1 - title 2
page 2: title 2 - title 3
page 3: title 3 - title 3
page 4: title 3 - title 4

You can try to define an empty heading-end marker after the heading start, and the real heading-end right before the next heading start. Be careful to have a proper heading end at the end of the document.

 <xsl:template match="article">
    <fo:block>
       <fo:marker marker-class-name="heading-start"><xsl:value-of
 select="head"/></fo:marker>
       <fo:marker marker-class-name="heading-end" />
       <xsl:apply-templates/>
       <fo:marker marker-class-name="heading-end"><xsl:value-of
 select="concat(' - ', head)"/></fo:marker>
    </fo:block>
 </xsl:template>

Beware: untested.

J.Pietschmann

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.