2 * ----------------------------------------------------------------------
11 let error_happened = ref false;;
14 print_endline (string_of_exn e)
20 print_endline ("WARNING: " ^ w)
24 let parse debug wf iso88591 filename =
26 (* Parse the document: *)
28 if wf then parse_wfdocument_entity
30 let index = new hash_index in
33 ~id_index:(index :> 'ext index)
38 debugging_mode = debug;
39 encoding = if iso88591 then `Enc_iso88591 else `Enc_utf8;
49 (* Print error; remember that there was an error *)
50 error_happened := true;
56 let debug = ref false in
58 let iso88591 = ref false in
61 [ "-d", Arg.Set debug,
62 " turn debugging mode on";
64 " check only on well-formedness";
65 "-iso-8859-1", Arg.Set iso88591,
66 " use ISO-8859-1 as internal encoding instead of UTF-8";
68 (fun x -> files := x :: !files)
70 usage: pxpvalidate [options] file ...
72 - checks the validity of XML documents. See below for list of options.
74 <title>PXP - The XML parser for Objective Caml</title>
77 files := List.rev !files;
78 List.iter (parse !debug !wf !iso88591) !files;
83 if !error_happened then exit(1);;
85 (* ======================================================================
89 * Revision 1.1 2000/11/17 09:57:31 lpadovan
92 * Revision 1.10 2000/08/30 15:58:41 gerd
95 * Revision 1.9 2000/07/14 14:57:30 gerd
98 * Revision 1.8 2000/07/14 14:13:15 gerd
101 * Revision 1.7 2000/07/14 14:11:06 gerd
102 * Updated because of changes of the PXP API.
104 * Revision 1.6 2000/07/08 21:53:00 gerd
105 * Updated because of PXP interface changes.
107 * Revision 1.5 2000/06/04 20:21:55 gerd
108 * Updated to new module names.
110 * Revision 1.4 2000/05/01 16:44:57 gerd
111 * Added check for ID uniqueness.
112 * Using new error formatter.
114 * Revision 1.3 1999/11/09 22:27:30 gerd
115 * The programs returns now an exit code of 1 if one of the
116 * XML files produces an error.
118 * Revision 1.2 1999/09/01 23:09:56 gerd
119 * Added the option -wf that switches to well-formedness checking
120 * instead of validation.
122 * Revision 1.1 1999/08/14 22:20:53 gerd