Skip to main content

Encode JSON

Anatomy

<encode:json var="var" var_result="var" pretty="bool"/>

Description: ENCODE:JSON generates the JavaScript Object Notation (JSON) representation of the structural value of a variable according to RFC 4627.

ENCODE:JSON is the complement of the DECODE:JSON operation.

Attributes

NameTypeDescriptionDefined By
varvarVariable name encode:json
var_resultvarResult variable name encode:json
prettyboolPretty print encode:json

Results:

BindingTypePredicate
var_resultstringN/A

Examples

Example

<array var="names">
<item key="bg">Bill Gates</item>
<item key="sj">Steve Jobs</item>
</array>

<output>
<encode:json var="names"/>
</output>

<!-- {"bg":"Bill Gates","sj":"Steve Jobs"} -->