[Ocaml-pxp-users] Dtd and parse_wfdocuments

Till Varoquaux till.varoquaux at gmail.com
Sat Feb 4 17:07:55 PST 2006


I need to parse a document in well formednessed mode and get it's DTD
(but I do not want to validate the document). I figured I might as
well kill two birds with one stone and use
    ~transform_dtd in parse_wfdocument

However the resulting DTD (I'm not actually transforming it) contains
no elements only entities... So what are my options. I'm guessing it's
either:
1) Use a magical function that gives me full DTD and non validating
parser in just one go.
2) Use a validating parser and replace the DTD with something that
would work out.
3) Do two passes on the document:
     3.1) extract_dtd_from_document_entity  to get the DTD.
     3.2) parse_wfdocument_entity to get the document.

I'm hoping I can avoid number 3).....

Regards,
Till Varoquaux




More information about the Ocaml-pxp-users mailing list