}
Property<?> aliasProperty = axisHierarchy.getProperty(AxisHierarchy.USE_ALIAS);
updateAlias(axisHierarchy, alias);
HashMap <String, String> allElems = new HashMap<String, String>();
traverse(axisHierarchy.getRootNodes(), allElems);
Property prop = axisHierarchy.getProperty("aliasFormat");
String aliasFormat = null;
if (prop != null && prop.getValue() != null) {
aliasFormat = prop.getValue().toString();
}
for (XElementNode node: allNodes) {
String newName = allElems.get(node.getElement().getId());
if (newName != null) {
if (aliasFormat == null) {
node.setName(newName);
node.getElement().setName(newName);
} else {
String name = getAliasForElement(newName, node.getElement().getName(), aliasFormat);
node.setName(name);
node.getElement().setName(name);
}
}
}
if (aliasProperty != null) {
axisHierarchy.addProperty(aliasProperty);
} else {
axisHierarchy.removeProperty(new Property(AxisHierarchy.USE_ALIAS, ""));
}
return allNodes;
}