Name

cx:javascript — Evaluate steps implemented in JavaScript.

Synopsis

This step runs a JavaScript program as the implementation of a step.

Input portPrimarySequenceContent typesDefault binding
source✔ ✔  p:empty
program  text 
Output portPrimarySequenceContent typesDefault binding
result✔   
Option nameTypeDefault value
argsxs:string*()
parametersmap(xs:QName,item()?)?()
result-content-typexs: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:javascript 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:javascript step runs a JavaScript program as the implementation of a step.

For more information, see cx:polyglot.