ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sagi Mann <>
Subject AntX: $map example from guide fails when key is missing?
Date Wed, 10 Dec 2008 18:07:25 GMT

Hi all,
I'm trying to adopt example #2 from the $map URI guide: 

like so:
For each property in the 'p1' set, I print the value of the same property in
set 'p2'. For testing purposes, I print this TWICE: once by directly
and second by assigning the values to variables first, then echo the

<ax:foreach i="key" list="${$map:p1?keys}" mode="local">
		<echo message="prop ${key}: expected=${$map:p1?@(key)}
		<ax:assign name="expected" value="${$map:p1?@(key)}"/>
		<ax:assign name="existing" value="${$map:p2?@(key)}"/>
		<echo message="prop ${key} values: expected=${$var:expected}

If p1 and p2 contain the same property keys, all is ok. If p1 contains a
property that does NOT exist in p2, the first echo is ok and displays (as it
prop myprop: expected=1 existing=${$map:p2?@(key)}
But the second assign fails with the error:
Syntax error in property: ${key

I need to be able to assign the result to variables (or use it in a domatch
value attribute, which generates the same error). Does someone has any idea
why this does not work properly?

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message