String getNamespaceAliasForUriErrorOnUnknown ( String namespaceUri ) { String result = getAliasForUri ( namespaceUri ) ; Preconditions . checkArgument ( result != null , "invalid XML: no alias declared for namesapce <%s>; " + "work-around by setting XML namepace directly by calling the set method of %s" , namespaceUri , XmlNamespaceDictionary . class . getName ( ) ) ; return result ; }
Returns the namespace alias to use for a given namespace URI throwing an exception if the namespace URI can be found in this dictionary .