You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Eddy De Clercq <Ed...@aiv.kuleuven.ac.be> on 2002/12/11 12:24:42 UTC
orphans and widows within XSL-FO and Cocoon
Hi,
I have 2 questions:
1. I'm testing Cocoon for creating PDF with XSL-FO in order to investigate the orphan and widow control and till now I can't manage to achieve this.
I'm using http://www.w3.org/TR/1998/WD-xsl-19980818 as a reference and I've just adapted the existing simple-page2fo.xsl (see below). I've tried both keep-with-next and widows and orphans, but none of these seem to work.
I'm fairly new to XSL-FO so it could be that I'm doing something wrong. Can you help me out pls?
2. I've also tried http://www.antennahouse.com/XSLsample/fo/sample-keepwith-next_1.fo (which is linked from http://xml.apache.org/cocoon/link/xsl.html) and this seems not to work either. Which versions of XSL-FO can Cocoon handle and where is a good reference for it.
Thanks in advance
Eddy De Clercq
<?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="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="page"
page-height="297mm"
page-width="210mm"
margin-top="10mm"
margin-bottom="20mm"
margin-left="25mm"
margin-right="25mm">
<fo:region-before extent="30mm"/>
<fo:region-body margin-top="30mm"/>
<fo:region-after extent="15mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="all">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-name="page" page-position="first"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<fo:page-sequence master-name="all">
<fo:static-content flow-name="xsl-region-after">
<fo:block text-align="center"
font-size="10pt"
font-family="serif"
line-height="14pt">page <fo:page-number/></fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates/>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
<xsl:template match="title">
<fo:block font-size="36pt" space-before.optimum="24pt" text-align="center"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template keep-with-next="true" match="paratitle">
<fo:block font-size="16pt" space-before.optimum="12pt" text-align="left"><xsl:apply-templates/></fo:block>
</xsl:template>
<xsl:template match="para">
<fo:block font-size="12pt" space-before.optimum="12pt" text-align="left"><xsl:apply-templates/></fo:block>
</xsl:template>
</xsl:stylesheet>
------ extPart_000_003E_01C2A110.4811A5E0
Content-Type: text/html;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have 2 questions:</FONT></DIV>
<DIV><FONT face=Arial size=2>1. I'm testing Cocoon for creating PDF with XSL-FO
in order to investigate the orphan and widow control and till now I can't manage
to achieve this.</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm using <A
href="http://www.w3.org/TR/1998/WD-xsl-19980818">http://www.w3.org/TR/1998/WD-xsl-19980818</A> as
a reference and I've just adapted the existing simple-page2fo.xsl (see below).
I've tried both keep-with-next and widows and orphans, but none of these seem to
work.</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm fairly new to XSL-FO so it could be that I'm
doing something wrong. Can you help me out pls?</FONT></DIV>
<DIV><FONT face=Arial size=2>2. I've also tried <A
href="http://www.antennahouse.com/XSLsample/fo/sample-keepwith-next_1.fo">http://www.antennahouse.com/XSLsample/fo/sample-keepwith-next_1.fo</A> (which
is linked from <A
href="http://xml.apache.org/cocoon/link/xsl.html">http://xml.apache.org/cocoon/link/xsl.html</A>)
and this seems not to work either. Which versions of XSL-FO can Cocoon handle
and where is a good reference for it.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Eddy De Clercq</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?xml version="1.0"?></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><xsl:stylesheet version="1.0"<BR>
xmlns:xsl="<A
href="http://www.w3.org/1999/XSL/Transform">http://www.w3.org/1999/XSL/Transform</A>"<BR>
xmlns:fo="<A
href="http://www.w3.org/1999/XSL/Format">http://www.w3.org/1999/XSL/Format</A>"></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> <xsl:template
match="/"><BR> <fo:root xmlns:fo="<A
href="http://www.w3.org/1999/XSL/Format">http://www.w3.org/1999/XSL/Format</A>"><BR>
<BR> <fo:layout-master-set><BR>
<fo:simple-page-master
master-name="page"<BR>
page-height="297mm"
<BR>
page-width="210mm"<BR>
margin-top="10mm"
<BR>
margin-bottom="20mm"
<BR>
margin-left="25mm"
<BR>
margin-right="25mm"><BR>
<fo:region-before extent="30mm"/><BR>
<fo:region-body
margin-top="30mm"/><BR>
<fo:region-after extent="15mm"/><BR>
</fo:simple-page-master></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<fo:page-sequence-master
master-name="all"><BR>
<fo:repeatable-page-master-alternatives><BR>
<fo:conditional-page-master-reference master-name="page"
page-position="first"/><BR>
</fo:repeatable-page-master-alternatives><BR>
</fo:page-sequence-master><BR>
</fo:layout-master-set></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> <fo:page-sequence
master-name="all"><BR> <fo:static-content
flow-name="xsl-region-after"><BR> <fo:block text-align="center"
<BR>
font-size="10pt" <BR> font-family="serif"
<BR> line-height="14pt">page
<fo:page-number/></fo:block><BR>
</fo:static-content> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> <fo:flow
flow-name="xsl-region-body"><BR>
<xsl:apply-templates/><BR>
</fo:flow><BR> </fo:page-sequence><BR>
</fo:root><BR> </xsl:template></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> <xsl:template
match="title"><BR> <fo:block font-size="36pt"
space-before.optimum="24pt"
text-align="center"><xsl:apply-templates/></fo:block><BR>
</xsl:template><BR> <xsl:template keep-with-next="true"
match="paratitle"><BR> <fo:block font-size="16pt"
space-before.optimum="12pt"
text-align="left"><xsl:apply-templates/></fo:block><BR>
</xsl:template><BR> <xsl:template
match="para"><BR> <fo:block font-size="12pt"
space-before.optimum="12pt"
text-align="left"><xsl:apply-templates/></fo:block><BR>
</xsl:template><BR></xsl:stylesheet><BR></FONT></DIV></BODY></HTML>
Re: orphans and widows within XSL-FO and Cocoon
Posted by Eddy De Clercq <Ed...@aiv.kuleuven.ac.be>.
Hi,
Thanks for the answer. Since there is no release date for implementing this,
are there alternatives for FOP which handle widow/orphans already?
Greetz
Eddy De Clercq
----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <co...@xml.apache.org>
Sent: Wednesday, December 11, 2002 9:45 PM
Subject: Re: orphans and widows within XSL-FO and Cocoon
> Eddy De Clercq wrote:
> > I'm testing Cocoon for creating PDF with XSL-FO in
> > order to investigate the orphan and widow control and till now I can't
manage
> > to achieve this.
> Its not implemented yet. The issue is adressed in a redesigned
> version, with no target date yet.
>
> > I've tried both keep-with-next
> This works on table rows, with some caveats. If you want to use
> it for ordinary text, put it in a blind table, as mentioned in the
> FOP FAQ.
>
> > Which versions of XSL-FO can Cocoon handle and where is a good
> > reference for it.
> Recent Cocoon versions should be able to handle all FOP versions from
> 0.20.2 on. Just the latest FOP jar into the lib directory. The FOP
> documentation can be downloaded with both the FOP source and binary
> distribution, as well as read online at
> http://xml.apache.org/fop
>
> > ------Content-Type: text/html; charsetContent-Transfer-Encoding:
> You should not post HTML mail.
> J.Pietschmann
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: orphans and widows within XSL-FO and Cocoon
Posted by "J.Pietschmann" <j3...@yahoo.de>.
Eddy De Clercq wrote:
> I'm testing Cocoon for creating PDF with XSL-FO in
> order to investigate the orphan and widow control and till now I can't manage
> to achieve this.
Its not implemented yet. The issue is adressed in a redesigned
version, with no target date yet.
> I've tried both keep-with-next
This works on table rows, with some caveats. If you want to use
it for ordinary text, put it in a blind table, as mentioned in the
FOP FAQ.
> Which versions of XSL-FO can Cocoon handle and where is a good
> reference for it.
Recent Cocoon versions should be able to handle all FOP versions from
0.20.2 on. Just the latest FOP jar into the lib directory. The FOP
documentation can be downloaded with both the FOP source and binary
distribution, as well as read online at
http://xml.apache.org/fop
> ------Content-Type: text/html; charsetContent-Transfer-Encoding:
You should not post HTML mail.
J.Pietschmann
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>