# Templating

FLAT's template language is intended to dynamically generate JSON documents.

Basically, you provide the skeleton of the JSON object you want to create, and use _placeholders_ instead of literal values. The language supports _template commands_ that are documented below. _Template expressions_ and [functions](functions) offer rich means of accessing request and response data in JSON, HTML or XML ([OXN](templating/oxn)).

## [Comment `{{// <comment>}}`](templating/comment)

## [Placeholder `{{ <expression> }}`](templating/placeholder)

## [Dot `{{.}}`](templating/dot)

## [Comma `{{,}}`](templating/comma)

## [Pair Producer `{{: <expression> }}`](templating/pair-producer)

## [Variable Definition `{{$<name> := <expression> }}`](templating/variable)

## [Conditional `{{if <condition>}} … {{elseif <condition> }} … {{else}} … {{end}}`](templating/if)

## [Loop `{{loop <array>}} … {{end}}`](templating/loop)

## [Context Switch `{{with <expression>}} … {{else}} … {{end}}`](templating/with)

## [Null Coalescing Operator `??`](templating/null-coalescing-operator)
