OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Using DocBook Stylesheets and Java Heap Problems


Hi,
Yes, that is one workaround that should work in FOP.

Two things need to happen.  The template that matches article will generate 
a page-sequence, so the section content and any elements that come after 
sections (glossary, appendix) must be excluded from that page-sequence 
because you cannot nest page-sequences.  Then you need to put each top level 
section and any elements after sections in in their own page-sequences.

In the template with match="article" in fo components.xsl, change:

   <xsl:apply-templates/>

near the end of the template to

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

That removes sections and any elements after sections from the article 
page-sequence.

Then after the closing tag of the article page-sequence, add this:

  ...
  </fo:page-sequence>

  <xsl:for-each select="*[self::section or preceding-sibling::section]">
    <xsl:call-template name="page.sequence">
      <xsl:with-param name="content">
        <xsl:apply-templates select="."/>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:for-each>

</xsl:template>

This processes all the sections and elements that follow sections, each in 
their own page-sequence.

Bob Stayton
Sagehill Enterprises
bobs@sagehill.net


----- Original Message ----- 
From: "Tobias Anstett [k15t.com]" <tobias@k15t.com>
To: "Bob Stayton" <bobs@sagehill.net>; "docbook-apps" 
<docbook-apps@lists.oasis-open.org>
Sent: Tuesday, May 05, 2009 2:28 PM
Subject: Re: [docbook-apps] Using DocBook Stylesheets and Java Heap Problems


...
so one possible solution would be to close the existing
fo:page-sequence and start a new one before every major section (1. 2.
3. ...). How could I do something like this? I must use
fo:page-sequence and not break-after page, but you know best.

Cheers,
Tobias

On Tue, May 5, 2009 at 6:23 PM, Tobias Anstett [k15t.com]
<tobias@k15t.com> wrote:
> Hi Bob,
>
> I analyzed the problem by splitting the whole generation chain like
> you suggested.
>
> The problem occurs when the Apache FO processor does the
> transformation to PDF. After contacting the Apache FO mailinglist I
> know what my problem is, but not how to solve it.
>
> Adrian Cumiskey from the Apache FO mailinglist pointed out to check if
> I use "many" page sequences in the resulting FO document, because FOP
> processes documents by page sequence. Thus if I can section the
> document contents into lots of small page sequence segments this can
> help a lot with memory consumption.
>
> So I checked the generated FO documents (size from 300kb to 20mb) and
> noticed that there is really one single page sequence that wrapps all
> the content.
>
> => Thus my question is => is there a way to change this behaviour and
> how would it influence the look of my document?
>
> I am exporting in article style using a own page sequence master in
> the customization layer.
>
> Cheers,
> Tobias
>
>
> On Fri, May 1, 2009 at 7:40 PM, Bob Stayton <bobs@sagehill.net> wrote:
>> Hi,
>> Are you using FOP to apply the XSL stylesheet as well as converting the
>> XSL-FO to PDF? If so, you might try splitting those functions by first
>> generating an FO file with Saxon or such, and then processing the FO file
>> with FOP. That would at least tell you which step was having the problem.
>>
>> Bob Stayton
>> Sagehill Enterprises
>> bobs@sagehill.net
>>
>>
>> ----- Original Message ----- From: "Tobias Anstett [k15t.com]"
>> <tobias@k15t.com>
>> To: "docbook-apps" <docbook-apps@lists.oasis-open.org>
>> Sent: Friday, May 01, 2009 10:02 AM
>> Subject: [docbook-apps] Using DocBook Stylesheets and Java Heap Problems
>>
>>
>>> Hi,
>>>
>>> we are using the DocBook stylesheets in combination with Apache FOP
>>> inside a web app. I already assigned more than 1024m to -Xms and -Xmx
>>> but some (large) DocBook to PDF conversions still cause Java Heap
>>> Exceptions. Is there a way to reduce the consumed memory ?
>>>
>>> Cheers,
>>> Tobias
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
>>> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
>>>
>>>
>>>
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org





[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]