Hi Siarom,

Take some data like 

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="D:\temp\1\Untitled1.xslt"?>
<root>
<data><car>A</car><price>50000$</price></data>
<data><car>B</car><price>50000$</price></data>
<data><car>C</car><price>50000$</price></data>
...
</root>

And a stylesheet:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
        <xsl:output method="xml" encoding="iso-8859-1" 
omit-xml-declaration="no" indent="yes"/>
        <xsl:template match="/">
                <fo:root>
                        <fo:layout-master-set>
...
                        </fo:layout-master-set>
                        <fo:page-sequence master-reference="standard">
        ....
                                <fo:flow flow-name="xsl-region-body">
                                        <xsl:call-template name="content"/>
                                </fo:flow>
                        </fo:page-sequence>
                </fo:root>
        </xsl:template>

        <xsl:template name="content">
                <fo:block>
                        <fo:marker 
marker-class-name="cont"><fo:block/></fo:marker>The result:</fo:block>

                <!--            <fo:table-and-caption> not supported by FOP -->
                <fo:table>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-column column-width="25mm"/>
                        <fo:table-header>
                                <fo:table-row>
                                        <fo:table-cell 
number-columns-spanned="2">
                                                <fo:retrieve-marker 
retrieve-position="first-starting-within-page" retrieve-class-name="cont"/>
                                        </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                        <fo:table-cell>
                                                <fo:block 
font-weight="bold">Car</fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell>
                                                <fo:block 
font-weight="bold">Price</fo:block>
                                        </fo:table-cell>
                                </fo:table-row>
                        </fo:table-header>
                        <fo:table-body>
                                <xsl:for-each select="root/data">
                                        <fo:table-row>
                                                <fo:table-cell>
                                                        <fo:block>
                                                                <xsl:if 
test="position()!=1">
                                                                        
<fo:marker marker-class-name="cont">
                                                                                
<fo:block>(Continued)</fo:block>
                                                                        
</fo:marker>
                                                                </xsl:if>
                                                                <xsl:value-of 
select="car"/>
                                                        </fo:block>
                                                </fo:table-cell>
                                                <fo:table-cell>
                                                        <fo:block>
                                                                <xsl:value-of 
select="price"/>
                                                        </fo:block>
                                                </fo:table-cell>
                                        </fo:table-row>
                                </xsl:for-each>
                        </fo:table-body>
                </fo:table>
                <!--            </fo:table-and-caption> -->
        </xsl:template>
</xsl:stylesheet>

That should work! May be that the resulting fo-document is a little bit blown 
up.

Regards,

Joachim


-----Ursprüngliche Nachricht-----
Von: siarom egrub [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 4. Januar 2006 19:01
An: fop-dev@xmlgraphics.apache.org
Betreff: Using fo:marker and fo:retrieve-marker

Hi All!

I am having an enormous problematic time trying to get fo:marker and 
fo:retrieve-marker to work correctly in some tables that continued to a second 
page. I have reviewed several examples and it still doesn't click.
Maybe too much holiday time off! 

The "(Continued)" text is displaying on the first occurrence of the table title 
as well as the second.
It should only be displayed on the second occurrence.
I have included the XSL snippet below.

I really appreciate any help in you can offer. Thanks in advance for your help! 

S.E.


<fo:flow  flow-name="xsl-region-body"
font-family="Arial">
  <fo:block>
  <fo:marker marker-class-name="cont">
    <fo:inline>(Continued)</fo:inline>
  </fo:marker>
</fo:block>
...
</fo:flow>

<fo:table-and-caption space-before="2em"> <fo:table table-layout="fixed" 
width="100%"> <fo:table-header> <fo:table-row> <fo:table-cell 
border-style="solid"
border-width="1.5pt"  border-bottom="1.5pt"
border-left="1.5pt"  
border-right="1.5pt" padding-top="1pt"
padding-bottom="1pt" font-size="24pt"
text-align="center" 
number-columns-spanned="7">
<fo:block font-weight="bold">
<xsl:value-of select="title"/>
</fo:block><!--Section 4 Title -->

<fo:block line-height="0pt">
<fo:retrieve-marker
retrieve-position="last-starting-within-page"
retrieve-class-name="cont"/>
</fo:block>

</fo:table-cell>
</fo:table-row>
</fo:table-header>
...
</fo:table>


                
__________________________________________
Yahoo! DSL - Something to write home about. 
Just $16.99/mo. or less. 
dsl.yahoo.com 

Reply via email to