You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Phillip Rhodes <rh...@telerama.com> on 2002/09/03 04:08:32 UTC

2 flows to same page?

Hi.
I have an xml doc, "book" is the root, with many "chapter" child elements.

I am creating a new page for every chapter.  For each chapter, I want to 
put some text in the "xsl-region-start" and "xsl-region-body" for the page.

I tried putting two flows in the page sequence, but it errors out saying 
that one can not have 2 flows in the same page sequence.  I have two page 
sequences, each with the different flow, but this does not appear to be 
working.

Here is my stylesheet.  Thanks for any help or pointers.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <xsl:template match="/">
         <xsl:apply-templates/>
    </xsl:template>

   <xsl:template match="book">
     <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
       <fo:layout-master-set>
                 <fo:simple-page-master  master-name="US-Letter"
                      page-height="11in"   page-width="8.5in"
                      margin-top="0.5in"   margin-bottom="0.5in"
                      margin-left="0.5in"  margin-right="0.5in">
                         <fo:region-start  extent="2.0in"/>
                         <fo:region-body/>
                 </fo:simple-page-master>
       </fo:layout-master-set>
         <xsl:apply-templates/>
         </fo:root>
   </xsl:template>

    <xsl:template match="chapter">
       <fo:page-sequence master-reference="US-Letter">
          <fo:flow flow-name="xsl-region-start">
           <fo:block><xsl:value-of select="@chapterTitle"/></fo:block>
          </fo:flow>

                 <!--
                         Can't do this, that is, put two flows into one 
page sequence.
          <fo:flow flow-name="xsl-region-body">
           <fo:block><xsl:value-of select="@chapterText"/></fo:block>
          </fo:flow>

                 -->
       </fo:page-sequence>
       <fo:page-sequence master-reference="US-Letter">
          <fo:flow flow-name="xsl-region-body">
           <fo:block><xsl:value-of select="@chapterText"/></fo:block>
          </fo:flow>
       </fo:page-sequence>
    </xsl:template>

</xsl:stylesheet>


Re: 2 flows to same page?

Posted by Rodolphe VAGNER <ro...@eurodoc-sofilog.com>.
I never used it but the fo:marker and fo:retrieve-marker seem to do what you
want.

6.11.3 fo:marker
6.11.4 fo:retrieve-marker

Hope that help


----- Original Message -----
From: "Phillip Rhodes" <rh...@telerama.com>
To: <fo...@xml.apache.org>
Sent: Tuesday, September 03, 2002 6:28 AM
Subject: RE: 2 flows to same page?


