/** * Get a prefix from {@link #bindings} but throw a {@link NamespaceBindingException} if none found. */ protected String getPrefix(String namespaceURI) { final String prefix = bindings.getPrefix(namespaceURI); if (prefix != null) { return prefix; } else { throw new NamespaceBindingException(format("Namespace URI %s is not bound to a prefix", namespaceURI)); } }