public static String getFormatFromXmlReader ( Reader xmlReader ) { Map < String , String > attributes = getAttributesFromXmlReader ( xmlReader ) ; String baseDictUri = attributes . get ( NAACCR_XML_ROOT_ATT_BASE_DICT ) ; String recordType = attributes . get ( NAACCR_XML_ROOT_ATT_REC_TYPE ) ; if ( baseDictUri != null && recordType != null ) { String version = NaaccrXmlDictionaryUtils . extractVersionFromUri ( baseDictUri ) ; if ( NaaccrFormat . isVersionSupported ( version ) && NaaccrFormat . isRecordTypeSupported ( recordType ) ) return NaaccrFormat . getInstance ( version , recordType ) . toString ( ) ; } return null ; }
Returns the NAACCR format of the given XML reader .