public String namespace ( String name , boolean attribute ) { int colon = name . indexOf ( ' ' ) ; if ( colon == - 1 ) { return attribute ? "" : theSchema . getURI ( ) ; } String prefix = name . substring ( 0 , colon ) ; if ( prefix . equals ( "xml" ) ) { return "http://www.w3.org/XML/1998/namespace" ; } else { return ( "urn:x-prefix:" + prefix ) . intern ( ) ; } }
Return a namespace name from a Qname . The attribute flag tells us whether to return an empty namespace name if there is no prefix or use the schema default instead .