Adding Special Characters to Data
When you transform data in EMML, you may need to add white space, control or other special characters to data. For example, transforming data into a URL that has parameters and uses the & character or adding line feed characters in a string.
Because EMML is XML, you can do this using XML character entities for the special characters and XPath functions to append the characters.
The next example shows an <assign> statement that adds a line feed to the end of a string:
<assign fromexpr="concat($line,'
')" outputvariable="$line" />
The second string, 
, is the XML character entity for a line feed character.
The next example loops through an XML variable with parameters to add to a URL:
...
<!-- If there are parameters, add ? -->
<if condition="$svcResult/parameters/parameter">
<assign fromexpr="concat($thisUrl, ’?’)" outputvariable="$thisUrl"/>
</if>
<foreach variable="thisParam" items="$svcResult/parameters/parameter">
<assign fromexpr="concat($thisURL, $thisParam/name, ’=’, $thisParam/value)"
outputvariable="$thisUrl"/>
<!-- If there are more parameters, add & -->
<if condition="$thisParam/following-sibling::parameter">
<assign fromexpr="concat($thisUrl,’&’)" outputvariable="$thisURL"/>
</if>
</foreach>
...