X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fxml%2Fxml.ml;h=f8cc41cbeacb7d3404c9548b9932d9565b8c4262;hb=2b2b90087f836c2f32291935216549e9370e68c3;hp=42ce7ba571564c7a80c12de4feeaa7a417a47e51;hpb=da29171d0139bc1be36772084d58b6cbcfdca646;p=helm.git diff --git a/helm/ocaml/xml/xml.ml b/helm/ocaml/xml/xml.ml index 42ce7ba57..f8cc41cbe 100644 --- a/helm/ocaml/xml/xml.ml +++ b/helm/ocaml/xml/xml.ml @@ -36,6 +36,8 @@ (* *) (******************************************************************************) +(* $Id$ *) + (* the type token for XML cdata, empty elements and not-empty elements *) (* Usage: *) @@ -160,3 +162,16 @@ let add_xml_declaration stream = ] stream >] + (* TODO BRRRRR .... *) + (** strip first 4 line of a string, used to strip xml declaration and doctype + declaration from XML strings generated by Xml.pp_to_string *) +let strip_xml_headings s = + let rec aux n pos = + if n = 0 + then String.sub s pos (String.length s - pos) + else aux (n - 1) (String.index_from s pos '\n' + 1) + in + try + aux 4 0 + with Not_found -> s +