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 © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback