X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Focaml%2Fxml%2FxmlPushParser.ml;h=4f57e124227b398d68fc88e2078be5a9796740a1;hb=4c2a5e7da43e15d9a5f35d65f6bd6eda9a117d93;hp=ae93f4e6a4ff6d352d301ba2582eccc461a41a4e;hpb=3ee9e411a482866320ed10318070212b1e994c53;p=helm.git diff --git a/helm/ocaml/xml/xmlPushParser.ml b/helm/ocaml/xml/xmlPushParser.ml index ae93f4e6a..4f57e1242 100644 --- a/helm/ocaml/xml/xmlPushParser.ml +++ b/helm/ocaml/xml/xmlPushParser.ml @@ -23,6 +23,8 @@ * http://helm.cs.unibo.it/ *) +(* $Id$ *) + let gzip_bufsize = 10240 type callbacks = { @@ -53,6 +55,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 +110,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)) +