XML
Template
Post
XML Template Expression
You can use XML template expression to construct an XML value.
✍ Syntax
XML Template
xml ` BacktickItem* Dollar* `
Here
- BacktickItem := BacktickSafeChar| BacktickDollarsSafeChar| Dollar* interpolation
- interpolation :=
${expression} - BacktickSafeChar := ^ (
`|$) - BacktickDollarsSafeChar :=
$+ ^ ({|`|$) - Dollar :=
$
bal run xml_template.bal
<person>
<name>tom</name>
<age>25</age>
</person>
bal versionBallerina 2201.6.0 (Swan Lake Update 6)
XML Template Expression Example