> I understand why one would think that I am confused between the
> region-start and region-before.
>
> I understand the difference between the two, and I definitely want to put
> my text into region-start, I have to do this because the mock-up's of the
> documents I am trying to recreate have text in the left margin of the
document.
>
> But the difference of the regions aside, I don't think the solution would
> be different due to the region I want to put text into.   What I mean is
it
> does not matter if it's region-start or region-before, if it will work for
> one, it will work for the other.
>
> I like the idea of the static-content, but only have seen it used for page
> numbers, can it be set for the title of each chapter, not "Chapter 1" but
> rather, "Chapter 1, Introduction" and "Chapter 2, The meeting", etc...
>
> So my question still is, how can I put content into two different regions
> of the same page?
>
> At 12:49 PM 9/3/2002 +1000, you wrote:
> >Phillip,
> >
> >You weren't too clear about what was actually happening, I am wondering
if
> >you have region-start & region-before confused. For ordinary English
text,
> >your region-start would be a 2cm left margin & is probably not wide
enough
> >for much text. Use region-before for page headers.
> >
> >You may want to use static-content instead of a flow as well, this you
can
> >place in the same page-sequence (& it will repeat if the body exceeds one
> >page).
> >
> >Regards,
> >Roland
> >
> > > I am creating a new page for every chapter.  For each
> > > chapter, I want to
> > > put some text in the "xsl-region-start" and "xsl-region-body"
> > > for the page.
> > >
> > > I tried putting two flows in the page sequence, but it errors
> > > out saying
> > > that one can not have 2 flows in the same page sequence.  I
> > > have two page
> > > sequences, each with the different flow, but this does not
> > > appear to be
> > > working.
> > >
> > > Here is my stylesheet.  Thanks for any help or pointers.
> > >
> > > <?xml version="1.0"?>
> > > <xsl:stylesheet version="1.0"
> > >    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > >    xmlns:fo="http://www.w3.org/1999/XSL/Format">
> > >
> > >     <xsl:template match="/">
> > >          <xsl:apply-templates/>
> > >     </xsl:template>
> > >
> > >    <xsl:template match="book">
> > >      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> > >        <fo:layout-master-set>
> > >                  <fo:simple-page-master  master-name="US-Letter"
> > >                       page-height="11in"   page-width="8.5in"
> > >                       margin-top="0.5in"   margin-bottom="0.5in"
> > >                       margin-left="0.5in"  margin-right="0.5in">
> > >                          <fo:region-start  extent="2.0in"/>
> > >                          <fo:region-body/>
> > >                  </fo:simple-page-master>
> > >        </fo:layout-master-set>
> > >          <xsl:apply-templates/>
> > >          </fo:root>
> > >    </xsl:template>
> > >
> > >     <xsl:template match="chapter">
> > >        <fo:page-sequence master-reference="US-Letter">
> > >           <fo:flow flow-name="xsl-region-start">
> > >            <fo:block><xsl:value-of select="@chapterTitle"/></fo:block>
> > >           </fo:flow>
> > >
> > >                  <!--
> > >                          Can't do this, that is, put two
> > > flows into one
> > > page sequence.
> > >           <fo:flow flow-name="xsl-region-body">
> > >            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
> > >           </fo:flow>
> > >
> > >                  -->
> > >        </fo:page-sequence>
> > >        <fo:page-sequence master-reference="US-Letter">
> > >           <fo:flow flow-name="xsl-region-body">
> > >            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
> > >           </fo:flow>
> > >        </fo:page-sequence>
> > >     </xsl:template>
> > >
> > > </xsl:stylesheet>
>


RE: 2 flows to same page?

Posted by Roland Neilands <rn...@pulsemining.com.au>.
Phillip,

> I understand the difference between the two, and I definitely 
> want to put 
> my text into region-start, I have to do this because the 
> mock-up's of the 
> documents I am trying to recreate have text in the left 
> margin of the document.
Just making sure.

> I like the idea of the static-content, but only have seen it 
> used for page 
> numbers, can it be set for the title of each chapter, not 
> "Chapter 1" but 
> rather, "Chapter 1, Introduction" and "Chapter 2, The meeting", etc...
> So my question still is, how can I put content into two 
> different regions 
> of the same page?
Look at:
docs\examples\pagination\allregions.fo

Regards,
Roland

RE: 2 flows to same page?

Posted by Phillip Rhodes <rh...@telerama.com>.
I understand why one would think that I am confused between the 
region-start and region-before.

I understand the difference between the two, and I definitely want to put 
my text into region-start, I have to do this because the mock-up's of the 
documents I am trying to recreate have text in the left margin of the document.

But the difference of the regions aside, I don't think the solution would 
be different due to the region I want to put text into.   What I mean is it 
does not matter if it's region-start or region-before, if it will work for 
one, it will work for the other.

I like the idea of the static-content, but only have seen it used for page 
numbers, can it be set for the title of each chapter, not "Chapter 1" but 
rather, "Chapter 1, Introduction" and "Chapter 2, The meeting", etc...

So my question still is, how can I put content into two different regions 
of the same page?

