Search code examples
xmlxsltxsl-fo

Are xsl-fo-elements part of xsl-files?


I try to understand how the workflow is to convert xml in html and pdf from a single source. I understand what a xml-file is, how it is structured etc. I understand what a dtd or a schemm is doing. And I also understand what a xsl file is doing, in case I want to convert xml in html. I know that from this files a xslt-processor is making a fo-file in case one wants to convert xml in pdf.

What I don´t understand so far is, if I need two xsl-files when I want html and pdf - one for every format. I guess not. But are then the fo-elements part of the same xslt-file, which defines the html-structure? If so, how are fo-elements are mixed with xslt-elements?

Hope I was clear in my description. Thanks for help, Pjoern


Solution

  • To generate HTML and PDF files from a single XML source document, you would typically have separate XSLT transformations for

    • XML-to-HTML
    • XML-to-XSL:FO (which would then be used to generate PDF)

    Yes, there will usually be HTML elements in the XML-to-HTML XSLT and XSL:FO elements in the XML-to-XSL:FO XSLT used to generate PDF.

    Think of XSLT as the generic XML transformation engine and XSL:FO as a particular XML vocabulary designed to be converted to PDF.