Ray Miller | 3 Nov 2005 20:11

RE: Table and Border Columns do not Appear

>> Are you testing with the stock stylesheet, or with a customization layer? <<

 

No

 

>> Have you tried it outside of Oxygen? <<

 

No, but will test with xsltproc

 

christopher williams | 3 Nov 2005 21:07
Picon
Favicon

Re: towards smaller XSL-FO page-sequences (due to limitations in FOP)

After reading a bunch of docbook-related lists (via the excellent
marc.theaimsgroup.com), I came to understand that the problem with long
documents in FOP is that in building a Table of Contents, it uses forward
references until the last page is seen, and then it renders a section; due
to the forward references, it must hold the entire page-sequence in RAM.

I'm using FOP 0.20.5 on a machine with 2 GiB of RAM; the page-sequence
I'm trying to render is approximately 557 pages long (when rendered
with Antenna House's evaluation XSLFormatter) but usually dies with an
java OutOfMemoryError about halfway through that, around 225 page or so.

Here's how I run FOP:

	% env FOP_OPTS="-Xmxw2048M" fop -d -fo large.fo -pdf large.pdf
	[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
	[INFO] base directory: file:/home/cgw/src/qualys/big/
	[INFO] FOP 0.20.5
	[INFO] Using org.apache.xerces.parsers.SAXParser as SAX2 Parser
	[INFO] building formatting object tree
	[INFO] setting up fonts
	[INFO] [1]
	[INFO] [2]
	[INFO] [3]
	[DEBUG] Last page-sequence produced 3 pages.
	[INFO] [4]
	[DEBUG] Last page-sequence produced 1 pages.
	[INFO] [1]
	[INFO] [2]
	[INFO] [3]
	[INFO] [4]
	[INFO] [5]
	[DEBUG] Last page-sequence produced 5 pages.
	[INFO] [6]
	[INFO] [7]
	[INFO] [8]
	....
	[INFO] [218]
	[INFO] [219]
	[INFO] [220]
	[INFO] [221]
	Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I'm guessing that it's the exceptional size of the last <fo:page-sequence>
for this particular chapter that gives FOP fits; the smaller sections
of the document are successfully rendered. The last page-sequence is
41671 lines long (after pretty-formatting with 'xmlstartlet fo').

I suppose the problem is really long fo:page-sequences as they relate to
Table of Contents. Other people have run into this problem: I read that
one option is to move the ToC to the end of the document but because
this document is for electronic delivery, doing that isn't really an
option for me.

Perhaps a better statement of the problem I have is: 

Is there a way to get FOP to successfully build ToC's for documents with
very long chapter page-sequences? The chapters are anywhere from 300 to
600 pages long.

-cgw-

--
christopher williams              coffee achiever
cgw <at> pobox.com                     nana korobi, yo oki
Bob Stayton | 3 Nov 2005 23:17

Re: Olinking to a table row

Hi Peter,
I think this was simply an oversight.  It certainly makes sense to link into
a table. I would file this as a bug report rather than a feature request.

Of course, linking to a table row or entry element means you have supply the
text content for the olink, because the stylesheet doesn't generate link
text for either of those elements.

You can get olink access to those IDs in your customization layer by adding
this template:

<xsl:template match="table" mode="olink.mode">
  <xsl:call-template name="obj"/>
  <xsl:apply-templates mode="olink.mode"/>
</xsl:template>

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs <at> sagehill.net

----- Original Message ----- 
From: "Peter Kullmann" <p.kullmann <at> arenae.ch>
To: <docbook-apps <at> lists.oasis-open.org>
Sent: Tuesday, November 01, 2005 2:29 AM
Subject: [docbook-apps] Olinking to a table row

I try to olink to a table row and it doesn't work: In the target.db
(generated by docbook.xsl with collect.xref.targets) no child elements of
the table are generated. For example:

Document:
...
<table><title>Systemparameter</title>
  <tgroup cols="3">
    <thead>
      <row>
        <entry>Parameter</entry>
        <entry>Beschreibung</entry>
        <entry>Wert (Beispiel)</entry>
      </row>
    </thead>
    <tbody>
      <row id="ft.x-par.adts">
        <entry>adts</entry>
...

Corresponding target.db:
...
<obj element="table" href="ft.refdata.sysparam.html#id2697899" number="63">
  <ttl>Systemparameter</ttl>
  <xreftext>Tabelle 63, â200236Systemparameterâ200234</xreftext>
</obj>
...

I think the reason for this behaviour is clear. In the commons/targets.xsl
the following temlate prevents the processing of the child nodes of a table:

<xsl:template match="figure|example|table" mode="olink.mode">
  <xsl:call-template name="obj"/>
</xsl:template>

As a solution or workaround I can overwrite this template in my
customization layer. But on the other hand I have some questions:
- Is it a bad thing to link into a table?
- Is there a reason why child-nodes of tables are not considered worthy
targets in the olink-setup? Perhaps there's too much data?
- Shall I submit a feature request for child-nodes of table (and for
example)?

Thanks for comments and hints

Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe <at> lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help <at> lists.oasis-open.org
Alejandro Exojo | 4 Nov 2005 00:07

Small questions about what tools to use

Hi.

I started using docbook some months ago, when I needed to write a big document 
for a university project. The result was excellent with minimum effort: I 
just run docbook2pdf, and the generated file was of a great quality. Nice!

Then I learnt a lot more about docbook, and I learnt that docbook2pdf was just 
using Jade and DSSSL behind the scenes, and that there were (modern) 
alternatives to them. I tried PassiveTex, and it didn't work completely, so I 
tried FOP (with some help, because it's a bit trickier to install Java here). 
With DocBook XSL and FOP the result wasn't bad, but seemed a bit less mature 
than the version Jade generated (the size of fonts and margins, for example), 
so I chose the latter.

And now I want to start a new document, and I have some doubts about what 
tools to use:

* Will Jade work with Docbook 5.0? I tried with defguide5 (is the only DB5 
document I have), and it didn't, so I don't know if start with 4.x, or with 
the 5.0 beta.

* Should I remain with DSSSL/Jade, or switch to XSL, and just customize the 
stylesheets until I get a result which is near to what I like?

Well, I think that's all. Sorry if I've been a bit boring, and thanks a lot in 
advance. :-)

--

-- 
Alex (a.k.a. suy) - GPG ID 0x0B8B0BC2
http://darkshines.net/ - Jabber ID: suy <at> bulmalug.net
Eric Jacoboni | 4 Nov 2005 00:28
Picon

Re: Small questions about what tools to use

Alejandro Exojo a écrit :

 > * Should I remain with DSSSL/Jade, or switch to XSL, and just
 > customize the stylesheets until I get a result which is near to what 
I > like?

Even if you customize your stylesheet, using FOP will not give you great 
results imho: it's poor management of orphan and widows, for exemple.

For my own, i've switched to XEP (Free for non commercial use, or for 
academic use) and i get results i use to have with TeX (minus Maths but 
plus ability to choose easily fonts).
christopher williams | 4 Nov 2005 01:11
Picon
Favicon

