X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fxml%2FxmlPushParser.ml;h=6cab0ead3c6980aee30f001808c068ff5b440e5b;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=ae93f4e6a4ff6d352d301ba2582eccc461a41a4e;hpb=3ee9e411a482866320ed10318070212b1e994c53;p=helm.git diff --git a/helm/ocaml/xml/xmlPushParser.ml b/helm/ocaml/xml/xmlPushParser.ml index ae93f4e6a..6cab0ead3 100644 --- a/helm/ocaml/xml/xmlPushParser.ml +++ b/helm/ocaml/xml/xmlPushParser.ml @@ -53,6 +53,8 @@ type position = int * int type xml_parser = Expat.expat_parser +exception Parse_error of string + let create_parser callbacks = let expat_parser = Expat.parser_create ~encoding:None in (match callbacks.start_element with @@ -106,3 +108,9 @@ let parse expat_parser = in aux +let parse expat_parser xml_source = + try + parse expat_parser xml_source + with Expat.Expat_error xml_error -> + raise (Parse_error (Expat.xml_error_to_string xml_error)) +