X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2Fxmltheory%2FXmlTheory%2FiXml.ml;fp=helm%2Fxmltheory%2FXmlTheory%2FiXml.ml;h=0000000000000000000000000000000000000000;hp=98fb186d893fd351ecc969e7175ae162cd97504b;hb=869549224eef6278a48c16ae27dd786376082b38;hpb=89262281b6e83bd2321150f81f1a0583645eb0c8 diff --git a/helm/xmltheory/XmlTheory/iXml.ml b/helm/xmltheory/XmlTheory/iXml.ml deleted file mode 100644 index 98fb186d8..000000000 --- a/helm/xmltheory/XmlTheory/iXml.ml +++ /dev/null @@ -1,53 +0,0 @@ -exception NoOpenNonEmptyElements - -type sectionTree = - Leaf of Xml.token Stream.t - | Node of string * (string * string) list * sectionTree list ref -;; - -let rec token_stream_of_section_tree_list = - function - he::tl -> - [< token_stream_of_section_tree_list tl; token_stream_of_section_tree he >] - | [] -> [<>] -and token_stream_of_section_tree = - function - Leaf t -> [< t >] - | Node (elem_name, attr_list, section_tree) -> - Xml.xml_nempty elem_name attr_list - (token_stream_of_section_tree_list !section_tree) -;; - -let section_stack = ref [];; -let xmloutput = ref (ref []);; -let filename = ref "";; - -let reset_output fname = - filename := fname ; - xmloutput := ref [] ; - section_stack := [] -;; - -let output n = - let xmloutput = !xmloutput in - xmloutput := (Leaf n) :: !xmloutput -;; - -let open_non_empty_element elem_name attr_list = - let newxmloutput = ref [] in - !xmloutput := (Node (elem_name, attr_list, newxmloutput)) :: !(!xmloutput) ; - section_stack := !xmloutput :: !section_stack ; - xmloutput := newxmloutput -;; - -let close_non_empty_element () = - match !section_stack with - oldxmloutput::oldsection_stack -> - xmloutput := oldxmloutput ; - section_stack := oldsection_stack - | _ -> raise NoOpenNonEmptyElements -;; - -let print_output () = - Xml.pp (token_stream_of_section_tree_list !(!xmloutput)) (Some !filename) -;;