Ken Holman
> I'm using a retrieve-marker in an xsl-region-before in the hope of
> showing a 'section X continued' label when page breaks occur within
> certain blocks or block-containers. Since there's no such thing as a
> "first-within-carryover" value for the retrieve-position attribute,
> is there any way to do this without sometimes grabbing the first
> marker in the current page?
It sounds like you are not "undoing" the marker at the beginning
and end of your sensitive blocks or containers. > As it is, I'm using "first-including-carryover" so if the page break
> occurs between blocks, there is no carryover and the first marker in
> the current page displays. As it should, per the spec, but not per my
> intent. Does anyone know of a workaround? Yes, but doing it for a header is not as straightforward as doing
it for a footer. Here is an example where I'm putting "continued..." at the bottom of
a page in a footer: <block>
<marker marker-class-name="section">Section One - 1.</marker>
<marker marker-class-name="continued">(continued...)</marker>
<block>1. Section One</block>
<block space-before="1em">This is a test</block>
...
<block space-before="1em">This is a test</block>
</block>
<block>
<marker marker-class-name="continued"></marker>
</block> <block space-before="2em">
<marker marker-class-name="section">Section Two - 2.</marker>
<marker marker-class-name="continued">(continued...)</marker>
<block>2. Section Two</block>
<block space-before="1em">This is a test</block>
...
<block space-before="1em">This is a test</block>
</block>
<block>
<marker marker-class-name="continued"></marker>
</block>
In fact this undoing of the marker would be important for you
regardless, because what if the block you have ends right at the
very bottom of the page? There is always room for an empty block
at the bottom of the page. If your table ends right at the bottom,
then you don't want the marker defined for the bottom of that page
or the top of the next.
BTW, the kind of retrieval you need for a footer is the last within
the page:
<static-content flow-name="frame-after">
<block text-align="end" font-style="italic" font-size="12pt">
<retrieve-marker retrieve-class-name="continued"
retrieve-position="last-starting-within-page"/>
</block>
</static-content>
But what you need is a marker retrieved into the header and that is
more subtle. First, you have to be prepared for a block starting
at the very top of the page (where you do not want it to show),
which means you have to both make sure it is not defined (that is,
defined as empty) as the first block on the page, and then define
it as part of the block. *Then* you have to undefine it at the end
again so that the definition isn't lying around to be retrieved on
the next page.
Here is code that works for "...continued" in the header: <static-content flow-name="frame-before">
<block text-align="end" font-style="italic" font-size="12pt">
<retrieve-marker retrieve-class-name="continued"
retrieve-position="first-including-carryover"/>
</block>
</static-content>
...
<block keep-with-next="always">
<marker marker-class-name="continued"></marker>
</block>
<block>
<marker marker-class-name="section">Section One - 1.</marker>
<marker marker-class-name="continued">(...continued)</marker>
<block>1. Section One</block>
<block space-before="1em">This is a test</block>
<block space-before="1em">This is a test</block>
...
<block space-before="1em">This is a test</block>
<block space-before="1em">This is a test</block>
</block>
<block keep-with-previous="always">
<marker marker-class-name="continued"></marker>
</block> Note how my use of keeps will ensure the empty definition is on the
same page and before the non-empty definition, thus ensuring the
first one on the page is the empty definition.
Since you are pulling into the header, your use of "first including
carryover" is appropriate since the marker would have been undone
if the table ended on the page before. |