~ubuntu-branches/ubuntu/hardy/pxp/hardy

« back to all changes in this revision

Viewing changes to src/pxp-engine/pxp_dtd.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Zacchiroli
  • Date: 2005-03-29 11:06:39 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050329110639-5p39hz1d4aq3r2ec
Tags: 1.1.95-6
* Rebuilt against ocaml 3.08.3
* No longer built with wlex support (since wlex is no longer supported
  upstream and corresponding package has been removed from the debian
  archive)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
(* $Id: pxp_dtd.ml,v 1.21 2002/03/10 23:39:28 gerd Exp $
 
1
(* $Id: pxp_dtd.ml 697 2004-08-21 21:02:46Z gerd $
2
2
 * ----------------------------------------------------------------------
3
3
 * PXP: The polymorphic XML parser for Objective Caml.
4
4
 * Copyright by Gerd Stolpmann. See LICENSE for details.
5
5
 *)
6
6
 
7
 
open Pxp_types
 
7
open Pxp_core_types
8
8
open Pxp_lexer_types
9
9
open Pxp_lexers
10
10
open Pxp_entity
27
27
;;
28
28
 
29
29
 
 
30
(* class type? *)
 
31
 
30
32
class namespace_manager =
31
33
object (self)
32
34
    val uri_of_prefix = Hashtbl.create 10  (* not unique *)
37
39
      ignore(self # add_namespace "xml" "http://www.w3.org/XML/1998/namespace")
38
40
 
39
41
    method add_uri (np:string) (uri:string) =
40
 
      if not (Hashtbl.mem uri_of_prefix np) then raise Not_found;
 
42
      if not (Hashtbl.mem uri_of_prefix np) then 
 
43
        raise(Namespace_prefix_not_managed np);
41
44
      try
42
45
        let np' = Hashtbl.find prefix_of_uri uri in
43
46
        if np <> np' then
82
85
              (* prefix = "": make sure that such a prefix is never added *)
83
86
 
84
87
    method get_primary_uri normprefix =
85
 
      Hashtbl.find primary_uri_of_prefix normprefix
 
88
      try
 
89
        Hashtbl.find primary_uri_of_prefix normprefix
 
90
      with
 
91
          Not_found -> 
 
92
            raise(Namespace_prefix_not_managed normprefix)
86
93
 
87
94
    method get_uri_list normprefix =
88
95
      Hashtbl.find_all uri_of_prefix normprefix
89
96
 
90
97
    method get_normprefix uri =
91
 
      Hashtbl.find prefix_of_uri uri
 
98
      try
 
99
        Hashtbl.find prefix_of_uri uri
 
100
      with
 
101
          Not_found ->
 
102
            raise(Namespace_not_managed uri)
92
103
 
93
104
    method iter_namespaces f =
94
105
      Hashtbl.iter 
95
106
        (fun p uri -> f p)
96
107
        primary_uri_of_prefix
 
108
 
 
109
    method as_declaration =
 
110
      let l = ref [] in
 
111
      Hashtbl.iter 
 
112
        (fun p uri -> l := (p, uri) :: !l)
 
113
        primary_uri_of_prefix;
 
114
      !l
 
115
      
97
116
  end
98
117
;;
99
118
 
100
119
 
101
 
class dtd  the_warner init_encoding =
 
120
let create_namespace_manager () = new namespace_manager;;
 
121
 
 
122
 
 
123
class type namespace_scope =
 
124
object
 
125
  method namespace_manager : namespace_manager
 
126
  method parent_scope : namespace_scope option
 
127
  method declaration : (string * string) list
 
128
  method effective_declaration : (string * string) list
 
129
  method display_prefix_of_uri : string -> string
 
130
  method display_prefix_of_normprefix : string -> string
 
131
  method uri_of_display_prefix : string -> string
 
132
  method normprefix_of_display_prefix : string -> string
 
133
end
 
134
;;
 
135
 
 
136
 
 
137
 
 
138
module StrSet = Set.Make(String);;
 
139
 
 
140
class namespace_scope_impl mng parent_opt decl : namespace_scope =
 
141
object(self)
 
142
  method namespace_manager = mng
 
143
  method parent_scope = parent_opt
 
144
  method declaration = decl
 
145
 
 
146
  method effective_declaration =
 
147
    let rec collect visible d s =
 
148
      match d with
 
149
        | ("", "") :: d' ->
 
150
            if StrSet.mem "" visible then
 
151
              collect visible d' s  (* no effect *)
 
152
            else
 
153
              collect (StrSet.add "" visible) d' s  (* hide inner default *)
 
154
        | (dp, uri) :: d' ->
 
155
            if StrSet.mem dp visible then
 
156
              collect visible d' s
 
157
            else
 
158
              (dp, uri) :: collect (StrSet.add dp visible) d' s
 
159
        | [] ->
 
160
            ( match s # parent_scope with
 
161
                  Some s' ->
 
162
                    collect visible s'#declaration s'
 
163
                | None ->
 
164
                    []
 
165
            )
 
166
    in
 
167
    collect StrSet.empty self#declaration (self : #namespace_scope :> namespace_scope)
 
168
 
 
169
  method display_prefix_of_uri uri =
 
170
    try
 
171
      fst(List.find (fun (p,u) -> u = uri) decl)
 
172
    with
 
173
        Not_found ->
 
174
          ( match parent_opt with
 
175
                Some pa -> pa # display_prefix_of_uri uri
 
176
              | None    -> raise(Namespace_not_in_scope uri)
 
177
          )
 
178
 
 
179
  method display_prefix_of_normprefix np =
 
180
    let uris = mng # get_uri_list np in
 
181
    if uris = [] then raise(Namespace_prefix_not_managed np);
 
182
    try
 
183
      fst(List.find (fun (p,u) -> List.mem u uris) decl)
 
184
    with
 
185
        Not_found ->
 
186
          ( match parent_opt with
 
187
                Some pa -> pa # display_prefix_of_normprefix np
 
188
              | None    -> raise(Namespace_not_in_scope
 
189
                                   (List.hd(List.rev uris)))
 
190
          )
 
191
 
 
192
  method uri_of_display_prefix dp =
 
193
    try
 
194
      List.assoc dp decl
 
195
    with
 
196
        Not_found -> 
 
197
          ( match parent_opt with
 
198
                Some pa -> pa # uri_of_display_prefix dp
 
199
              | None    -> raise Not_found
 
200
          )
 
201
 
 
202
  method normprefix_of_display_prefix dp =
 
203
    let uri = self # uri_of_display_prefix dp in
 
204
    mng # get_normprefix uri
 
205
 
 
206
end
 
207
;;
 
208
 
 
209
 
 
210
let create_namespace_scope ?parent ?(decl = []) mng =
 
211
  new namespace_scope_impl mng parent decl ;;
 
212
 
 
213
 
 
214
class dtd  ?swarner the_warner init_encoding =
102
215
  object (self)
103
216
    val mutable root = (None : string option)
104
217
    val mutable id =   (None : dtd_id option)
105
218
    val mutable mng =  (None : namespace_manager option)
106
219
 
107
220
    val warner       = (the_warner : collect_warnings)
 
221
    val swarner      = (swarner : symbolic_warnings option)
108
222
    val encoding     = init_encoding
109
 
    val lexerset     = Pxp_lexers.get_lexer_set init_encoding
 
223
    val lfactory     = Pxp_lexers.get_lexer_factory init_encoding
110
224
 
111
225
    val elements     = (Str_hashtbl.create 100 : dtd_element Str_hashtbl.t)
112
226
    val gen_entities = (Str_hashtbl.create 100 : (entity * bool) Str_hashtbl.t)
127
241
    initializer
128
242
    let w = new drop_warnings in
129
243
    self # add_gen_entity 
130
 
      (new internal_entity self "lt"   w "&#38;#60;" false false encoding)
131
 
      false;
132
 
    self # add_gen_entity 
133
 
      (new internal_entity self "gt"   w "&#62;"     false false encoding)
134
 
      false;
135
 
    self # add_gen_entity 
136
 
      (new internal_entity self "amp"  w "&#38;#38;" false false encoding)
137
 
      false;
138
 
    self # add_gen_entity 
139
 
      (new internal_entity self "apos" w "&#39;"     false false encoding)
140
 
      false;
141
 
    self # add_gen_entity 
142
 
      (new internal_entity self "quot" w "&#34;"     false false encoding)
 
244
      (new internal_entity self "lt"   None w "&#38;#60;" false false encoding)
 
245
      false;
 
246
    self # add_gen_entity 
 
247
      (new internal_entity self "gt"   None w "&#62;"     false false encoding)
 
248
      false;
 
249
    self # add_gen_entity 
 
250
      (new internal_entity self "amp"  None w "&#38;#38;" false false encoding)
 
251
      false;
 
252
    self # add_gen_entity 
 
253
      (new internal_entity self "apos" None w "&#39;"     false false encoding)
 
254
      false;
 
255
    self # add_gen_entity 
 
256
      (new internal_entity self "quot" None w "&#34;"     false false encoding)
143
257
      false;
144
258
 
145
259
 
146
260
    method encoding = encoding
147
261
 
 
262
    method lexer_factory = lfactory
 
263
 
148
264
    method warner = warner
149
265
 
 
266
    method swarner = swarner
 
267
 
150
268
    method set_root r =
151
269
      if root = None then
152
270
        root <- Some r
189
307
      (* raises Not_found if 'el' has already been added *)
190
308
      (* Note: 'el' is encoded in the same way as 'self'! *)
191
309
      let name = el # name in
192
 
      check_name warner name;
 
310
      check_name ?swarner warner name;
193
311
      if Str_hashtbl.mem elements name then
194
312
        raise Not_found;
195
313
      Str_hashtbl.add elements name el;
207
325
      if en # encoding <> encoding then
208
326
        failwith "Pxp_dtd.dtd # add_gen_entity: Inconsistent encodings";
209
327
      let name = en # name in
210
 
      check_name warner name;
 
328
      check_name ?swarner warner name;
211
329
      if Str_hashtbl.mem gen_entities name then begin
212
330
        if List.mem name [ "lt"; "gt"; "amp"; "quot"; "apos" ] then begin
213
331
          (* These are allowed to be declared several times *)
214
332
          let (rt,_) = en # replacement_text in
215
 
          let toks = tokens_of_content_string lexerset rt in
 
333
          let toks = tokens_of_content_string lfactory rt in
216
334
          try
217
335
            begin match toks with
218
336
              [CRef 60]       -> if name <> "lt"   then raise Not_found
231
349
                                        "' redeclared"))
