The p:css-formatter step applies [CSS]
formatting to an XML or HTML document.
The output of this step is often, but not necessarily, a PDF document.
Summary
| Input port | Primary | Sequence | Content types | Default binding |
|---|---|---|---|---|
| source | xml html | |||
| stylesheet | ✔ | text | p:empty |
| Output port | Primary | Sequence | Content types | Default binding |
|---|---|---|---|---|
| result | ✔ | any |
Errors
| Error code | Description |
|---|---|
| err:XC0166 | It is a dynamic error if the requested document cannot be produced. |
| err:XC0204 | It is a dynamic error if the requested content-type is not supported. |
| err:XD0079 | It is a dynamic error if a supplied content-type is not a valid media type of the form “type/subtype+ext” or “type/subtype”. |
Implementation details
| Implementation | Description |
|---|---|
| Defined | The use of media type parameters on the content-type option is implementation-defined. |
| Defined | If the content-type option is not specified, the output type is implementation-defined. |
| Defined | The precise way that the p:css-formatter step selects stylesheets is implementation-defined. |
| Defined | A formatter may take any number of optional rendering parameters via the step's parameters; such parameters are defined by the CSS implementation used and are implementation-defined. |
| Defined | The CSS level and the particular CSS features supported by p:css-formatter are implementation-defined. |
Declaration
<p:declare-step type="p:css-formatter">
<p:input port="source" content-types="xml html"/>
<p:input port="stylesheet" content-types="text" sequence="true">
<p:empty/>
</p:input>
<p:output port="result" content-types="any"/>
<p:option name="parameters" as="map(xs:QName,item()*)?"/>
<p:option name="content-type" as="xs:string?"/> </p:declare-step>
The document on the source port is formatted using one
or more CSS stylesheets.
The content-type of the output is controlled by the
content-type option. This option specifies a media
type as defined by [IANA Media Types].
It is a dynamic error (err:XD0079) if a supplied content-type is not
a valid media type of the form
“”
or “type/subtype+ext”.
The option may
include media type parameters as well (e.g.
"application/someformat; charset=UTF-8"). The use of media type
parameters on the type/subtypecontent-type option is
implementation-defined.
If the content-type option is not
specified, the output type is
implementation-defined. The default
should be PDF.
It is a dynamic error (err:XC0204) if the requested
content-type is not supported.
If one or more stylesheets are provided on the stylesheet port,
they should be used.
The precise way that the p:css-formatter step selects
stylesheets is implementation-defined.
Because CSS stylesheets may have import statements that rely on relative
URI references, it may be more convenient for authors and implementors to
allow stylesheets to be specified as a list of URIs (in, for example,
one of the parameters).
A formatter may take any number of optional rendering
parameters via the step's parameters; such parameters
are defined by the CSS implementation used and are
implementation-defined.
The CSS level and the particular CSS features supported by
p:css-formatter are
implementation-defined.
It is a dynamic error (err:XC0166) if the requested document
cannot be produced.
Document properties
No document properties are preserved.