status = merged.getStatus();
//TODO: should namespace be added to ModuleDescriptor interface, so we don't
// have to do this kind of check?
if (merged instanceof DefaultModuleDescriptor) {
Namespace ns = ((DefaultModuleDescriptor) merged).getNamespace();
if (ns != null) {
namespace = ns.getName();
}
}
if (namespace == null) {
namespace = attributes.getValue("namespace");
}
extraAttributes = merged.getQualifiedExtraAttributes();
} else {
//get attributes from raw XML, performing property substitution
organisation = substitute(settings, attributes.getValue("organisation"));
rev = substitute(settings, attributes.getValue("revision"));
branch = substitute(settings, attributes.getValue("branch"));
status = substitute(settings, attributes.getValue("status"));
namespace = substitute(settings, attributes.getValue("namespace"));
extraAttributes = new LinkedHashMap(attributes.getLength());
for (int i = 0; i < attributes.getLength(); i++) {
String qname = attributes.getQName(i);
if (!STD_ATTS.contains(qname)) {
extraAttributes.put(qname, substitute(settings, attributes.getValue(i)));
}
}
}
//apply override values provided in options
if (revision != null) {
rev = revision;
}
if (options.getBranch() != null) {
branch = options.getBranch();
}
if (this.status != null) {
status = this.status;
}
//if necessary translate mrid using optional namespace argument
ModuleRevisionId localMid = ModuleRevisionId.newInstance(organisation, module, branch,
rev, ExtendableItemHelper.getExtraAttributes(settings, attributes,
new String[] {"organisation", "module", "revision", "status", "publication",
"namespace"}));
ModuleRevisionId systemMid = ns == null ? localMid : ns.getToSystemTransformer()
.transform(localMid);
write("<info");
if (organisation != null) {
write(" organisation=\"" + XMLHelper.escape(systemMid.getOrganisation()) + "\"");