}
if (source.charAt(0) == '$') {
String name = source.substring(1, index);
Property compositeProp = compositeProperties.get(name);
if (compositeProp == null) {
throw new CompositeBuilderException("The 'source' cannot be resolved to a composite property: " + source);
}
Document compositePropDefValues = (Document)compositeProp.getValue();
// Adding /value because the document root is "value"
String path = source.substring(index);
String xpath = null;
if ("/".equals(path)) {
// trailing / is not legal for xpath
xpath = "/value";
} else {
xpath = "/value" + path;
}
// FIXME: How to deal with namespaces?
Document node = evaluate(null, compositePropDefValues, xpath);
if (node != null) {
aProperty.setValue(node);
}
} else {
throw new CompositeBuilderException("The 'source' has an invalid value: " + source);
}
} else if (file != null) {
aProperty.setValue(loadFromFile(aProperty.getFile()));
}