Escaping XML transforms

I have a Template:

< test>{{ index . “test” }}</ test>

And a json payload:

{“test”: " < "}

This outputs:

< test> < < /test>

Which is clearly invalid xml. How does one output the values but XML/HTML escaped correctly?

Last year jsonMarshal function was added to body transforms so that one could escape json output properly.

Is there a similar method but one for XML?

Anyone have any ideas?

I see your point.

We definitely need to create xmlMarshal function as well.

Can you create a ticket in Github?

PR for this should be actually quite small, and almost exactly same as for json:

I’ve created a ticket in github: