2 * ----------------------------------------------------------------------
3 * PXP: The polymorphic XML parser for Objective Caml.
4 * Copyright 1999 by Gerd Stolpmann. See LICENSE for details.
10 | Public of (string * string)
13 (* external identifiers are either "system identifiers" (filenames or URLs),
14 * or "public identifiers" Public(id,sysid) where "id" is the representation
15 * of the public ID, and "sysid" a fallback system ID, or the empty string.
17 * New in PXP: Sometimes the external ID is not known. This case can be
18 * referred to as Anonymous ID.
20 * Encoding: The identifiers are _always_ encoded as UTF8 strings,
21 * regardless of whether another encoding is configured for the parser.
27 External of ext_id (* DTD is completely external *)
28 | Derived of ext_id (* DTD is derived from an external DTD *)
29 | Internal (* DTD is completely internal *)
32 type content_model_type =
33 Unspecified (* A specification of the model has not yet been
36 | Empty (* Nothing is allowed as content *)
37 | Any (* Everything is allowed as content *)
38 | Mixed of mixed_spec list (* The contents consist of elements and PCDATA
39 * in arbitrary order. What is allowed in
40 * particular is given as mixed_spec.
42 | Regexp of regexp_spec (* The contents are elements following this regular
47 MPCDATA (* PCDATA children are allowed *)
48 | MChild of string (* This kind of Element is allowed *)
51 Optional of regexp_spec (* subexpression? *)
52 | Repeated of regexp_spec (* subexpression* *)
53 | Repeated1 of regexp_spec (* subexpression+ *)
54 | Alt of regexp_spec list (* subexpr1 | subexpr2 | ... | subexprN *)
55 | Seq of regexp_spec list (* subexpr1 , subexpr2 , ... , subexprN *)
56 | Child of string (* This kind of Element is allowed here *)
64 | A_idrefs (* IDREFS *)
65 | A_entity (* ENTITY *)
66 | A_entities (* ENTiTIES *)
67 | A_nmtoken (* NMTOKEN *)
68 | A_nmtokens (* NMTOKENS *)
69 | A_notation of string list (* NOTATION (name1 | name2 | ... | nameN) *)
70 | A_enum of string list (* (name1 | name2 | ... | nameN) *)
75 D_required (* #REQUIRED *)
76 | D_implied (* #IMPLIED *)
77 | D_default of string (* <value> -- The value is already expanded *)
78 | D_fixed of string (* FIXED <value> -- The value is already expanded *)
83 Value of string (* a single value *)
84 | Valuelist of string list (* a list of values *)
85 | Implied_value (* a value left out *)
89 class type collect_warnings =
91 method warn : string -> unit
96 class drop_warnings : collect_warnings;;
99 type encoding = Netconversion.encoding;;
100 (* We accept all encodings for character sets which are defined in
101 * Netconversion (package netstring).
105 (* The subset of 'encoding' that may be used for internal representation
107 * Note: The following encodings are ASCII-compatible! This is an important
108 * property used throghout the whole PXP code.
110 [ `Enc_utf8 (* UTF-8 *)
111 | `Enc_iso88591 (* ISO-8859-1 *)
116 exception Validation_error of string
117 (* Violation of a validity constraint *)
119 exception WF_error of string
120 (* Violation of a well-formedness constraint *)
122 exception Error of string
125 exception Character_not_supported
127 exception At of (string * exn)
128 (* The string is a description where the exn happened. The exn value can
129 * again be At(_,_) (for example, when an entity within an entity causes
134 (* Indicates that declaration is available and because of this every kind
135 * of usage is allowed.
138 val string_of_exn : exn -> string
139 (* Converts a Markup exception into a readable string *)
143 Out_buffer of Buffer.t
144 | Out_channel of out_channel
145 | Out_function of (string -> int -> int -> unit)
147 val write : output_stream -> string -> int -> int -> unit
148 (* write os s pos len: Writes the string to the buffer/channel/stream *)
150 (* ======================================================================
154 * Revision 1.1 2000/11/17 09:57:29 lpadovan
157 * Revision 1.8 2000/08/14 22:24:55 gerd
158 * Moved the module Pxp_encoding to the netstring package under
159 * the new name Netconversion.
161 * Revision 1.7 2000/07/27 00:41:15 gerd
164 * Revision 1.6 2000/07/16 18:31:09 gerd
165 * The exception Illegal_character has been dropped.
167 * Revision 1.5 2000/07/16 16:34:21 gerd
170 * Revision 1.4 2000/07/14 21:25:27 gerd
171 * Simplified the type 'collect_warnings'.
173 * Revision 1.3 2000/07/08 16:23:50 gerd
174 * Added the exception 'Error'.
176 * Revision 1.2 2000/07/04 22:08:26 gerd
177 * type ext_id: New variant Anonymous. - The System and Public
178 * variants are now encoded as UTF-8.
179 * collect_warnings is now a class type only. New class
181 * New functions encoding_of_string and string_of_encoding.
183 * Revision 1.1 2000/05/29 23:48:38 gerd
184 * Changed module names:
185 * Markup_aux into Pxp_aux
186 * Markup_codewriter into Pxp_codewriter
187 * Markup_document into Pxp_document
188 * Markup_dtd into Pxp_dtd
189 * Markup_entity into Pxp_entity
190 * Markup_lexer_types into Pxp_lexer_types
191 * Markup_reader into Pxp_reader
192 * Markup_types into Pxp_types
193 * Markup_yacc into Pxp_yacc
194 * See directory "compatibility" for (almost) compatible wrappers emulating
195 * Markup_document, Markup_dtd, Markup_reader, Markup_types, and Markup_yacc.
197 * ======================================================================
198 * Old logs from Markup_types.mli:
200 * Revision 1.7 2000/05/29 21:14:57 gerd
201 * Changed the type 'encoding' into a polymorphic variant.
203 * Revision 1.6 2000/05/20 20:31:40 gerd
204 * Big change: Added support for various encodings of the
205 * internal representation.
207 * Revision 1.5 2000/05/01 20:43:25 gerd
208 * New type output_stream; new function 'write'.
210 * Revision 1.4 1999/09/01 16:25:35 gerd
211 * Dropped Illegal_token and Content_not_allowed_here. WF_error can
214 * Revision 1.3 1999/08/15 02:22:40 gerd
215 * Added exception Undeclared.
217 * Revision 1.2 1999/08/14 22:15:17 gerd
218 * New class "collect_warnings".
220 * Revision 1.1 1999/08/10 00:35:52 gerd