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

DITA and XSL-FO wrong rendering border

I have generated xsl-fo like that: http://pastebin.com/mQJq6tyB It is basically note placed in
tag (in dita file). The problem is, that when this is rendered it has additional border lines rendered on text, when text is longer than 3 lines.…
Luzgan
  • 106
  • 10
0
votes
1 answer

Converting docx to pdf ()

Few days ago I have faced with legacy code which processed .docx file as template and put values into placeholders. This system properly work until complex tables were inserted into template. I cant found solution except remake table. Maybe someone…
Ivan
  • 13
  • 5
0
votes
2 answers

adding attribute to an existing node

i need to add an attribute initial-page-number to a tag fo:sequence tha tag is .. ... become
robyp7
  • 481
  • 2
  • 7
  • 25
0
votes
1 answer

XSL-FO: Can fo:marker be used to store anything?

This question is part XSL-FO, part XSLT, and part DITA. In general, this question is an attempt to troubleshoot what I am doing wrong with fo:marker and to understand if what I am attempting is possible. I'm attempting to use fo:marker to store text…
Jason Davis
  • 65
  • 1
  • 8
0
votes
2 answers

How to generate OMR marks on PDF using XSLT? OMR marks will be changed based on page number

I have a requirement to generate OMR marks (can be 10 small lines like '-------') on PDF file where this PDF file template will be prepared using XSLT. The challenging is here for me is, based on the page numbers some OMR lines need to be hidden.…
0
votes
1 answer

docbook multi-column layout

trying to figure out how to control the text flow in a columned layout. I am using the lang="he" property, and have writing-mode set to rtl:
Mordechai
  • 718
  • 1
  • 8
  • 23
0
votes
1 answer

How to align the fo:leader vertically in order to have it on the one line with the text

I have a problem with vertical alignment of the leader object and I hope somebody can help me. I have a block with some text and the rule leader ends the line.
Harrison
  • 161
  • 8
0
votes
3 answers

How to generate a xslt file from xml

I'm beginner with xml and xsl. I'm looking for the way to generate or understanding how is the using of xsl stylesheet. In my particular case, I'm using a html file which it converts to xhtml. The next step I want to convert is the file generated to…
0
votes
1 answer

xsl:when not working in xsl-fo?

I have sample code like this:
Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
0
votes
1 answer

Page order for right-to-left languages (Arabic, Hebrew)

In most languages, books are made with the binding on the left side. The cover page is a right-side page, and a page spread consists of an even-numbered page on the left, and an odd-numbered page on the right. When you read the book in order, you…
Hobbes
  • 1,964
  • 3
  • 18
  • 35
0
votes
1 answer

XML Recursive Adding beyond parent node

I am trying to write XSL (1.0) to recursively add values from nodes. I have googled and it seems there are functions to add as long as the nodes are parent/child. My nodes are quite a few steps beyond that. For example, I have:
0
votes
1 answer

Splitting a particular column with a simple horizontal line

I am trying to split a particular column with a simple horizontal line .
master
  • 159
  • 1
  • 2
  • 13
0
votes
2 answers

XSL-FO: Two 8.5x11 "pages" on single 17x11 sheet (double page spread)

Is it possible in FO to have two 8.5x11 layouts on a single 17x11 page? I haven't been able to find anything that relates to this. The following image shows what I'm trying to achieve. Is this even possible? More information for people who weren't…
0
votes
1 answer

XSL-FO issue with page breaks

I am trying render a pdf with course information. I need a table of contents that breaks to a new page before content is produced. After the table of contents I need the content to be produced concurrently meaning no page break for each course. …
0
votes
3 answers

Sequentially group / process contents with XSLT 2.0 / XSL-FO

Meta XSLT 2.0 XSL-FO I have to do two things: 1.) I want to apply templates for certain nodes (p) that do not follow after a (x). So for the following example the only node that should be processed should be the first…
garlicDoge
  • 197
  • 1
  • 3
  • 18
1 2 3
99
100