void initialize() throws NamespaceException { NamespaceMapping mapping = cndReader.getNamespaceMapping(); newURI = mapping.getURI(namespace); if (oldURI != null && oldURI.equals(newURI)) { newPrefix = oldPrefix = namespace; } else { newPrefix = namespace + "_" + newURI.substring(newURI.lastIndexOf('/') + 1).replace('.', '_'); } }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the namespace URI for the * given <code>prefix</code>. */ public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getURI(prefix); }
/** * This default implementation first calls {@link #checkSessionInfo(SessionInfo)} * with the <code>sessionInfo</code>, then returns the namespace URI for the * given <code>prefix</code>. */ public String getNamespaceURI(SessionInfo sessionInfo, String prefix) throws NamespaceException, RepositoryException { checkSessionInfo(sessionInfo); return namespaces.getURI(prefix); }
private void add(NamespaceMapping mapping) { for (Object o : mapping.getPrefixToURIMapping().keySet()) { try { String pfx = (String) o; String uri = mapping.getURI(pfx); nsMapping.setMapping(pfx, uri); } catch (NamespaceException e) { throw new IllegalStateException("Error while transferring mappings.", e); } } }
newUri = nsmap.getURI(prefix);