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 Petr Hanek <pe...@kctdata.cz> on 2002/07/08 14:28:11 UTC

20_0_1 vs higher version

Hi,

I have simple xml and xsl file.
It works on fop 0_20_1 but it doesn't run on higher version (0_20_3,
0_20_4).
I see this error:

[ERROR] org.apache.fop.apps.FOPException: 'master-reference' for
'fo:page-sequence'matches no 'simple-page-master' or 'page-sequence-master'

Thanks

petr

XML:
<?xml version="1.0" encoding="utf-8" ?>

<source>
<term-entry>
<title>test</title>
<author>test</author>
</term-entry>

<term-entry>
<title>test2</title>
<author>test2</author>
</term-entry>
</source>

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


<xsl:template match="source">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

 <fo:layout-master-set>

 <fo:simple-page-master master-name="all"
  page-height="11.5in" page-width="8.5in"
 margin-top="1in" margin-bottom="1in"
        margin-left="0.75in" margin-right="0.75in">
  <fo:region-body margin-top="1in" margin-bottom="0.75in"/>
  <fo:region-before extent="0.75in"/>
  <fo:region-after extent="0.5in"/>
 </fo:simple-page-master>

 </fo:layout-master-set>

 <fo:page-sequence master-name="all" format="1">
    <!-- header with running glossary entries -->
    <fo:static-content flow-name="xsl-region-before">
  <fo:block text-align="start"
   font-size="10pt" line-height="1em + 2pt">
     <fo:retrieve-marker retrieve-class-name="title"
   retrieve-boundary="page"
   retrieve-position="first-starting-within-page"/>
  <fo:leader leader-alignment="reference-area" leader-pattern="dots"
   leader-length="4in"/>
     <fo:retrieve-marker retrieve-class-name="title"
   retrieve-boundary="page"
   retrieve-position="last-ending-within-page"/>
      </fo:block>
    </fo:static-content>
    <fo:static-content flow-name="xsl-region-after">
  <fo:block text-align="start"
   font-size="10pt" line-height="1em + 2pt">
   Page (<fo:page-number/>)
      </fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
  <xsl:apply-templates select="term-entry"/>
 </fo:flow>
 </fo:page-sequence>
</fo:root>
</xsl:template>

<xsl:template match="term-entry">
 <fo:block text-align="start" font-size="12pt" font-family="Arial">
  <xsl:apply-templates select="title"/>  ....
  <xsl:apply-templates select="author"/>
 </fo:block>
</xsl:template>

</xsl:stylesheet>


Re: 20_0_1 vs higher version

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Petr Hanek wrote:

> I have simple xml and xsl file.
> It works on fop 0_20_1 but it doesn't run on higher version (0_20_3,
> 0_20_4).
> I see this error:
> 
> [ERROR] org.apache.fop.apps.FOPException: 'master-reference' for
> 'fo:page-sequence'matches no 'simple-page-master' or 'page-sequence-master'

That's faq actually, fo syntax has changed in xsl recommendation, now masters 
have master-name attribute and master references have master-reference.

>  <fo:simple-page-master master-name="all"
>   page-height="11.5in" page-width="8.5in"
>  margin-top="1in" margin-bottom="1in"
>         margin-left="0.75in" margin-right="0.75in">
>   <fo:region-body margin-top="1in" margin-bottom="0.75in"/>
>   <fo:region-before extent="0.75in"/>
>   <fo:region-after extent="0.5in"/>
>  </fo:simple-page-master>
> 
>  </fo:layout-master-set>
> 
>  <fo:page-sequence master-name="all" format="1">
Should be <fo:page-sequence master-reference="all" format="1">

>     <!-- header with running glossary entries -->
>     <fo:static-content flow-name="xsl-region-before">
>   <fo:block text-align="start"
>    font-size="10pt" line-height="1em + 2pt">
>      <fo:retrieve-marker retrieve-class-name="title"
>    retrieve-boundary="page"
>    retrieve-position="first-starting-within-page"/>
>   <fo:leader leader-alignment="reference-area" leader-pattern="dots"
>    leader-length="4in"/>
>      <fo:retrieve-marker retrieve-class-name="title"
>    retrieve-boundary="page"
>    retrieve-position="last-ending-within-page"/>
>       </fo:block>
>     </fo:static-content>
>     <fo:static-content flow-name="xsl-region-after">
>   <fo:block text-align="start"
>    font-size="10pt" line-height="1em + 2pt">
>    Page (<fo:page-number/>)
>       </fo:block>
>     </fo:static-content>
>     <fo:flow flow-name="xsl-region-body">
>   <xsl:apply-templates select="term-entry"/>
>  </fo:flow>
>  </fo:page-sequence>
> </fo:root>
> </xsl:template>
> 
> <xsl:template match="term-entry">
>  <fo:block text-align="start" font-size="12pt" font-family="Arial">
>   <xsl:apply-templates select="title"/>  ....
>   <xsl:apply-templates select="author"/>
>  </fo:block>
> </xsl:template>
> 
> </xsl:stylesheet>
> 



-- 
Oleg Tkachenko
Multiconn International, Israel


Re: Just what is proportional-column-width() ?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Richard Bondi wrote:
> The definition from the spec is (at least to me) almost completely 
> opaque. Here's the original defition, followed by my interpretation of it.
> 
>     * Function: */numeric/ *proportional-column-width*( /numeric/) The
>     proportional-column-width function returns /proportional factor/
>     (the argument) units of proportional measure. The column widths are
>     first determined ignoring the proportional measures. The difference
>     between the table-width and the sum of the column widths is the
>     available proportional width. One unit of proportional measure is
>     the available proportional width divided by the sum of the
>     proportional factors. It is an error to use this function on
>     formatting objects other than an fo:table-column. It is also an
>     error to use this function if the fixed table layout is not used.
> 

My interpretation is:
  1. Evaluate each column width with proportional-column-width() set
     to zero.
  2. Subtract the sum of 1. from the table width.
  3. Divide the result of 2. by the sum of all arguments of the
     proportional-column-width() functions. The result is the proportional
     width.
  4. Evaluate the column widths again, this time
     proportional-column-width(X) returning X times the proportional
     width
This means:
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has two columns of equal width.
- a table with
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has two columns, the second twice as wide as the first.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(2)"/>
   has columns of 20mm, 40mm and 40mm width
- a table with
   <fo:table width="100%">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm"/>
     <fo:table-column column-width="proportional-column-width(1)"/>
   has a the second column of 40mm width and rest width equally distributed
   between the first and the third row.
- a table with
   <fo:table width="100mm">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-column column-width="40mm+proportional-column-width(1)"/>
   hastwo columns of 30mm and 70mm width.

> To sum up: none of the main terms in this definition are ever defined. 
> It really ought to be rewritten.

This happens.

HTH
J.Pietschmann