"<bean alpha='${attr1}' beta='var{attr1}'/>" +
"<bean alpha='${attr2}' beta='var{attr2}'/>" +
"</root>";
StringReader input = new StringReader(xml);
Digester digester = new Digester();
// Configure the digester as required
HashMap source1 = new HashMap();
source1.put("attr1", "source1.attr1");
source1.put("attr2", "source1.attr2"); // should not be used
HashMap source2 = new HashMap();
source2.put("attr1", "source2.attr1"); // should not be used
source2.put("attr2", "source2.attr2");
MultiVariableExpander expander = new MultiVariableExpander();
expander.addSource("$", source1);
expander.addSource("var", source2);
digester.setSubstitutor(new VariableSubstitutor(expander));
digester.addObjectCreate("root/bean", SimpleTestBean.class);
digester.addSetProperties("root/bean");
digester.addSetNext("root/bean", "addSimpleTestBean");
// Parse our test input.
this.simpleTestBeans.clear();
digester.push(this);
digester.parse(input);
assertEquals(2, this.simpleTestBeans.size());
{
SimpleTestBean bean = (SimpleTestBean) this.simpleTestBeans.get(0);