String localPart = null;
if (idx != -1) {
String prefix = schemaContext.substring(0, idx);
localPart = schemaContext.substring(idx + 1);
String uri = oldNsResolver.resolveNamespacePrefix(prefix);
String newUri = newNsResolver.resolveNamespacePrefix(prefix);
//if we know the uri but the record has a different prefix or no prefix we need to update or generate a new one if necessary
if(uri != null && (newUri == null || !(newUri.equals(uri)))){
//get the prefix from the record for the given uri
prefix = newNsResolver.resolveNamespaceURI(uri);
//if not then we need to generate one and write it out