+ | None -> assert false) in
+ (* and now some stuff to remove #xpointers and duplicates *)
+ let cleaned_uris =
+ List.map (fun x -> Str.replace_first (Str.regexp "\#.*$") "" x) uris
+ in
+ let sorted_uris = List.fast_sort Pervasives.compare cleaned_uris in
+ match sorted_uris with
+ | [] -> sorted_uris
+ | he::tl ->
+ (* no List.remove dups ?? *)
+ snd(List.fold_left (fun (last,l) cur -> if cur <> last then
+ (cur,cur::l) else (last,l)) (he,[he]) tl)