Integrate Software AG Products Using Digital Event Services 10.4 | Integrate Software AG Products Using Digital Event Services | MashZone NextGen Help | Appendix | Legacy Presto components | Mashables and Mashups | Mashups in EMML | Advanced Mashup Techniques | Making Mashup Scripts Dynamic | Dynamic Mashup Syntax | Escape XML Delimiters Inside <template> Expressions
 
Escape XML Delimiters Inside <template> Expressions
When you build expressions with <template> that use XML delimiters natively in the expression, you need to double-escape XML delimiters. This is required because <template> expressions are evaluated twice to fully resolve expressions.
A common example is building URLs with <template> to use in <directinvoke>. URLs that contain query parameters use the & character to separate the parameter/value pairs. In this case, you need to escape the & character twice to avoid syntax errors. For example:
<template outputvariable="geoCodeEndpoint"
expr="http://maps.google.com/maps/geo?q={$address}&amp;amp;output=xml"/>
<directinvoke endpoint="$geoCodeEndpoint" method="GET"
outputvariable="geocode"/>
The first evaluation resolves &amp;amp; to &amp; which is then properly resolved in the second evaluation when the mashup script is run to &.

Copyright © 2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release