Subject: Re: [xsl] xsl:fo - keeps and breaks problem.. From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 12 Sep 2002 18:18:52 +0200 |
some nodes have nested foo's inside them...
<foo type="a" name="Fooey"> <foo type="x" name="FooChild"/> <foo type="y" name="FooChild2"/> </foo>
So far I've written a single template match for the foo element that returns a fo:block (of full page width) for each match and calls itself if it has any foo children, thereby producing nested fo:blocks where appropriate..
The problem that I'm having is when trying to prevent any one foo result from splitting over two pages. I'd like to keep all the contents of one foo match together (ignore the nested ones for now); so either encourage it to keep on one page or break and go to the next.
<xsl:if test="not(parent::foo)"> <xsl:attribute name="keep-together">always</xsl:attribute> </xsl:if>
<xsl:attribute name="keep-together"> <xsl:value-of select="count(ancestor-or-self::foo)"/> </xsl:attribute>
-- Upcoming hands-on in-depth Europe: Sep 18-Sep 20,2002 XSLT/XPath and XSL-FO North America: Sep 30-Oct 4,2002
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Next public training: 2002-09-13,18,19,30,10-03,12-08, - 2003-03-04,07
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] xsl:fo - keeps and breaks, Andy Joslin | Thread | RE: [xsl] xsl:fo - keeps and breaks, DPawson |
Re: [xsl] document() loops, Vasu Chakkera | Date | Re: [xsl] How to keep é, David N Bertoni/Camb |
Month |