Name
cx:python — Evaluate steps implemented in Python.
Synopsis
This step runs a Python program as the implementation of a step.
Input port | Primary | Sequence | Content types | Default binding |
---|---|---|---|---|
source | ✔ | ✔ | p:empty | |
program | text |
Output port | Primary | Sequence | Content types | Default binding |
---|---|---|---|---|
result | ✔ |
Option name | Type | Default value |
---|---|---|
args | xs:string* | () |
parameters | map(xs:QName,item()?)? | () |
result-content-type | xs:string? | () |
This is an extension step; to use it, your pipeline must include its declaration.
For example, by including the extension library with an import at the top of your
pipeline:
<p:import href="https://xmlcalabash.com/ext/library/polyglot.xpl"/>
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc">
| <p:input port="source" primary="true" sequence="true">
| <p:empty/>
| </p:input>
5 | <p:input port="program" content-types="text"/>
| <p:output port="result"/>
| <p:option name="args" as="xs:string*"/>
| <p:option name="result-content-type" as="xs:string?"/>
| <p:option name="parameters" as="map(xs:QName,item()?)?"/>
10 |</p:declare-step>
Installation
The cx:python
step is not included in the standard XML Calabash release.
You must
obtain it separately
and install it on your classpath before you can use this step.
See cx:polyglot
for more details.
Description
The cx:python
step runs a Python program as the implementation
of a step.
For more information, see cx:polyglot
.