conditional-page-master-reference and last()

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

conditional-page-master-reference and last()

Louis.Masters
I have a layout such that:

<fo:page-sequence-master master-name="mainSequence">
      <fo:repeatable-page-master-alternatives>
            <fo:conditional-page-master-reference page-position="first"
master-reference="firstPage"/>
            <fo:conditional-page-master-reference page-position="rest"
master-reference="otherPage"/>
      </fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>

I need to put a footer on each page that either indicates that it is or is
not the last page of the entire printed document.  Usually, when I have a
repeatable-page-master-reference, I just use code like:

<xsl:choose>
      <xsl:when test="position() = last()">
            END OF ORDER
      </xsl:when>
      <xsl:otherwise>
            CONTINUED ON FOLLOWING PAGE
      </xsl:otherwise>
</xsl:choose>

However, last() seems to be giving me my position within the reference.
For example, say I have two pages, each one is a different layout using
different static contents.  On both pages, last() is equal to position().

What am I doing wrong?

Thanks,
Lou




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: conditional-page-master-reference and last()

JBryant
Hi, Lou,

last() is working correctly (getting the last node in a node set), but
that's not much comfort.

My only thought on this one is to apply last() to the union of the two
page sets. Unfortunately, I don't have time to generate a test case and
fiddle with it. Maybe you can use the idea, though.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: conditional-page-master-reference and last()

Roland Neilands
In reply to this post by Louis.Masters
Louis,

I beleive it is not implemented in FOP.
Use fo:marker instead for this instead, there are plenty of examples in
the list archive and your fop/examples directory, sorry don't have time
to dig them up right now.

Cheers,
Roland

[hidden email] wrote:

> I have a layout such that:
>
> <fo:page-sequence-master master-name="mainSequence">
>       <fo:repeatable-page-master-alternatives>
>             <fo:conditional-page-master-reference page-position="first"
> master-reference="firstPage"/>
>             <fo:conditional-page-master-reference page-position="rest"
> master-reference="otherPage"/>
>       </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
>
> I need to put a footer on each page that either indicates that it is or is
> not the last page of the entire printed document.  Usually, when I have a
> repeatable-page-master-reference, I just use code like:
>
> <xsl:choose>
>       <xsl:when test="position() = last()">
>             END OF ORDER
>       </xsl:when>
>       <xsl:otherwise>
>             CONTINUED ON FOLLOWING PAGE
>       </xsl:otherwise>
> </xsl:choose>
>
> However, last() seems to be giving me my position within the reference.
> For example, say I have two pages, each one is a different layout using
> different static contents.  On both pages, last() is equal to position().
>
> What am I doing wrong?
>
> Thanks,
> Lou
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: conditional-page-master-reference and last()

Louis.Masters
In reply to this post by Louis.Masters

Jay:

The union of the two page sets sounds interesting - if you have an example,
could you please post it.  I would like to take a look at implemting it.

Right now, I'm trying to convince the requestor to accept that only the
last page will have a message (something like "end of pages") and then
simply putting either a text block or a footnote at the end of the flow.
If they don't accept this, I'll be posting again for more help.

Thanks,
Lou



                                                                                                                                                   
                      [hidden email]                                                                                                            
                      m                        To:      [hidden email]                                                          
                                               cc:                                                                                                
                      05/16/2005 18:02         Subject: Re: conditional-page-master-reference and last()                                          
                      Please respond                                                                                                              
                      to fop-users                                                                                                                
                                                                                                                                                   
                                                                                                                                                   



Hi, Lou,

last() is working correctly (getting the last node in a node set), but
that's not much comfort.

My only thought on this one is to apply last() to the union of the two
page sets. Unfortunately, I don't have time to generate a test case and
fiddle with it. Maybe you can use the idea, though.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: conditional-page-master-reference and last()

Louis.Masters
In reply to this post by Louis.Masters

Roland:

