Questions tagged [xsl-fo]

XSL-FO (XSL Formatting Objects) is a markup language for XML document formatting which is most often used to generate printed content.

From Wikipedia

XSL-FO is part of XSL (Extensible Stylesheet Language), a set of W3C technologies designed for the transformation and formatting of XML data. The other part of XSL is XSLT (Extensible Stylesheet Language Transformations). As of December 12, 2006, the current version of XSL-FO is v1.1.

An XSL-FO document is typically generated using XSLT. An XSLT processor (such as Saxon) evaluates the templates in an XSLT stylesheet to transform your data in your XML vocabulary (or your text or JSON or Markdown or...) into XML in the XSL-FO vocabulary.

Rather than just adding styles to the fixed structure of the source document, the transformation stage is able to also reorder, duplicate, or drop parts of the source document when generating the XSL-FO document, as well as generate new content based on the structure of the source document. This is especially useful when generating tables of contents and indexes that will appear in the formatted document.

The elements in the XSL-FO document represent the formatting objects, and their attributes represent properties of the formatting objects. There are FOs for: blocks; tables and parts of tables; images; links; index entries; and so on. The properties express values such as font size, the expected space between FOs, or whether two FOs should be kept together on the same page. The XSL-FO contains the templates for the types of pages that will be used when the document is made into pages, but the XSL-FO does not contain any information about page breaks or (usually) line breaks.

XSL-FO markup can then be rendered by an FO processor, where it is most commonly used to generate document formats such as PDF, PostScript or RTF. The FO processor uses the structure of the FOs, the constraints expressed by the properties, the sizes of characters in the available fonts, the intrinsic sizes of the graphics, and other factors to lay the content of the XSL-FO out into pages. There is currently one option for viewing the pages in the FO processor application itself, but once the pages are written to a PDF file or other format, the pages can be viewed on screen or printed.

XSL-FO is well suited to applications where you have either a range of broadly similar documents that you want to format in the same style or single large document for which you want consistent styling without much manual effort. The XSLT stage takes care of specifying the right styles for the structures in your source XML and of generating the table of contents and index, and the FO processor automatically lays out the pages in accordance with the specified styles.

Links:

1806 questions
0
votes
1 answer

XSL:FO To display page no N(N) on odd pages only,skip blank even pages

I have a requirement where I have to print current and total page number excluding even pages which are blank. Example : For 5 page long document,it should display like: 1(3) 2(3) 3(3) The current code displays 1(5) blank page 3(5) blank page 5(5)…
at18
  • 11
  • 2
0
votes
5 answers

Calling a xsl template with a different context

I am modifying a XSL that already come with some templates outputting data relative to the current context node. I want to call the same templates with a different context so I don't have to change the existing templates by passing additional…
Guasqueño
  • 405
  • 9
  • 20
0
votes
1 answer

Table "disappers" during XSL-FO to PDF conversion

I have the following mark-up for a table at the beginning of larger XSL-FO file:
PM 77-1
  • 12,933
  • 21
  • 68
  • 111
0
votes
1 answer

How to prevent the long text beyond the boundary of the border in XSL-fo?

I need to display a long text in xsl-fo. I have used wrap-option also but it did not work and still overflowing occurs for the text. Kindly suggest any idea for this. The code is-
ankur777
  • 13
  • 1
  • 7
0
votes
0 answers

Images in DITA-OT

I'm creating a publication using DITA and the out of the box DITA-OT pdf2 plugin. The images are not scaling to fit the page, but instead are running huge and being cut off by the page. I prefer to keep the out of the box plugin in tact, so I first…
kmerin22
  • 1
  • 1
0
votes
1 answer

XSLT: Count the iteration of a cases inside a loop

I have two loops and want to count the iteration of cases OK and NotOK and overall cases inside xslt file. How I cold do so? If I want to know the sum of both iteration how could I write it? my For loops are as:
Royeh
  • 433
  • 5
  • 21
0
votes
1 answer

Merge and sort Elements in XSLT 2.0

How do I merge multiple XML structures with XSLT 2.0 and XSL-FO by grouping them by their 1st child (-entry) and then sort them from a to z? In detail from something like this: example
garlicDoge
  • 197
  • 1
  • 3
  • 18
0
votes
2 answers

Change conref during processing by xsl-fo

I read somewhere, that conditional importing is not possible in xsl-fo. Although I have small hope, that this is something else, and can be resolved. My problem is that I have something like that in one of my dita file:
Luzgan
  • 106
  • 10
0
votes
1 answer

For each in FOP xml

I'm generating a PDF through Apache FOP, and since now things are going pretty well. Now I need to loop through a list and display every element in it and to achieve this I'm using the command , but when FOP…
Luca
  • 823
  • 4
  • 11
  • 31
0
votes
1 answer

Step numbering in XSL-FO

Been struggling with this for a bit and now going to ask for help. I am trying to get the correct number for a step to appear when referencing it on PDF output when using XSL-FO. With help previously gotten here I have other references working as…
twfurst
  • 165
  • 2
  • 13
0
votes
1 answer

FOP image not showing after exported to jar

I'm referring to the problem and my answer in the following post: image in PDF from Apache FOP 1.1 with Java. I'm trying to display a background image (sort of a watermark) on every page:
Rick
  • 121
  • 14
0
votes
1 answer

How do I get the height of a table/element as a variable?

I have these set in tag I have a table declared in region-before. This is to make it repeat across every…
John Evans Solachuk
  • 1,953
  • 5
  • 31
  • 67
0
votes
2 answers

XSL-FO : How do I repeat an xsl table for every page?

I've done it previously by including the table in region-before AKA header section of xsl-fo. However, this introduces a problem of needing to dynamically set the margin-top of the region-body because the table's height is not fixed. Hence, I would…
John Evans Solachuk
  • 1,953
  • 5
  • 31
  • 67
0
votes
2 answers

Get the value from a attribute set attribute

Hi guys I want to implement a heading structure in my pdf. The different headers should get the value from the old one and add 2 mm to get a structure I use xslt 2.0 and antenna house xslt:
bvb1909
  • 191
  • 2
  • 6
  • 19
0
votes
2 answers

How to on one page sequence decide begining of a new node to insert different header

EDIT AFTER GETTING CORRECT RESULT: Ok, I managed to do that. Basically when I understand what really @Kevin wants me to do, I created empty marker on the begining of topic (with keep-with-next), and after title of topic is created I changed it to…
Luzgan
  • 106
  • 10
1 2 3
99
100