Name

p:message — The standard p:message step.

Synopsis

The p:message step writes a message conditionally.

Input portPrimarySequenceContent types
source✔ ✔  
Output portPrimarySequenceContent types
result✔ ✔  
Option nameTypeDefault valueRequired
selectitem()* ✔ 
testxs:booleantrue() 
Declaration
1 |<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" type="p:message">
  |   <p:input port="source" sequence="true"/>
  |   <p:output port="result" sequence="true"/>
  |   <p:option name="test" as="xs:boolean" select="true()"/>
5 |   <p:option name="select" as="item()*" required="true"/>
  |</p:declare-step>

Description

The p:message step is a standard XProc 3.0 step. It is also described on XProcRef.org.

Caution

The XProc 3.1 specification for p:message is under specified. The semantics described here are speculative, and may change when a final proposal is accepted.

If the test option evaluates to true, the select option is evaluated and each item in the resulting sequence is displayed as a message:

For maps and arrays

The message is generated by serializing the item with these properties: map{'method':'json', 'indent':true()}.

For nodes

The message is generated by serializing the item with these properties: map{'method':'xml', 'indent':true()}.

For all other values

The message is the string value of the item.

If the test option is false, no messages are displayed.

In either case, this step behaves like the p:identity step.