Re: towards smaller XSL-FO page-sequences (due to limitations in FOP)

I found a solution although it wasn't the one I expected to find.

I saw a mention of the java commandline option "-XX:+AggressiveHeap" at [1]
and did some more poking around. I eventually came to read [2] and changed
how fop is invoked by adding both "-Xms1600m" and "-XX:+AggressiveHeap"
to JAVA_OPTS in /usr/bin/fop.

I am now generating PDF documents of almost arbitrary length (so far,
page-sequences of around 6000 pages work, 8500 doen't and that's WAY
more than plenty for my purposes).

-cgw-

[1] http://marc.theaimsgroup.com/?l=fop-user&m=105492091622556&w=2
[2] http://java.sun.com/j2se/1.4.2/1.4.2_whitepaper.html#6
Michael Smith | 4 Nov 2005 03:30

Re: python classsynopsis?

Stephen Langer <stephen.langer <at> nist.gov> writes:

> Do the docbook xsl html stylesheets support <classsynopsis  
> language="python"> ?
> 
> I found one mention in the list archives about specifying (or not)  
> the python constructor name, which led me to believe that  
> classsynopsis should work for python, but there doesn't seem to be  
> anything python-related in html/synop.xsl.

There is no logic in the stylesheets for doing anything special
for <classsynopsis language="python">

But I think you could create something using one of the existing
classsynopsis modes (java, perl, idl, cpp) as a model

  --Mike

--

