Re: [xsl] fo: issues

Subject: Re: [xsl] fo: issues
From: "Nikolai Grigoriev" <grig@xxxxxxxxxxx>
Date: Thu, 31 May 2001 12:47:43 +0400
Dwayne,

Have you looked at the PDF version of the XSL 1.0 CR at the
W3C site? It has many of the things you have listed. It has been
produced via XSL FO; you can find the relative stylesheet
at http://www.renderx.com/xmlspec.html, and look how these
things have been done.

I have no information about BladeRunner implementation of XSL FO. 
There's not much data publicly available - not even the version 
of the XSL they support. So I try to give you some advice, based
on the current version of the spec (XSL CR of November 2000).
Please check in your docs if it can be applied to your formatter.

> 1. Headers. Ideally, I need:
>   a.  roman numeral page numbers in the frontmatter and 
> standard numbering in the chapters.

Use a separate page sequence for frontmatter, and set
number format for it to be Roman numbers:

<fo:page-sequence master-name="frontmatter" format="i"> ....

>   b. numbers reset for each chapter, annex and appendix.

Use a separate page sequence for each chapter/annex/appendix,
and reset initial page number to 1:

<fo:page-sequence master-name="chapter" initial-page-number="1"> ....

Be careful: according to the spec, setting initial-page-number to 1
should lengthen the preceding page sequence to end on an even page.
Unless you actually need this, you should specify 
force-page-count="no-force" on the preceding page sequence.

>   c. page numbers are prefixed by the chapter number, annex letter,
> appendix number where appropriate. 

That's an XSLT task - chapter number etc. are known prior to the 
formatting, so everything but the actual page number can be 
generated by the stylesheet. No XSL FO wizardry required.

> I have done a little reading and I suspect that much of this is not
> currently possible using XSLFO. Is this correct?

I think the opposite; but you should verify with your formatter if any 
of the above actually works.

> 2. I need chapters and some elements of the front matter to start on a
> right hand page. I am currently attempting to apply the break-before
> ="odd-page" attribute to the fo:block element corresponding to the element
> that needs to start on the right page but it is not working - all I get is
> a standard page break. Am I doing something wrong or is there another way
> to achieve this?

An alternative solution would be to put chapters in separate page sequences
and control the length of the preceding page sequence:

<fo:page-sequence force-page-count="end-on-even">....

This eventually adds a blank page so that the last page in the sequence is 
always even-numbered. (That's how it is done in the PDF for XSL CR).

> 3. There is an amendment certificate within the frontmatter which is just a
> simple table without any data in it (is filled in by hand by owner of
> manual). I cannot seem to get the row height to apply (keep getting default
> height based on selected font)  if there is no data in the cells. Is there
> a way to force the row height to be applied?

<fo:table-row height="X"> is the right syntax for it. If it does not work,
ask makers of your formatter.

> 4. I cant seem to find a way to centre tables. I can centre the text 
> within a table, but not the table itself. I have tried using the text-align
> attribute on the surrounding fo:block element and also on the table
> element, but this does not work - Am I missing something?

There's no such option as to centre tables in XSL FO. What you can 
do instead is to specify start-indent and/or end-indent on the table, to
offset it from the right/from the left. If your formatter supports expressions,
you can express it this way:

<fo:table width="[X]" start-indent="(100% - [X]) div 2"> 

This should center your table.

> 5. I have an index in this manual. I have managed to set it up to
> automatically gett all the appropriate entries and have also managed to get
> the page references for each word and comma delimit them, but I cannot seem
> to get rid of the duplicated page references. Is there any way of only
> returning unique page numbers using the fo:page-number-citation element or
> any way of removing the duplications? I have references of the form:

One of the toughest problems. No clean solution in XSL FO (unless I am 
missing something). I know a method to achieve this with our formatter, XEP; 
but it relies upon formatter-specific tricks that permit to access the XML 
representation of the text already laid out. 

Best regards,
Nikolai Grigoriev

RenderX




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread