You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Sebastian Rahtz <se...@computing-services.oxford.ac.uk> on 2000/11/07 13:55:43 UTC

Re: Which page am I on?

Ulrich Mayring writes:

 > can I find out in my XSL=>FO stylesheet which page I am currently on?

You can't. This is a fundamental `feature' of the whole DSSSL and XSL
FO model, dissociating page markup instructions from the final
rendered pages. Two XSLFO engines are not mandated to make the same
page breaks from the same input.

 > The problem is that in the fo:sequence-specification I can only select a
 > different fo:simple-page-master for the first page, and in the
 > fo:simple-page-master I cannot specify where the header
 > (fo:region-before) should start - I can only specify margins for the
 > fo:region-body. So the body of my letter is fine, it starts in the
 > middle on the first page and near the top on the following pages. But
 > the header, which is a fo:static-content, always starts in the same
 > place. So my idea was to make a template that finds out which page I am
 > on and creates a fo:block-container with an appropriate top margin.

But you can have different static content for page1 and for
pages2-n. so make the first-static-content be the block with the right
margin, and the second-static-content be different.  Maybe I am
confused, but it seems pretty straightforward

sebastian


Re: Which page am I on?

Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
On Tue, 07 Nov 2000, Ulrich Mayring wrote:
> Sebastian Rahtz wrote:
> > 
> > Ulrich Mayring writes:
> >  > The XSLFO spec says that a fo:static-content is repeated on each page it
> >  > is assigned to, but it doesn't say how to assign it to one specific
> >  > page/page-master.
> > 
> > something like
> >      <fo:simple-page-master
> >         master-name="foo"
> >         <fo:region-body .....
> > 
> >         <fo:region-before
> >                 region-name="xsl-region-before-left" >
> >       </fo:simple-page-master>
> > 
> >    <fo:static-content flow-name="xsl-region-after-right">...
> 
> If I put anything other than "xsl-before" in the flow-name attribute,
> the static content is not displayed at all. Probably I haven't
> understood your example, but there is nothing matching anything else in
> it either :)
> 
> Do you mean that the flow-name attribute of fo:static-content has to
> match the region-name attribute of a fo:region? Or does it have to match
> the master-name attribute of a fo:page-master?
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung

The "flow-name" of a flow (either fo:flow or fo:static-content), which must be
present, should match a target region's "region-name"; the "master-name" of an
fo:page-sequence maps to a simple-page-master or page-master-sequence. So there
are 2 sets of mappings.

When the page sequence is being processed, the next page-master is
pulled up, using "master-name" (possibly at one remove if conditionals are
being used).  This page-master will have 1-5 regions, all of which have
region-names, even if you didn't specify them (there are defaults). It is the
region-names in effect on the regions of the current page master that are used
to go back to the fo:page-sequence, and pull in content from flows.

You can have as many fo:static-content's in a page-sequence as you like, all
with unique "flow-name" attributes; just map one or more to regions in your
first-page page master, and others to regions in your subsequent-pages page
master. I am also proceeding on the premise that there can be more than one
fo:flow in a page sequence, but that's another issue.

You can do this right now with FOP if you update to, or checkout, the
'fop-0_14_0_regions' branch from CVS. This will also give you some examples
(some of which are a bit farfetched). Or you can wait a week or two until we
produce fop-0_15_0.

Hope this helps a bit.

Regards, Arved Sandstrom

-- 
Senior Developer
e-plicity.com (www.e-plicity.com)
Halifax, Nova Scotia
"B2B Wireless in Canada's Ocean Playground"

Re: Which page am I on?

Posted by Kelly Campbell <ca...@camk.net>.
I was trying this same type of operation yesterday and found that region-name
isn't supported in FOP yet. I began working on a patch for this, and can let
you know when I have it working. I think Karen Lease's changes this week 
might have something for this too. Not sure until after she's submitted them.

-Kelly

On Tue, Nov 07, 2000 at 02:59:24PM +0000, Ulrich Mayring wrote:
> Sebastian Rahtz wrote:
> > 
> > Ulrich Mayring writes:
> >  > The XSLFO spec says that a fo:static-content is repeated on each page it
> >  > is assigned to, but it doesn't say how to assign it to one specific
> >  > page/page-master.
> > 
> > something like
> >      <fo:simple-page-master
> >         master-name="foo"
> >         <fo:region-body .....
> > 
> >         <fo:region-before
> >                 region-name="xsl-region-before-left" >
> >       </fo:simple-page-master>
> > 
> >    <fo:static-content flow-name="xsl-region-after-right">...
> 
> If I put anything other than "xsl-before" in the flow-name attribute,
> the static content is not displayed at all. Probably I haven't
> understood your example, but there is nothing matching anything else in
> it either :)
> 
> Do you mean that the flow-name attribute of fo:static-content has to
> match the region-name attribute of a fo:region? Or does it have to match
> the master-name attribute of a fo:page-master?
> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung

-- 
Kelly A. Campbell                        Software Engineer
camk@channelpoint.com                    Channelpoint, Inc.
camk@camk.net  camk@merlotxml.org        Colorado Springs, Co.

Re: Which page am I on?

Posted by Ulrich Mayring <ul...@denic.de>.
Sebastian Rahtz wrote:
> 
> Ulrich Mayring writes:
>  > The XSLFO spec says that a fo:static-content is repeated on each page it
>  > is assigned to, but it doesn't say how to assign it to one specific
>  > page/page-master.
> 
> something like
>      <fo:simple-page-master
>         master-name="foo"
>         <fo:region-body .....
> 
>         <fo:region-before
>                 region-name="xsl-region-before-left" >
>       </fo:simple-page-master>
> 
>    <fo:static-content flow-name="xsl-region-after-right">...

If I put anything other than "xsl-before" in the flow-name attribute,
the static content is not displayed at all. Probably I haven't
understood your example, but there is nothing matching anything else in
it either :)

Do you mean that the flow-name attribute of fo:static-content has to
match the region-name attribute of a fo:region? Or does it have to match
the master-name attribute of a fo:page-master?

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Which page am I on?

Posted by Sebastian Rahtz <se...@computing-services.oxford.ac.uk>.
Ulrich Mayring writes:
 > The XSLFO spec says that a fo:static-content is repeated on each page it
 > is assigned to, but it doesn't say how to assign it to one specific
 > page/page-master.

something like
     <fo:simple-page-master
        master-name="foo"
        <fo:region-body .....

        <fo:region-before
		region-name="xsl-region-before-left" >
      </fo:simple-page-master>

   <fo:static-content flow-name="xsl-region-after-right">...


sebastian


Re: Which page am I on?

Posted by Ulrich Mayring <ul...@denic.de>.
Sebastian Rahtz wrote:
> 
> But you can have different static content for page1 and for
> pages2-n. so make the first-static-content be the block with the right
> margin, and the second-static-content be different.  Maybe I am
> confused, but it seems pretty straightforward

It probably is, I just don't know how to specify which static content to
use when. I have this:

<fo:page-sequence>

	<fo:sequence-specification>
		<fo:sequence-specifier-repeating
			page-master-first="firstpage"
			page-master-repeating="restpages"/>
	</fo:sequence-specification>

	<fo:static-content flow-name="xsl-before">
		<this-is-my-header/>
	</fo:static-content>
	...
	<fo:flow> ... </fo:flow>
	...
</fo:page-sequence>

The XSLFO spec says that a fo:static-content is repeated on each page it
is assigned to, but it doesn't say how to assign it to one specific
page/page-master.

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung