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

Why Does Table-Cell Border Not have Corners?

I'm experiencing some strangeness while adding a thick border to a table-cell. Why aren't there corners?
John Giotta
  • 16,432
  • 7
  • 52
  • 82
0
votes
1 answer

XSl-FO can every content be dynamic?

I am trying to create FO file based on XML file which I have Created from my source. XML :
Pranav Shah
  • 91
  • 1
  • 2
  • 12
0
votes
1 answer

Apache FOP: ValidationException: The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table

I am getting cryptic error messages trying to render a pdf file using xml: Exception at /url/ ('Unable to generate PDF.', b'Exception\norg.apache.fop.apps.FOPException: org.apache.fop.fo.ValidationException: The column-number or number of cells in…
codyc4321
  • 9,014
  • 22
  • 92
  • 165
0
votes
2 answers

Transforming XML to group fields into columns with XSLT

I currently have an XML file which looks like the following: Fred Bloggs CEO Everything Joe…
pwaring
  • 3,032
  • 8
  • 30
  • 46
0
votes
1 answer

XSl-FO Repeating values in table - version 1.0

Using xsl-fo Creating one report which will generate PDF file based upon FO file. Problem: If you see below code i have created Detail Area with Columns and Row Separator(Grid view, frame yes). Its working Fine but whenever i use XML Node Path and…
Pranav Shah
  • 91
  • 1
  • 2
  • 12
0
votes
1 answer

Unable to Successfully Pass Parameters to xsl:call-template

I have a generic template I've designed with 2 params title and category.
John Giotta
  • 16,432
  • 7
  • 52
  • 82
0
votes
0 answers

XSL-FO external-graphic not showing uri is not recognized

Issue Load a image using the fo:external-graphic tag. I have a parameter with the base64 value of the image. data:image/jpg;base64,/9j/4AAQSkZJRgA.. I have tried to load the image using
user1339913
  • 1,017
  • 3
  • 15
  • 36
0
votes
1 answer

Trying to access multiple nodes in a for each

In my XML there is multiple nodes ex. CAT1, CAT2, CAT3,...,CAT(N). and I want to display their values but it's dynamic and based of NUMOFCATS. some psuedo code for that i want for(i=0;i
Dstjohniii
  • 5
  • 1
  • 4
0
votes
1 answer

XSL fo Create a Table Dynamically

I need to create a table in by calling a template in XSL:FO For e.g. I was hoping to call a template function Table Template Create table by using the fo:table tags and call the column template and pass a parameter…
user1339913
  • 1,017
  • 3
  • 15
  • 36
0
votes
1 answer

XSL-FO implementing pictures with a loop

My Problem is that I have an XML File with a valid structure and all of the pictures are placed in the following path.
Alexander
IN XSL the…
Mchoeti
  • 536
  • 1
  • 8
  • 24
0
votes
1 answer

Turn rows into columns in XSL:FO

Trying to create a table where rows are turned into columns so that I can logically group the columns in XML. The XML s something like this: field1.row1 field1.row2
eboni
  • 883
  • 2
  • 10
  • 25
0
votes
1 answer

How to create hyperlink within PDF (which is opened in browser) which will open in a new tab/window

I generate some PDF via XSLT transformation (FOP) from XML. The PDF file is opened in the browser. If it contains any hyperlink, that hyperlink is supposed to open in a new browser tab/window. I'm quite not sure if it is even possible. Any insights?
Zdenek F
  • 1,649
  • 1
  • 15
  • 27
0
votes
1 answer

Grid-table format in XSLT

I have the following XML: Swap_Conversion Swap_Conversion
KRS
  • 3
  • 5
0
votes
1 answer

Can we wrap the text to next line when it exceeds table cell length in XSL-FO?

I need to wrap the text to next line if it exceeds the length of the table cell in XSL-FO. Sample XSL-FO:
0
votes
1 answer

Changing the height of block container dynamically in XSLT

We have a requirement to generate PDF using FOP. Here I am facing an issue with changing the height of block container dynamically in XSLT. I have tried with setting minimum & maximum height. If that is the case, if we give less content, the…