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

How to create internal links from table-row to table in XSL?

Using xsl-fo, I have a table presenting a summary of my data. Each table-row in this summary table corresponds to a table containing all the information of the given row I would like to create internal links between the summary table-rows and the…
Bjarke Moholt
  • 313
  • 1
  • 4
  • 20
0
votes
2 answers

Commercial FO processors in eXist-db

For my project, I would like to test XEP and AH Formatter. I like FOP but in some cases it really fails (floats, crop marks, pdf/x standards, etc.) and I need to know some alternatives. XEP With XEP I am very close. I have copied all jars into…
Honza Hejzl
  • 874
  • 8
  • 23
0
votes
0 answers

Autosized page in XSL-FO?

is it possible to program a XSL-FO template using an autosized page-width and page-height expression?
placebo
  • 11
  • 6
0
votes
1 answer

Load existing .XSLT to a GUI, make changes, save new .XSLT?

I am a Business Analyst and we have a bespoke middleware solution that takes .XML files and uses an .XSLT template to generate a .PDF. This is a background process that occurs hundreds of times a day. We have no idea who wrote the .XSLT templates,…
JungleJme
  • 21
  • 4
0
votes
1 answer

Validation error for XSL-FO file in eXist-db (using Jing and Jaxp)

I am intensively testing the production of pdfs in my app based on eXist-db. The validation scenario is quite straightforward: let $doc := xmldb:document('/db/apps/my-app/data/test.fo') let $grammar :=…
Honza Hejzl
  • 874
  • 8
  • 23
0
votes
1 answer

How to span a table in a multi-columned layout in XSL-FO?

How to make fo:table to span across two columns? I have tried to wrap it into but that does not work. Is it possible at all?
Honza Hejzl
  • 874
  • 8
  • 23
0
votes
1 answer

How do I transform an XML-File into a FO-file using XSL?

I need to tranform a basic xml file into a FO file using xsl. The xml looks like this : Provincie Antwerpen Gasmeters
Jonas
  • 1
0
votes
1 answer

Columns and footnotes in XSL-FO

I am trying to style an article, which has to be two-clumned. Is there any way how to get footnotes work properly in a such scenario? I am using FOP 1.1. Styles: Page masters. Params. The problem: As this official example shows on page 2, it could…
Honza Hejzl
  • 874
  • 8
  • 23
0
votes
0 answers

Accessible List Bullets

I am creating an accessible PDF file using FOP-API with XSL templates and XML input. I need to show nested lists but I only have one standard bullet shape (bullet - •) which is read by all screen readers. Since I have nested lists, I need to…
kek
  • 53
  • 6
0
votes
2 answers

xslt fo does not show chinese or thai fonts

I am Convert a XSLT to PDF with Chinese characters in it. I am using Fonet.dll and csharp . I have added Chinese language's i.e. ZH and ZHT in the regional languages under control panel. I am following the code example to generate the pdf The XSLT…
user1339913
  • 1,017
  • 3
  • 15
  • 36
0
votes
3 answers

Use multiple columns if the number of items in a list to be displayed are more than 5

I am trying to format my list using FORMATTING OBJECTS which is in this format. XML Item1 Item2 Item3
SkoolCodeian
  • 127
  • 1
  • 14
0
votes
1 answer

How can I Determine If a Page Overflows into Additional Page with XSL-FO?

I have a xsl:for-each that recursively adds fo:table elements. Before xsl:for-each I have a "title" block. What I'm wondering is if I can determine if the table overflows into another page and allow me to "inject" the title block again. This way I…
John Giotta
  • 16,432
  • 7
  • 52
  • 82
0
votes
2 answers

how to insert a blank line without affecting the order in XSL-FO

The XML contains multiple PrintSections and they have multiple Text and Barcode sections. I need to output a blank line after the first PrintSection (or at least every PrintSection) without changing the order in which they are present in the XML.…
Vivek Vijayan
  • 337
  • 5
  • 19
0
votes
1 answer

Is it possible to have row headers in an XSL-FO table?

I am not sure if my title has asked this correctly, so let me try to explain in case I haven't. The first row of the table is a header-row, no issues with making that happen. The first column, from the second row onward is effectively a…
twfurst
  • 165
  • 2
  • 13
0
votes
1 answer

Images in XSL-FO in eXist-db

In my former question I have touched a broader problem of paths and their recognizing inside an eXist-db app. At the moment, I am not able to get images in to PDF files. I have tried 2 installations of eXist (2.2 and 3RC) and many possible…
Honza Hejzl
  • 874
  • 8
  • 23