;;
let xml_document () =
+ let error e =
+ prerr_endline ("Warning: configuration file not found, or incorrect: " ^
+ Pxp_types.string_of_exn e) ;
+ None
+ in
let module Y = Pxp_yacc in
try
let config = {Y.default_config with Y.warner = new warner} in
Some (Y.parse_document_entity config (Y.from_file filename) Y.default_spec)
with
- e ->
- prerr_endline ("Warning: configuration file not found, or incorrect: " ^ Pxp_types.string_of_exn e) ;
- None
+ | (Pxp_types.Error _) as e -> error e
+ | (Pxp_types.At _) as e -> error e
+ | (Pxp_types.Validation_error _) as e -> error e
+ | (Pxp_types.WF_error _) as e -> error e
+ | (Pxp_types.Namespace_error _) as e -> error e
+ | (Pxp_types.Character_not_supported) as e -> error e
;;
exception Impossible;;