public void addNamespace ( String prefix , String namespaceURI ) { if ( prefix == null || namespaceURI == null ) { throw new IllegalArgumentException ( "null arguments not allowed." ) ; } if ( namespaceURI . equals ( XMLConstants . XML_NS_URI ) ) { throw new IllegalArgumentException ( "Adding a new namespace for " + XMLConstants . XML_NS_URI + "not allowed." ) ; } else if ( namespaceURI . equals ( XMLConstants . XMLNS_ATTRIBUTE_NS_URI ) ) { throw new IllegalArgumentException ( "Adding a new namespace for " + XMLConstants . XMLNS_ATTRIBUTE_NS_URI + "not allowed." ) ; } prefix2ns . put ( prefix , namespaceURI ) ; }
Add a prefix to namespace mapping .