<json-format></json-format>
Provided by module: Tags: RXML tags
Formats a JSON string. The input value may be a
number, string, array, mapping, or one of the special values
&roxen.true;, &roxen.false;, or
&roxen.null;.
Note: In some cases it may be easier to write the JSON answer as a
plain string and substitute some values into it. In that case, the
"json" encoding is more useful:
{"user": "&var.username:json;",
"name": "&var.fullname:json;"} |
Attributes
- value="string"
-
The value to format.
- variable="string"
-
Get the value to format from this variable, unless value has been
provided. If neither is specified the content of the container is used.
- ascii-only
-
Set to generate JSON output where all non-ASCII characters are escaped.
If not set only required characters are escaped.
- human-readable
-
Set to generate JSON output with extra whitespace for easier reading.
- canonical="pike"
-
Use canonical="pike" to generate JSON output where the same
input always gives consistent output with regards to e.g. mapping
sorting. If not provided the order is undefined.
- no-xml-quote
-
Set to skip escaping of XML markup characters (&,
< and >). The standard behavior is to escape
these characters using \uXXXX encoding.