- (fun l ->
- try
- (match Pcre.split ~rex:index_line_sep_RE l with
- | [uri; "gz"] -> xml_map#add uri ((xml_url_of_uri uri) ^ ".xml.gz")
- | [uri] -> xml_map#add uri ((xml_url_of_uri uri) ^ ".xml")
- | _ -> log := !log ^ "Ignoring invalid line: " ^ l ^ "<br />\n")
- with Http_getter_invalid_URI uri ->
- log := !log ^ "Ignoring invalid XML URI: " ^ uri ^ "<br />\n")
- (Pcre.split ~rex:index_sep_RE xml_index)) (* xml_index lines *)
+ (function
+ | l when is_blank_line l -> () (* skip blank and commented lines *)
+ | l ->
+ try
+ (match Pcre.split ~rex:index_line_sep_RE l with
+ | [uri; "gz"] ->
+ assert (is_cic_uri uri || is_nuprl_uri uri) ;
+ (map_of_uri uri)#add uri ((xml_url_of_uri uri) ^ ".xml.gz")
+ | [uri] ->
+ assert (is_cic_uri uri || is_nuprl_uri uri) ;
+ (map_of_uri uri)#add uri ((xml_url_of_uri uri) ^ ".xml")
+ | _ ->
+ log := !log ^ "Ignoring invalid line: '" ^ l ^ "'<br />\n")
+ with Http_getter_invalid_URI uri ->
+ log := !log ^ "Ignoring invalid XML URI: '" ^ uri ^ "'<br />\n")
+ (Pcre.split ~rex:index_sep_RE xml_index)) (* xml_index lines *)