At 12:49 PM 9/3/2002 +1000, you wrote:
>Phillip,
>
>You weren't too clear about what was actually happening, I am wondering if
>you have region-start & region-before confused. For ordinary English text,
>your region-start would be a 2cm left margin & is probably not wide enough
>for much text. Use region-before for page headers.
>
>You may want to use static-content instead of a flow as well, this you can
>place in the same page-sequence (& it will repeat if the body exceeds one
>page).
>
>Regards,
>Roland
>
> > I am creating a new page for every chapter.  For each
> > chapter, I want to
> > put some text in the "xsl-region-start" and "xsl-region-body"
> > for the page.
> >
> > I tried putting two flows in the page sequence, but it errors
> > out saying
> > that one can not have 2 flows in the same page sequence.  I
> > have two page
> > sequences, each with the different flow, but this does not
> > appear to be
> > working.
> >
> > Here is my stylesheet.  Thanks for any help or pointers.
> >
> > <?xml version="1.0"?>
> > <xsl:stylesheet version="1.0"
> >    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >    xmlns:fo="http://www.w3.org/1999/XSL/Format">
> >
> >     <xsl:template match="/">
> >          <xsl:apply-templates/>
> >     </xsl:template>
> >
> >    <xsl:template match="book">
> >      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> >        <fo:layout-master-set>
> >                  <fo:simple-page-master  master-name="US-Letter"
> >                       page-height="11in"   page-width="8.5in"
> >                       margin-top="0.5in"   margin-bottom="0.5in"
> >                       margin-left="0.5in"  margin-right="0.5in">
> >                          <fo:region-start  extent="2.0in"/>
> >                          <fo:region-body/>
> >                  </fo:simple-page-master>
> >        </fo:layout-master-set>
> >          <xsl:apply-templates/>
> >          </fo:root>
> >    </xsl:template>
> >
> >     <xsl:template match="chapter">
> >        <fo:page-sequence master-reference="US-Letter">
> >           <fo:flow flow-name="xsl-region-start">
> >            <fo:block><xsl:value-of select="@chapterTitle"/></fo:block>
> >           </fo:flow>
> >
> >                  <!--
> >                          Can't do this, that is, put two
> > flows into one
> > page sequence.
> >           <fo:flow flow-name="xsl-region-body">
> >            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
> >           </fo:flow>
> >
> >                  -->
> >        </fo:page-sequence>
> >        <fo:page-sequence master-reference="US-Letter">
> >           <fo:flow flow-name="xsl-region-body">
> >            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
> >           </fo:flow>
> >        </fo:page-sequence>
> >     </xsl:template>
> >
> > </xsl:stylesheet>


RE: 2 flows to same page?

Posted by Roland Neilands <rn...@pulsemining.com.au>.
Phillip,

You weren't too clear about what was actually happening, I am wondering if
you have region-start & region-before confused. For ordinary English text,
your region-start would be a 2cm left margin & is probably not wide enough
for much text. Use region-before for page headers.

You may want to use static-content instead of a flow as well, this you can
place in the same page-sequence (& it will repeat if the body exceeds one
page).

Regards,
Roland

> I am creating a new page for every chapter.  For each
> chapter, I want to
> put some text in the "xsl-region-start" and "xsl-region-body"
> for the page.
>
> I tried putting two flows in the page sequence, but it errors
> out saying
> that one can not have 2 flows in the same page sequence.  I
> have two page
> sequences, each with the different flow, but this does not
> appear to be
> working.
>
> Here is my stylesheet.  Thanks for any help or pointers.
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:fo="http://www.w3.org/1999/XSL/Format">
>
>     <xsl:template match="/">
>          <xsl:apply-templates/>
>     </xsl:template>
>
>    <xsl:template match="book">
>      <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>        <fo:layout-master-set>
>                  <fo:simple-page-master  master-name="US-Letter"
>                       page-height="11in"   page-width="8.5in"
>                       margin-top="0.5in"   margin-bottom="0.5in"
>                       margin-left="0.5in"  margin-right="0.5in">
>                          <fo:region-start  extent="2.0in"/>
>                          <fo:region-body/>
>                  </fo:simple-page-master>
>        </fo:layout-master-set>
>          <xsl:apply-templates/>
>          </fo:root>
>    </xsl:template>
>
>     <xsl:template match="chapter">
>        <fo:page-sequence master-reference="US-Letter">
>           <fo:flow flow-name="xsl-region-start">
>            <fo:block><xsl:value-of select="@chapterTitle"/></fo:block>
>           </fo:flow>
>
>                  <!--
>                          Can't do this, that is, put two
> flows into one
> page sequence.
>           <fo:flow flow-name="xsl-region-body">
>            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
>           </fo:flow>
>
>                  -->
>        </fo:page-sequence>
>        <fo:page-sequence master-reference="US-Letter">
>           <fo:flow flow-name="xsl-region-body">
>            <fo:block><xsl:value-of select="@chapterText"/></fo:block>
>           </fo:flow>
>        </fo:page-sequence>
>     </xsl:template>
>
> </xsl:stylesheet>