[Ocaml-pxp-users] Dtd and parse_wfdocuments

Till Varoquaux till.varoquaux at gmail.com
Tue Feb 7 02:48:47 PST 2006


I had a small problem figuring out the dtd creation...

The manual (taken from the .mli) states:

class dtd :
  (* Creation:
   *   new dtd
   * creates a new, empty DTD object without any declaration, without a root
   * element, without an ID.
   *)

Which might be the wrong signature. So I had to grep the sources to
figure out how to use it...

Anyways there we go:

let permissive (dtd:Pxp_dtd.dtd) :Pxp_dtd.dtd=
  let perm = new Pxp_dtd.dtd default_config.warner `Enc_utf8 in
  List.iter
    (fun x -> let a,b=dtd # gen_entity x in
     perm # add_gen_entity a b)
    (dtd # gen_entity_names);
  perm # allow_arbitrary;
  perm


worked out fine for me... However I guess CDATA elements are now
parsed as PCDATA... Thus the question: how does parse_wfdocument
handle this issue?

Regards,
Till




More information about the Ocaml-pxp-users mailing list