nudef.setPreparer(replace(d.getPreparer(), vars));
nudef.setRole(replace(d.getRole(), vars));
nudef.setTemplate(replace(d.getTemplate(), vars));
for (String attributeName : d.getLocalAttributeNames()) {
Attribute attr = d.getLocalAttribute(attributeName);
Attribute nuattr = new Attribute();
nuattr.setRole(replace(attr.getRole(), vars));
nuattr.setRenderer(attr.getRenderer());
Object value = attr.getValue();
if (value instanceof String) {
value = replace((String) value, vars);
}
nuattr.setValue(value);
nudef.putAttribute(replace(attributeName, vars), nuattr);
}
return nudef;