Renders an XSL-FO document.
<p:declare-step type="p:xsl-formatter"> <input port="source" primary="true" content-types="xml" sequence="false"/> <output port="result" primary="true" content-types="any" sequence="false"/> <option name="content-type" as="xs:string?" required="false" select="()"/> <option name="parameters" as="map(xs:QName,item()*)?" required="false" select="()"/> </p:declare-step>
The p:xsl-formatter
step expects a valid XSL-FO
document on its source
port. This is rendered, usually into PDF. The resulting rendition appears, as a binary document, on the
result
port.
Ports:
Port | Type | Primary? | Content types | Seq? | Description |
---|---|---|---|---|---|
|
|
|
|
| The XSL-FO document to render. |
|
|
|
|
| The resulting rendition. |
Options:
The p:xsl-formatter
step allows you to transform XML into some kind of rendition, usually PDF. To do this, you must first transform your XML into
XSL-FO. This can be done by several means, most
likely one or more XSLT transformations by p:xslt
. After this, the p:xsl-formatter
step renders the document for you.
In most cases, p:xsl-formatter
relies on an external XSL-FO formatter, for instance the open source FOP or one
of the commercial ones. You’ll probably have to do some XProc processor dependent configuration before this step will work. Please
consult the XProc processor documentation about this.
The following pipeline transforms an XSL-FO document into PDF using p:xsl-formatter
, and stores it as result.pdf
:
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0"> <p:input port="source"/> <p:output port="result" pipe="result-uri@store-pdf"/> <p:xsl-formatter/> <p:store href="result.pdf" name="store-pdf"/> </p:declare-step>
The document appearing on the result
port only has a content-type
property. It has no other
document-properties (also no base-uri
).
This description of the p:xsl-formatter
step is for XProc version: 3.1. This is a non-required step (an XProc 3.1 processor does not have to support this).
The formal specification for the p:xsl-formatter
step can be found here.
The p:xsl-formatter
step is part of categories:
The p:xsl-formatter
step is also present in version:
3.0.