[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSLT and FO/FOP workarounding

Subject: XSLT and FO/FOP workarounding
From: Sönke Ruempler <ruempler@xxxxxxxxxxxxxxx>
Date: Mon, 13 Sep 2004 08:44:34 +0200
premature end of file fop
Hi,

I am using XML, XSLT and FOP to generate PDFs via XSL-FO. I have written
(and copied some stuff) a XSLT Stylesheet that transforms a HTML-like
Language to XSL-FO. Since FOP does not support the feature of FO that i can
the a Element that it never breaks with the next elements in 2 pages, I am
looking for a workaround. FOP supports that if the 2 elements are
transformed into a table:

XML:

<h1>title</h1>
<p>blahtext</p>

XSLT Template:

  <template match="h1">
   <fo:table table-layout="fixed" width="100%">
     <fo:table-column column-width="proportional-column-width()"/>
     <fo:table-body>
       <fo:table-row keep-with-next="always">
          <fo:table-cell>
		<fo:block xsl:use-attribute-sets="h1">
			<xsl:apply-templates/>
		</fo:block>
          </fo:table-cell>
       </fo:table-row>
       <fo:table-row>
          <fo:table-cell>
            <xsl:apply-templates select="following-sibling::*"/>
          </fo:table-cell>
       </fo:table-row>
     </fo:table-body>
   </fo:table>

That works so far, but the problem is that now the element after the h1 tag
is processed two times: one in the h1 tag and one for the element itself.

So my question is how to exclude the next element via XSLT, something like:

<xsl:apply-templates
     select="*[not(preceding-sibling::*[1][self::h1])]"/>

One guy at the FOP Maling List told me that, but then FOP says:

[Fatal Error] :-1:-1: Premature end of file.
[ERROR] Premature end of file.)


My second Question is that i don't want to copy that stylesheet for each
heading (h1, h2, ...) and a general stylesheet for the headings would be
nice.


--

Svnke

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.