RE: [xsl] XSL-FO Question - fo:retrieve-marker

Subject: RE: [xsl] XSL-FO Question - fo:retrieve-marker
From: "McDonald, Shaun" <Shaun.McDonald@xxxxxxxxxxx>
Date: Thu, 8 Feb 2007 09:39:31 -0500
"The retrieve-position="first-including-carryover" attribute picks up
the
first matching marker on the current page, or from a section carried
over from a previous page IF THERE IS NO MARKER ON THE CURRENT PAGE. The
retrieve-boundary="page-sequence" attribute sets the boundary for
selecting a previous marker as the current page-sequence, as opposed to
the whole document. That PREVENTS CARRYOVER from the previous chapter."

Also, from a previous post of mine:

"McDonald, Shaun wrote:

    "...pagination is done after the transformation, in an independent
step.
    Therefore there is no way to get hold of the number of prescriptions
    laid out on a certain page in the transformation.  The layout
process
    itself lacks higher level functionality like counting, so no easy
    solution here either."

    Is this still true?  Is there no way to access nodes by page (for
    instance, from a footer template) without forcing page breaks?

That's correct. Some FO processors have extension functions which
might allow [you] to do certain things.
J.Pietschmann"

I'm not an expert like these guys, but, in my experience, I was never
able to retrieve two different markers for the same page conventionally.

I had success by wrapping each marker in a filter, then wrapping each
marker's content in a block-container.  In my case, I needed a default
footer with variable content, and an overlay footer based on
specifically matched results.  Both markers were then absolutely
positioned at the same coordinates.  The overlay was given a white fill
color.

That's the how I got two markers output to the same page.  If you search
the list for "Shaun.McDonald", I believe you'll find the example.  It
should be last on the page.  Sorry that I don't have time to apply it to
your situation, but I hope this gives you an idea or two for a solution.

>Date: Wed, 07 Feb 2007 14:40:47 +0800
>To:  xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>From: Jeff Sese <jsese@xxxxxxxxxxxx>
>Subject: Re: [xsl] XSL-FO Question - fo:retrieve-marker
>Message-ID: <45C9746F.5040502@xxxxxxxxxxxx>
>
>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*

Current Thread