public String [ ] lookupAllPrefixes ( String uri ) { java . util . ArrayList foundPrefixes = new java . util . ArrayList ( ) ; Enumeration prefixes = m_namespaces . keys ( ) ; while ( prefixes . hasMoreElements ( ) ) { String prefix = ( String ) prefixes . nextElement ( ) ; String uri2 = lookupNamespace ( prefix ) ; if ( uri2 != null && uri2 . equals ( uri ) ) { foundPrefixes . add ( prefix ) ; } } String [ ] prefixArray = new String [ foundPrefixes . size ( ) ] ; foundPrefixes . toArray ( prefixArray ) ; return prefixArray ; }
Given a namespace uri get all prefixes bound to the Namespace URI in the current scope .