XProc steps

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

p:www-form-urldecode

<p:declare-step type="p:www-form-urldecode">
   <p:output port="result"/>
   <p:option name="value" required="true"/> <!-- string -->
</p:declare-step>

The <p:www-form-urldecode> step decodes strings (these become part of the “value“ option) which correspond to the so-called x-www-form-urlencoded format into parameters (c:param) and outputs them at its output port (“result“).

Example

In the following example an appropriate value is passed on to the step. This value shall be transformed into two parameters.

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
   <p:input port="source"/>
   <p:output port="result"/>
   <p:www-form-urldecode value="ExampleName=TestValue&ExampleName2=TestValue2"/>
</p:declare-step>

After the execution of this process, the result is as follows:

<c:param-set>
   <c:param name="ExampleName" value="TestValue"/>
   <c:param name="ExampleName2" value="TestValue2"/>
</c:param-set>