Also serialize results in counting mode (prints the count in the output file)
[SXSI/xpathcomp.git] / src / nodeSet.ml
index 0828029..b8979cc 100644 (file)
@@ -52,7 +52,12 @@ module Count : S with type t = int =
     let fold _ _ _ = failwith "fold not implemented"
     let map _ _ = failwith "map not implemented"
     let length x = x
-    let serialize _ _ _ = ()
+    let serialize f _ x =
+      let o = open_out f in
+      output_string o "<xml_result>\n";
+      output_string o (string_of_int x);
+      output_string o "\n</xml_result>\n";
+      close_out o
   end
 
 type  clist =