public String addMapping ( String prefix , String uri ) { String [ ] strs = mNsStrings ; int phash = prefix . hashCode ( ) ; for ( int ix = mScopeStart , end = mScopeEnd ; ix < end ; ix += 2 ) { String thisP = strs [ ix ] ; if ( thisP == prefix || ( thisP . hashCode ( ) == phash && thisP . equals ( prefix ) ) ) { // Overriding an existing mapping String old = strs [ ix + 1 ] ; strs [ ix + 1 ] = uri ; return old ; } } // no previous binding, let's just add it at the end if ( mScopeEnd >= strs . length ) { // let's just double the array sizes... strs = DataUtil . growArrayBy ( strs , strs . length ) ; mNsStrings = strs ; } strs [ mScopeEnd ++ ] = prefix ; strs [ mScopeEnd ++ ] = uri ; return null ; }
Method to add a new prefix - to - URI mapping for the current scope . Note that it should NOT be used for the default namespace declaration