String newPrefix = marshalRecord.getMarshaller().getNamespacePrefixMapper().getPreferredPrefix(entry.getValue(), prefix, true);
if(newPrefix != null && !(newPrefix.length() == 0)) {
prefix = newPrefix;
}
}
String uri = marshalRecordNamespaceResolver.resolveNamespacePrefix(prefix);
if(marshalRecord.hasCustomNamespaceMapper() || allowOverride || uri == null || uri.length() == 0) {
//if this uri is unknown, the cutom mapper will return the preferred prefix for this uri
marshalRecordNamespaceResolver.put(entry.getKey(), entry.getValue());
returnList.add(new Namespace(prefix, entry.getValue()));
}