public static QName tagToQName ( final String tag , final Map < String , String > nsRegistry ) { final String [ ] split = tag . split ( "\\:" ) ; if ( split . length <= 1 ) { return new QName ( split [ 0 ] ) ; } else { final String namespace = nsRegistry . get ( split [ 0 ] ) ; if ( namespace != null ) { return new QName ( namespace , split [ 1 ] ) ; } else { return new QName ( split [ 1 ] ) ; } } }
Transform a tag local or prefixed with a namespace alias to a local or full QName .