public static QName convertStringToQName(String str,Element element){
  if (str == null) {
    return null;
  }
  String prefix="";
  String localPart;
  int index=str.indexOf(":");
  if (index == -1) {
    localPart=str;
  }
 else {
    prefix=str.substring(0,index);
    localPart=str.substring(index + 1);
  }
  String ns=getNamespaceForPrefix(prefix,element);
  return new QName(ns,localPart);
}

public static QName convertStringToQName ( String str , Element element ) { if ( str == null ) { return null ; } String prefix = "" ; String localPart ; int index = str . indexOf ( ":" ) ; if ( index == - 1 ) { localPart = str ; } else { prefix = str . substring ( 0 , index ) ; localPart = str . substring ( index + 1 ) ; } String ns = getNamespaceForPrefix ( prefix , element ) ; return new QName ( ns , localPart ) ; }
converts a string value to a qname . the prefix of the string value is resolved to a namespace relative to the element .
