xsl-list
[Top] [All Lists]

Re: How to create document with different headers but same body (xslfo/xslt)

2005-02-07 07:07:27
Hi Omprakash.V
I'm not sure I follow how your example helps me.  I
see you define one simple-page-master and one
page-sequence for the firstpage, however what about
the rest of the document.

This is as far as I got when I suddenly realized that
it won't work because I'm having to redefine the
fo:flow for the two page-sequences, which means my for
loop counter will start at the beginning again,
instead of continuing from page 1...  (I've taken out
my margin settings etc to make the code more eligible)

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";>
                
<!-- Global document pages and sequencing -->
<fo:layout-master-set>

<!-- Define first page layout -->
<fo:simple-page-master master-name="first">
<fo:region-before region-name="first_before"
extent="10cm" />
<fo:region-body region-name="first_body"
margin-top="10cm" extent="17.7cm" />
</fo:simple-page-master>

<!-- Define 'rest of document' page layout -->
<fo:simple-page-master master-name="rest">
<fo:region-before region-name="rest_before"
extent="5cm" />
<fo:region-body region-name="rest_body"
margin-top="5cm" extent="22.7cm" />
</fo:simple-page-master>

<!-- Specify the page sequence -->
<fo:page-sequence-master
master-name="master-sequence">
<fo:single-page-master-reference
master-reference="first" />
<fo:repeatable-page-master-reference
master-reference="rest" />
</fo:page-sequence-master>

</fo:layout-master-set>

<!-- Define layout of FIRST page sequence -->
<fo:page-sequence master-reference="first">
                 
<fo:static-content flow-name="first_before">
<fo:block>HEADER DETAIL FOR FIRST PAGE</fo:block>
</fo:static-content>
                 
<fo:flow flow-name="first_body">
<fo:block>FIRST BODY</fo:block>
<xsl:for-each select="hazardousGoodsItem">
<fo:block><xsl:value-of select="description"
/></fo:block>
</xsl:for-each>
</fo:flow>

</fo:page-sequence>

<!-- Define layout and contents of REST page sequence
-->
<fo:page-sequence master-reference="rest">

<fo:static-content flow-name="rest_before">
<fo:block>THIS IS THE REST HEADER SECTION</fo:block>
</fo:static-content>
                 
<fo:flow flow-name="rest_body">
<fo:block>REST BODY</fo:block>
<xsl:for-each select="hazardousGoodsItem">
<fo:block><xsl:value-of select="description"
/></fo:block>
</xsl:for-each>
</fo:flow>
                  
</fo:page-sequence>
                                
</fo:root>    


--- omprakash(_dot_)v(_at_)polaris(_dot_)co(_dot_)in wrote:



Hi,
     Have you tried using  the fo:static-content
element, This is where you
specify the header and footer you would like to use.
You can use this in
conjunction with the page-sequence element and
specify one sequence for
only the first page header and content and another
sequence for your
remaining content.

Hope this helps.

Cheers,
Omprakash.V


<fo:layout-master-set>

<fo:simple-page-master page-width="auto"
page-height="auto" master-name
="all-pages" page-master-name="one"
<fo:region-body column-gap="12pt" column-count="1"
margin-left="1in"
margin-bottom="1in" margin-right="1in"
margin-top="1in"/><fo:region-before
display-align="before" extent="1in" region-name
="page-header"/><fo:region-after
display-align="after" extent="1in"
region-name="page-footer"/><fo:region-start
extent="1in"/><fo:region-end

extent="1in"/></fo:simple-page-master></fo:layout-master-set>

<fo:page-sequence master-reference="firstpage">

<fo:title>New Page 1</fo:title>

<fo:static-content flow-name="page-header"><fo:block
font-size="8pt"
text-align="center" space-before="0.5in"
space-before.conditionality
="retain">Very big
header</fo:block></fo:static-content>

<fo:static-content flow-name="page-footer">
<fo:block font-size="8pt" text-align="center"
space-after="0.5in"
space-after.conditionality="retain">-
<fo:page-number/> -</fo:block>
</fo:static-content>

<fo:flow flow-name="xsl-region-body"><fo:block
role="html:body">
First page content here
</fo:flow>







                                                    
                                                    
         
                    Karen Varga                     
                                                    
         
                    <vargakaren(_at_)y        To:    
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                     
             
                    ahoo.com>            cc:    
(bcc: omprakash.v/Polaris)                          
             
                                         Subject:   
 [xsl] How to create document with different headers
but same 
                    02/07/2005           body
(xslfo/xslt)                                        
                
                    06:26 PM                        
                                                    
         
                    Please                          
                                                    
         
                    respond to                      
                                                    
         
                    xsl-list                        
                                                    
         
                                                    
                                                    
         
                                                    
                                                    
         




I am going round and round in circles trying to
create
a pdf document (using xslt and xslfo) that has a
different header on the first page to the rest of
the
document, but the SAME body.

Basically my body content is solely a list of items
displayed using a xsl:for-each loop.  This list is
an
unknown length and needs to flow over to the next
page
and the next etc.

The first page of the document has a large header
and
footer to display.  But for the rest of the pages I
only need to display a small header section.  The
body
for all the pages is however the same.

Does anybody know how to do this?  I have tried all
sorts with multiple page-sequences and a
page-sequence-master but cannot get it to use the
same
body.  I cannot have the for loop start again on the
second page, it must continue from the first page.
Also, the size of the items displayed is not limited
to a single line and therefore it is unknown as to
how
many items will fit on a page.

I've also tried using an xsl:if statement but don't
know how to get the page number.  I was thinking if
I
could get the page number then I could just use an
if
statement to determine which header code to display.

Please help!





__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile
phone.
http://mobile.yahoo.com/maildemo


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--






This e-Mail may contain proprietary and confidential
information and is sent for the intended
recipient(s) only. 
If by an addressing or transmission error this mail
has been misdirected to you, you are requested to
delete this mail immediately.
You are also hereby notified that any use, any form
of reproduction, dissemination, copying, disclosure,
modification,
distribution and/or publication of this e-mail
message, contents or its attachment other than by
its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





                
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - What will yours do?
http://my.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--