232
350
        end
233
351
        else
234
 
          warner # warn ("Entity `" ^ name ^ "' declared twice")
 
352
          warn swarner warner (`W_entity_declared_twice name)
235
353
      end
236
354
      else begin
237
355
        Str_hashtbl.add gen_entities name (en, extdecl);
243
361
      if en # encoding <> encoding then
244
362
        failwith "Pxp_dtd.dtd # add_par_entity: Inconsistent encodings";
245
363
      let name = en # name in
246
 
      check_name warner name;
 
364
      check_name ?swarner warner name;
247
365
      if not (Str_hashtbl.mem par_entities name) then begin
248
366
        Str_hashtbl.add par_entities name en;
249
367
        par_entity_names <- name :: par_entity_names
250
368
      end
251
369
      else
252
 
        warner # warn ("Entity `" ^ name ^ "' declared twice")
 
370
        warn swarner warner (`W_entity_declared_twice name)
253
371
 
254
372
 
255
373
    method add_notation no =
257
375
      if no # encoding <> encoding then
258
376
        failwith "Pxp_dtd.dtd # add_notation: Inconsistent encodings";
259
377
      let name = no # name in
260
 
      check_name warner name;
 
378
      check_name ?swarner warner name;
261
379
      if Str_hashtbl.mem notations name then
262
380
        raise (Validation_error("Notation `" ^ name ^ "' declared twice"));
263
381
      Str_hashtbl.add notations name no;
268
386
      if pi # encoding <> encoding then
269
387
        failwith "Pxp_dtd.dtd # add_pinstr: Inconsistent encodings";
270
388
      let name = pi # target in
271
 
      check_name warner name;
 
389
      check_name ?swarner warner name;
272
390
 
273
391
      if String.length name >= 4 && String.sub name 0 4 = "pxp:" then begin
274
392
        match name with
278
396
                  "optional-element-and-notation-declarations" ->
279
397
                    self # allow_arbitrary
280
398
                | "optional-attribute-declarations" ->
281
 
                    let lexers = Pxp_lexers.get_lexer_set encoding in
282
399
                    let el_string = 
283
400
                      try List.assoc "elements" atts
284
401
                      with Not_found ->
285
402
                        raise(Error("Missing `elements' attribute for pxp:dtd"))
286
403
                    in
287
 
                    let el = split_attribute_value lexers el_string in
 
404
                    let el = split_attribute_value lfactory el_string in
288
405
                    List.iter
289
406
                      (fun e_name ->
290
407
                         let e =
313
430
                            raise(Error("Cannot do pxp:dtd instruction: namespaces not enabled"))
314
431
                        | Some m ->
315
432
                            ( try m # add_uri prefix uri
316
 
                              with Not_found ->
 
433
                              with Namespace_prefix_not_managed _ ->
317
434
                                m # add_namespace prefix uri
318
435
                            )
319
436
                    )
327
444
      end;
328
445
      Str_hashtbl.add pinstr name pi;
329
446
      if not (List.mem name pinstr_names) then
330
 
        pinstr_names <- name :: pinstr_names;
 
447
        pinstr_names <- pinstr_names @ [name];
331
448
 
332
449
 
333
450
    method element name =
595
712
  object (self)
596
713
    val dtd = (the_dtd : dtd)
597
714
    val name = the_name
598
 
    val lexerset = Pxp_lexers.get_lexer_set (the_dtd # encoding)
 
715
    val lfactory = the_dtd # lexer_factory
599
716
    val mutable content_model = Unspecified
600
717
    val mutable content_model_validated = false
601
718
    val mutable content_dfa = lazy None
655
772
    method arbitrary_allowed = allow_arbitrary
656
773
 
657
774
    method add_attribute aname t d extdecl =
 
775
      let swarner = dtd#swarner 
 
776
      and warner = dtd#warner in
658
777
      if aname <> "xml:lang" & aname <> "xml:space" then
659
 
        check_name (dtd#warner) aname;
 
778
        check_name ?swarner warner aname;
660
779
      if List.mem_assoc aname attributes then
661
 
        dtd # warner # warn ("More than one declaration for attribute `" ^
662
 
                             aname ^ "' of element type `" ^ name ^ "'")
 
780
        warn swarner warner (`W_multiple_attribute_declarations(name,aname))
663
781
      else begin
664
782
        begin match aname with
665
783
            "xml:space" ->
712
830
                (* i.e. adefault matches D_default or D_fixed *)
713
831
            | Some s ->
714
832
                atype <> A_cdata &&
715
 
                normalization_changes_value lexerset atype s
 
833
                normalization_changes_value lfactory atype s
716
834
        )
717
835
      with
718
836
          Not_found ->
762
880
                     match d with
763
881
                         (D_required | D_implied) -> Implied_value
764
882
                       | D_default v ->
765
 
                           value_of_attribute lexerset dtd n t v
 
883
                           value_of_attribute lfactory dtd n t v
766
884
                       | D_fixed v ->
767
 
                           value_of_attribute lexerset dtd n t v
 
885
                           value_of_attribute lfactory dtd n t v
768
886
                   in
769
887
 
770
888
                   init_att_vals.( !k ) <- (n, init_val);
997
1115
             let check v =
998
1116
               let lexical_error() =
999
1117
                 lazy (raise(Validation_error("Default value for attribute `" ^ n ^ "' is lexically malformed"))) in
1000
 
               check_attribute_value_lexically lexerset (lexical_error()) t v;
 
1118
               check_attribute_value_lexically lfactory (lexical_error()) t v;
1001
1119
               begin match t with
1002
1120
                   (A_entity|A_entities) ->
1003
1121
                     List.iter
1010
1128
-- This is checked anyway when the attribute value is normalized
1011
1129
*)
1012
1130
                       )
1013
 
                       (split_attribute_value lexerset v)
 
1131
                       (split_attribute_value lfactory v)
1014
1132
                 | A_notation nl ->
1015
1133
                     if not (List.mem v nl) then
1016
1134
                       raise(Validation_error("Illegal default value for attribute `" ^ n ^ "' in declaration for element `" ^ name ^ "'"));
1042
1160
       *)
1043
1161
      match content_model with
1044
1162
          Unspecified ->
1045
 
            dtd # warner # warn ("Element type `" ^ name ^ "' mentioned but not declared");
 
1163
            warn (dtd#swarner) (dtd#warner)
 
1164
                 (`W_element_mentioned_but_not_declared name);
1046
1165
            ()
1047
1166
        | Empty -> ()
1048
1167
        | Any -> ()
1064
1183
object (self)
1065
1184
    val name = the_name
1066
1185
    val xid = (the_xid : ext_id)
1067
 
    val encoding = (init_encoding : Pxp_types.rep_encoding)
 
1186
    val encoding = (init_encoding : Pxp_core_types.rep_encoding)
1068
1187
    method name = name
1069
1188
    method ext_id = xid
1070
1189
    method encoding = encoding
1105
1224
object (self)
1106
1225
    val target = the_target
1107
1226
    val value = (the_value : string)
1108
 
    val encoding = (init_encoding : Pxp_types.rep_encoding)
 
1227
    val encoding = (init_encoding : Pxp_core_types.rep_encoding)
1109
1228
 
1110
1229
    initializer
1111
1230
      match target with
1131
1250
      wms "?>";
1132
1251
 
1133
1252
    method parse_pxp_option =
1134
 
      let lexers = get_lexer_set encoding in
 
1253
      let lfactory = get_lexer_factory encoding in
1135
1254
      try
1136
 
        let toks = tokens_of_xml_pi lexers value in   (* may raise WF_error *)
 
1255
        let toks = tokens_of_xml_pi lfactory value in (* may raise WF_error *)
1137
1256
        begin match toks with
1138
1257
            (Pro_name option_name) :: toks' ->
1139
1258
              let atts = decode_xml_pi toks' in       (* may raise WF_error *)
1148
1267
  end
1149
1268
;;
1150
1269
 
 
1270
let create_dtd ?swarner ?(warner = new drop_warnings) enc =
 
1271
  new dtd ?swarner warner enc ;;
 
1272
 
 
1273
 
1151
1274
type source =
1152
1275
    Entity of ((dtd -> Pxp_entity.entity) * Pxp_reader.resolver)
1153
1276
  | ExtID of (ext_id * Pxp_reader.resolver)
 
1277
  | XExtID of (ext_id * string option * Pxp_reader.resolver)
1154
1278
;;
1155
1279
 
1156
1280
module Entity = struct
1163
1287
  let replacement_text ent = fst(ent # replacement_text)
1164
1288
  let get_xid ent =
1165
1289
    try Some(ent # ext_id) with Not_found -> None
 
1290
  let get_resolver_id ent =
 
1291
    try Some(ent # resolver_id) with Not_found -> None
1166
1292
  let get_notation ent =
1167
1293
    if ent # is_ndata then Some (ent # notation) else None
1168
1294
  let create_internal_entity ~name ~value dtd =
1169
 
    new internal_entity dtd name (dtd # warner) value false false 
1170
 
        (dtd # encoding)
 
1295
    new internal_entity dtd name (dtd # swarner) (dtd # warner) value 
 
1296
        false false (dtd # encoding)
1171
1297
  let create_ndata_entity ~name ~xid ~notation dtd =
1172
1298
    new ndata_entity name xid notation dtd#encoding
1173
 
  let create_external_entity ?(doc_entity = false) ~name ~xid ~resolver dtd =
 
1299
  let create_external_entity ?(doc_entity = false) ?system_base 
 
1300
                             ~name ~xid ~resolver dtd =
1174
1301
    if doc_entity then
1175
 
      new document_entity resolver dtd name dtd#warner xid dtd#encoding
 
1302
      new document_entity resolver dtd name dtd#swarner dtd#warner xid
 
1303
                          system_base dtd#encoding
1176
1304
    else
1177
 
      new external_entity resolver dtd name dtd#warner xid false dtd#encoding
 
1305
      new external_entity resolver dtd name dtd#swarner dtd#warner xid
 
1306
                          system_base false dtd#encoding
1178
1307
  let from_external_source ?doc_entity ~name dtd src =
1179
1308
    match src with
1180
1309
        ExtID(xid,resolver) -> 
1181
1310
          create_external_entity ?doc_entity ~name ~xid ~resolver dtd
 
1311
      | XExtID(xid,system_base,resolver) -> 
 
1312
          create_external_entity ?doc_entity ?system_base 
 
1313
                                 ~name ~xid ~resolver dtd
1182
1314
      | Entity(make,resolver) ->
1183
1315
          make dtd  (* resolver ignored *)
 
1316
 
 
1317
  let entity_id ent = (ent :> < >)
 
1318
 
 
1319
  class fake = object end
 
1320
 
 
1321
  let create_entity_id () = new fake
 
1322
 
1184
1323
end
1185
1324
 
1186
1325
 
1187
 
(* ======================================================================
1188
 
 * History:
1189
 
 *
1190
 
 * $Log: pxp_dtd.ml,v $
1191
 
 * Revision 1.21  2002/03/10 23:39:28  gerd
1192
 
 *      Extended the Entity module
1193
 
 *
1194
 
 * Revision 1.20  2001/12/03 23:45:55  gerd
1195
 
 *      new method [write_ref]
1196
 
 *
1197
 
 * Revision 1.19  2001/07/02 23:21:40  gerd
1198
 
 *      Added the Entity module.
1199
 
 *
1200
 
 * Revision 1.18  2001/06/29 13:57:30  gerd
1201
 
 *      Weakened the xml:space check.
1202
 
 *
1203
 
 * Revision 1.17  2001/06/08 01:15:46  gerd
1204
 
 *      Moved namespace_manager from Pxp_document to Pxp_dtd. This
1205
 
 * makes it possible that the DTD can recognize the processing instructions
1206
 
 * <?pxp:dtd namespace prefix="..." uri="..."?>, and add the namespace
1207
 
 * declaration to the manager.
1208
 
 *
1209
 
 * Revision 1.16  2001/06/07 22:48:38  gerd
1210
 
 *      Improvement: 'write' writes sorted attributes. This makes
1211
 
 * many regression tests simpler.
1212
 
 *
1213
 
 * Revision 1.15  2001/04/22 14:14:41  gerd
1214
 
 *      Updated to support private IDs.
1215
 
 *
1216
 
 * Revision 1.14  2000/10/01 19:47:19  gerd
1217
 
 *      Using Str_hashtbl instead of Hashtbl.
1218
 
 *
1219
 
 * Revision 1.13  2000/09/22 22:54:30  gerd
1220
 
 *      Optimized the attribute checker (internal_init of element
1221
 
 * nodes). The validation_record has now more fields to support
1222
 
 * internal_init.
1223
 
 *
1224
 
 * Revision 1.12  2000/09/16 22:40:50  gerd
1225
 
 *      Bug processing processing instructions: Method
1226
 
 * pinstr_names returned wrong results; method write wrote
1227
 
 * the wrong instructions.
1228
 
 *
1229
 
 * Revision 1.11  2000/09/09 16:41:32  gerd
1230
 
 *      New type validation_record.
1231
 
 *
1232
 
 * Revision 1.10  2000/08/18 21:18:45  gerd
1233
 
 *      Updated wrong comments for methods par_entity and gen_entity.
1234
 
 * These can raise WF_error and not Validation_error, and this is the
1235
 
 * correct behaviour.
1236
 
 *
1237
 
 * Revision 1.9  2000/07/25 00:30:01  gerd
1238
 
 *      Added support for pxp:dtd PI options.
1239
 
 *
1240
 
 * Revision 1.8  2000/07/23 02:16:34  gerd
1241
 
 *      Support for DFAs.
1242
 
 *
1243
 
 * Revision 1.7  2000/07/16 17:50:01  gerd
1244
 
 *      Fixes in 'write'
1245
 
 *
1246
 
 * Revision 1.6  2000/07/16 16:34:41  gerd
1247
 
 *      New method 'write', the successor of 'write_compact_as_latin1'.
1248
 
 *
1249
 
 * Revision 1.5  2000/07/14 13:56:48  gerd
1250
 
 *      Added methods id_attribute_name and idref_attribute_names.
1251
 
 *
1252
 
 * Revision 1.4  2000/07/09 00:13:37  gerd
1253
 
 *      Added methods gen_entity_names, par_entity_names.
1254
 
 *
1255
 
 * Revision 1.3  2000/07/04 22:10:55  gerd
1256
 
 *      Update: collect_warnings -> drop_warnings.
1257
 
 *      Update: Case ext_id = Anonymous.
1258
 
 *
1259
 
 * Revision 1.2  2000/06/14 22:19:06  gerd
1260
 
 *      Added checks such that it is impossible to mix encodings.
1261
 
 *
1262
 
 * Revision 1.1  2000/05/29 23:48:38  gerd
1263
 
 *      Changed module names:
1264
 
 *              Markup_aux          into Pxp_aux
1265
 
 *              Markup_codewriter   into Pxp_codewriter
1266
 
 *              Markup_document     into Pxp_document
1267
 
 *              Markup_dtd          into Pxp_dtd
1268
 
 *              Markup_entity       into Pxp_entity
1269
 
 *              Markup_lexer_types  into Pxp_lexer_types
1270
 
 *              Markup_reader       into Pxp_reader
1271
 
 *              Markup_types        into Pxp_types
1272
 
 *              Markup_yacc         into Pxp_yacc
1273
 
 * See directory "compatibility" for (almost) compatible wrappers emulating
1274
 
 * Markup_document, Markup_dtd, Markup_reader, Markup_types, and Markup_yacc.
1275
 
 *
1276
 
 * ======================================================================
1277
 
 *
1278
 
 * Revision 1.18  2000/05/28 17:24:55  gerd
1279
 
 *      Bugfixes.
1280
 
 *
1281
 
 * Revision 1.17  2000/05/27 19:21:25  gerd
1282
 
 *      Implemented the changes of rev. 1.10 of markup_dtd.mli.
1283
 
 *
1284
 
 * Revision 1.16  2000/05/20 20:31:40  gerd
1285
 
 *      Big change: Added support for various encodings of the
1286
 
 * internal representation.
1287
 
 *
1288
 
 * Revision 1.15  2000/05/14 21:50:07  gerd
1289
 
 *      Updated: change in internal_entity.
1290
 
 *
1291
 
 * Revision 1.14  2000/05/06 23:08:46  gerd
1292
 
 *      It is possible to allow undeclared attributes.
1293
 
 *
1294
 
 * Revision 1.13  2000/05/01 20:42:46  gerd
1295
 
 *         New method write_compact_as_latin1.
1296
 
 *
1297
 
 * Revision 1.12  2000/05/01 15:16:57  gerd
1298
 
 *      The errors "undeclared parameter/general entities" are
1299
 
 * well-formedness errors, not validation errors.
1300
 
 *
1301
 
 * Revision 1.11  2000/03/11 22:58:15  gerd
1302
 
 *      Updated to support Markup_codewriter.
1303
 
 *
1304
 
 * Revision 1.10  2000/01/20 20:53:47  gerd
1305
 
 *      Changed such that it runs with Markup_entity's new interface.
1306
 
 *
1307
 
 * Revision 1.9  1999/11/09 22:15:41  gerd
1308
 
 *      Added method "arbitrary_allowed".
1309
 
 *
1310
 
 * Revision 1.8  1999/09/01 22:52:22  gerd
1311
 
 *      If 'allow_arbitrary' is in effect, no validation happens anymore.
1312
 
 *
1313
 
 * Revision 1.7  1999/09/01 16:21:24  gerd
1314
 
 *      Added several warnings.
1315
 
 *      The attribute type of "xml:space" is now strictly checked.
1316
 
 *
1317
 
 * Revision 1.6  1999/08/15 20:34:21  gerd
1318
 
 *      Improved error messages.
1319
 
 *      Bugfix: It is no longer allowed to create processing instructions
1320
 
 * with target "xml".
1321
 
 *
1322
 
 * Revision 1.5  1999/08/15 02:20:16  gerd
1323
 
 *      New feature: a DTD can allow arbitrary elements.
1324
 
 *
1325
 
 * Revision 1.4  1999/08/15 00:21:39  gerd
1326
 
 *      Comments have been updated.
1327
 
 *
1328
 
 * Revision 1.3  1999/08/14 22:12:52  gerd
1329
 
 *         Several functions have now a "warner" as argument which is
1330
 
 * an object with a "warn" method. This is used to warn about characters
1331
 
 * that cannot be represented in the Latin 1 alphabet.
1332
 
 *      Bugfix: if two general entities with the same name are definied,
1333
 
 * the first counts, not the second.
1334
 
 *
1335
 
 * Revision 1.2  1999/08/11 14:56:35  gerd
1336
 
 *      Declaration of the predfined entities {lt,gt,amp,quot,apos}
1337
 
 * is no longer forbidden; but the original definition cannot be overriddden.
1338
 
 *      TODO: If these entities are redeclared with problematic values,
1339
 
 * the user should be warned.
1340
 
 *
1341
 
 * Revision 1.1  1999/08/10 00:35:51  gerd
1342
 
 *      Initial revision.
1343
 
 *
1344
 
 *
1345
 
 *)