2 * ----------------------------------------------------------------------
3 * PXP: The polymorphic XML parser for Objective Caml.
4 * Copyright 1999 by Gerd Stolpmann. See LICENSE for details.
9 | Public of (string * string)
19 type content_model_type =
23 | Mixed of mixed_spec list
24 | Regexp of regexp_spec
31 Optional of regexp_spec
32 | Repeated of regexp_spec
33 | Repeated1 of regexp_spec
34 | Alt of regexp_spec list
35 | Seq of regexp_spec list
49 | A_notation of string list
50 | A_enum of string list
57 | D_default of string (* The default value is already expanded *)
58 | D_fixed of string (* The default value is already expanded *)
64 | Valuelist of string list
69 class type collect_warnings =
71 method warn : string -> unit
78 method warn (w:string) = ()
83 type encoding = Netconversion.encoding;;
86 (* The subset of 'encoding' that may be used for internal representation
89 [ `Enc_utf8 (* UTF-8 *)
90 | `Enc_iso88591 (* ISO-8859-1 *)
95 exception Validation_error of string
97 exception WF_error of string
99 exception Error of string
101 exception Character_not_supported
103 exception At of (string * exn)
108 let rec string_of_exn x0 =
112 | Validation_error s ->
113 "ERROR (Validity constraint): " ^ s
115 "ERROR (Well-formedness constraint): " ^ s
118 | Character_not_supported ->
119 "RESTRICTION: Character not supported"
120 | Netconversion.Malformed_code ->
121 "ERROR: Bad character stream"
123 "INFORMATION: Undeclared"
124 | Parsing.Parse_error ->
127 "Other exception: " ^ Printexc.to_string x0
132 Out_buffer of Buffer.t
133 | Out_channel of out_channel
134 | Out_function of (string -> int -> int -> unit)
138 let write os str pos len =
140 Out_buffer b -> Buffer.add_substring b str pos len
141 | Out_channel ch -> output ch str pos len
142 | Out_function f -> f str pos len
145 (* ======================================================================
149 * Revision 1.1 2000/11/17 09:57:29 lpadovan
152 * Revision 1.7 2000/08/14 22:24:55 gerd
153 * Moved the module Pxp_encoding to the netstring package under
154 * the new name Netconversion.
156 * Revision 1.6 2000/07/27 00:41:15 gerd
159 * Revision 1.5 2000/07/16 18:31:09 gerd
160 * The exception Illegal_character has been dropped.
162 * Revision 1.4 2000/07/14 21:25:27 gerd
163 * Simplified the type 'collect_warnings'.
165 * Revision 1.3 2000/07/08 16:23:50 gerd
166 * Added the exception 'Error'.
168 * Revision 1.2 2000/07/04 22:14:05 gerd
169 * Implemented the changes of rev. 1.2 of pxp_types.mli.
171 * Revision 1.1 2000/05/29 23:48:38 gerd
172 * Changed module names:
173 * Markup_aux into Pxp_aux
174 * Markup_codewriter into Pxp_codewriter
175 * Markup_document into Pxp_document
176 * Markup_dtd into Pxp_dtd
177 * Markup_entity into Pxp_entity
178 * Markup_lexer_types into Pxp_lexer_types
179 * Markup_reader into Pxp_reader
180 * Markup_types into Pxp_types
181 * Markup_yacc into Pxp_yacc
182 * See directory "compatibility" for (almost) compatible wrappers emulating
183 * Markup_document, Markup_dtd, Markup_reader, Markup_types, and Markup_yacc.
185 * ======================================================================
186 * Old logs from markup_types.ml:
188 * Revision 1.7 2000/05/29 21:14:57 gerd
189 * Changed the type 'encoding' into a polymorphic variant.
191 * Revision 1.6 2000/05/20 20:31:40 gerd
192 * Big change: Added support for various encodings of the
193 * internal representation.
195 * Revision 1.5 2000/05/01 20:43:19 gerd
196 * New type output_stream; new function 'write'.
198 * Revision 1.4 1999/09/01 16:25:35 gerd
199 * Dropped Illegal_token and Content_not_allowed_here. WF_error can
202 * Revision 1.3 1999/08/15 02:22:33 gerd
203 * Added exception Undeclared.
205 * Revision 1.2 1999/08/14 22:14:58 gerd
206 * New class "collect_warnings".
208 * Revision 1.1 1999/08/10 00:35:52 gerd