[Ocaml-pxp-users] non validation?

Nuno Lopes nl at uevora.pt
Thu Feb 16 13:16:51 PST 2006


On Tue, 2006-02-14 at 22:54 +0100, Gerd Stolpmann wrote:
> If you need code, please ask more specifically.

Actually I looked at the pxpvalidate code and was trying to adapt the
function it uses (parse_wfdocument_entity) to the print example in
simple_transformation. I think the print example does what I want (wich
is parse a file from stdin and simply print it to stdout). However I was
unable to make it work due to several type errors (had forgotten how
caml works :) first year of university was a long time ago).

Does someone have the code that does this or give a little help with
mine? The best I was able to do was:

let main() =
  try
    let dtd = extract_dtd_from_document_entity default_config (from_file
"record.dtd") in
    dtd # allow_arbitrary;
    let tree =
      parse_wfdocument_entity default_config (from_channel stdin) 
                             default_spec in
    print tree
  with
      x ->
	prerr_endline(string_of_exn x);
	exit 1
;;

and I get:
This expression has type
  ('a Pxp_document.node Pxp_document.extension as 'a)
Pxp_document.document
but is here used with type
  ('b Pxp_document.node #Pxp_document.extension as 'b) Pxp_document.node
Only the first object type has a method init_root

Thanks for any help.
-- 
Nuno Lopes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/ocaml-pxp-users/attachments/20060216/dedbf49d/attachment.pgp 


More information about the Ocaml-pxp-users mailing list