-- 
Michael Smith
http://sideshowbarker.net/
Attachment (smime.p7s): application/x-pkcs7-signature, 2348 bytes
Michael Smith | 4 Nov 2005 04:11

Re: Small questions about what tools to use

Alejandro Exojo <suy <at> kurly.org> writes:

[...]
> Then I learnt a lot more about docbook, and I learnt that docbook2pdf was just 
> using Jade and DSSSL behind the scenes, and that there were (modern) 
> alternatives to them. I tried PassiveTex, and it didn't work completely, so I 
> tried FOP (with some help, because it's a bit trickier to install Java here). 
> With DocBook XSL and FOP the result wasn't bad, but seemed a bit less mature 
> than the version Jade generated (the size of fonts and margins, for example), 
> so I chose the latter.

I agree that the font size of headings in default DocBook XSL is too big.
Way too big. But it is configurable. As an example, I've pasted in
a copy of a customization layer I use for generating FO output.

There is also an XSL-based alternative to using the DocBook FO
stylesheets -- dblatex:

  http://dblatex.sourceforge.net/

You might also try that.

> And now I want to start a new document, and I have some doubts about what 
> tools to use:
> 
> * Will Jade work with Docbook 5.0? I tried with defguide5 (is the only DB5 
> document I have), and it didn't, so I don't know if start with 4.x, or with 
> the 5.0 beta.

DocBook 5 is namespaced. Jade is an SGML tool. I don't know if it
or other SGML tools will work with namespaced content.

> * Should I remain with DSSSL/Jade, or switch to XSL, and just customize the 
> stylesheets until I get a result which is near to what I like?

For starting new projects, I would personally not recommend
investing time in using the DSSSL/Jade toolchain. For one thing,
it is not really being actively maintained. All work on new
features is going into the XSL toolchain.

Really, the current problems with the XSL toolchain are due to
limitations in the open-source XSL-FO processors (FOP, Passivetex,
others) -- not due to limitations in the FO stylesheets. There are
non-free-software alternatives (XEP, Antenna House XSL Formatter)
that produce PDF output that is better than anything that can be
gnerated using the DocBook DSSSL toolchain.

  --Mike

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
                xmlns:fo="http://www.w3.org/1999/XSL/Format" \
                version="1.0"> \
  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/> \
  <xsl:param name="fop.extensions">1</xsl:param> \
  <xsl:param name="paper.type">A4</xsl:param> \
  <xsl:param name="draft.watermark.image"></xsl:param> \
  <xsl:param name="hyphenation">false</xsl:param> \
  <xsl:param name="alignment">left</xsl:param> \
  <xsl:param name="refentry.generate.name">1</xsl:param> \
  <xsl:param name="refentry.generate.title">0</xsl:param> \
  <xsl:param name="refentry.pagebreak">1</xsl:param> \
  <xsl:param name="shade.verbatim">1</xsl:param> \
  <xsl:param name="variablelist.as.blocks">1</xsl:param> \
  <xsl:param name="ulink.show">1</xsl:param> \
  <xsl:param name="ulink.footnotes">1</xsl:param> \
  <xsl:param name="index.on.type">1</xsl:param> \
  <xsl:attribute-set name="xref.properties"> \
    <xsl:attribute name="color">blue</xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="shade.verbatim.style"> \
    <xsl:attribute name="background-color">\#E0E0E0</xsl:attribute> \
    <xsl:attribute name="padding-left">4pt</xsl:attribute> \
    <xsl:attribute name="padding-right">4pt</xsl:attribute> \
    <xsl:attribute name="padding-top">4pt</xsl:attribute> \
    <xsl:attribute name="padding-bottom">4pt</xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="section.title.level1.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master * 1.728"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="section.title.level2.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master * 1.44"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="section.title.level3.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master * 1.2"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="section.title.level4.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="component.title.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master * 1.728"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
  <xsl:attribute-set name="monospace.verbatim.properties"> \
    <xsl:attribute name="font-size"> \
      <xsl:value-of select="$$body.font.master * 0.8"></xsl:value-of> \
      <xsl:text>pt</xsl:text> \
    </xsl:attribute> \
  </xsl:attribute-set> \
</xsl:stylesheet>

--

-- 
Michael Smith
http://sideshowbarker.net/
Attachment (smime.p7s): application/x-pkcs7-signature, 2348 bytes

Gmane