I tried this with no luck.  My doc layout is a bit "bizarre" which results
in some pages never getting the marker data.  This, in combination with a
retrieve-position of "last-ending-within-page" and a retrieve-boundary of
"document," throws a nasty java exception.  I want to go back and see if I
can get this working, but my current time restrictions will not permit it.

Thanks for the reply,
Lou




                                                                                                                                                     
                      Roland Neilands                                                                                                                
                      <rneilands@pulsemin         To:      [hidden email]                                                          
                      ing.com.au>                 cc:                                                                                                
                                                  Subject: Re: conditional-page-master-reference and last()                                          
                      05/16/2005 19:01                                                                                                                
                      Please respond to                                                                                                              
                      fop-users                                                                                                                      
                                                                                                                                                     
                                                                                                                                                     



Louis,

I beleive it is not implemented in FOP.
Use fo:marker instead for this instead, there are plenty of examples in
the list archive and your fop/examples directory, sorry don't have time
to dig them up right now.

Cheers,
Roland

[hidden email] wrote:

> I have a layout such that:
>
> <fo:page-sequence-master master-name="mainSequence">
>       <fo:repeatable-page-master-alternatives>
>             <fo:conditional-page-master-reference page-position="first"
> master-reference="firstPage"/>
>             <fo:conditional-page-master-reference page-position="rest"
> master-reference="otherPage"/>
>       </fo:repeatable-page-master-alternatives>
> </fo:page-sequence-master>
>
> I need to put a footer on each page that either indicates that it is or
is

> not the last page of the entire printed document.  Usually, when I have a
> repeatable-page-master-reference, I just use code like:
>
> <xsl:choose>
>       <xsl:when test="position() = last()">
>             END OF ORDER
>       </xsl:when>
>       <xsl:otherwise>
>             CONTINUED ON FOLLOWING PAGE
>       </xsl:otherwise>
> </xsl:choose>
>
> However, last() seems to be giving me my position within the reference.
> For example, say I have two pages, each one is a different layout using
> different static contents.  On both pages, last() is equal to position().
>
> What am I doing wrong?
>
> Thanks,
> Lou
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: conditional-page-master-reference and last()

JBryant
In reply to this post by Louis.Masters
Hi, Lou,

I got nowhere with my idea, unfortunately, because there's no element that
wraps the page sequences that call on the different masters. However, I
had another thought:

You must have a page-sequence that references the mainSequence master.
Have you tried adding a special at the end of that?

<fo:page-sequence master-reference="mainSequence">
  <fo:flow flow-name="mainFlow"
    <!-- content goes here -->
    <fo:block line-height="0" id="end"/>
  </fo:flow>
</fo:page>

Then you can get the last page number with <fo:page-number-citation
ref-id="end"/>

I did this in the stylesheet I wrote for the XSLT spec a while back, but I
wasn't using conditional masters. You can find that project at
http://www.bryantcs.com/fop if you want to look at the stylesheet.

As you can tell, I'm pretty much just "thinking out loud", so any given
idea I have may not work out well.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)





[hidden email]
05/17/2005 06:31 AM
Please respond to
[hidden email]


To
[hidden email]
cc

Subject
Re: conditional-page-master-reference and last()







Jay:

The union of the two page sets sounds interesting - if you have an
example,
could you please post it.  I would like to take a look at implemting it.

Right now, I'm trying to convince the requestor to accept that only the
last page will have a message (something like "end of pages") and then
simply putting either a text block or a footnote at the end of the flow.
If they don't accept this, I'll be posting again for more help.

Thanks,
Lou



 
                      [hidden email]    
                      m                        To:
[hidden email]  
                                               cc:    
                      05/16/2005 18:02         Subject: Re:
conditional-page-master-reference and last()  
                      Please respond  
                      to fop-users  
 
 



Hi, Lou,

last() is working correctly (getting the last node in a node set), but
that's not much comfort.

My only thought on this one is to apply last() to the union of the two
page sets. Unfortunately, I don't have time to generate a test case and
fiddle with it. Maybe you can use the idea, though.

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]







---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]