(***********************************************************************)
(*
- Time-stamp: <Last modified on 2013-03-13 10:33:17 CET by Kim Nguyen>
+ Time-stamp: <Last modified on 2013-03-13 18:47:18 CET by Kim Nguyen>
*)
open Utils
type t = {
root : node;
+ size : int;
(* TODO add other intersting stuff *)
}
match ctx.stack with
[ root ] ->
root.next_sibling <- nil;
- { root = root }
+ { root = root;
+ size = ctx.current_preorder
+ }
| _ -> raise (Expat.Expat_error Expat.UNCLOSED_TOKEN)
)
let nnode = { node with next_sibling = nil } in print_xml out tree_ nnode
let root t = t.root
+let size t = t.size
let first_child _ n = n.first_child
let next_sibling _ n = n.next_sibling
let parent _ n = n.parent