X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2Ftag.ml;h=01d3788e8aeacf7d423415707a7fbc1e443cfe69;hb=bca508d0e826bc09f8975ba28720a867a828782f;hp=6c88089ccffa2393d70dbd823d18f7bfd29a2b92;hpb=4b52da1a20a4fe031930bb96d2ca46bec06dc529;p=SXSI%2Fxpathcomp.git diff --git a/src/tag.ml b/src/tag.ml index 6c88089..01d3788 100644 --- a/src/tag.ml +++ b/src/tag.ml @@ -10,6 +10,13 @@ type t = int type pool +type operations = { + tag : pool -> string -> t; + to_string : pool -> t ->string; + nullt : pool -> t; + translate : pool -> t -> t +} + external null_pool : unit -> pool = "caml_xml_tree_nullt" external null_tag : unit -> t = "caml_xml_tree_nullt" external register_tag : pool -> string -> t = "caml_xml_tree_register_tag" @@ -55,6 +62,17 @@ let to_string t = else if t == nullt then "" else tag_name (get_pool()) t + +let xml_operations = { + tag = (fun _ x -> tag x); + to_string = (fun _ x -> to_string x); + nullt = (fun _ -> nullt); + translate = (fun _ x -> x); +} + + + + let dump_tags () = Format.eprintf "Tags are:\n"; let doc = get_pool() in