1 (***********************************************************************)
5 (* Kim Nguyen, LRI UMR8623 *)
6 (* Université Paris-Sud & CNRS *)
8 (* Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (* Recherche Scientifique. All rights reserved. This file is *)
10 (* distributed under the terms of the GNU Lesser General Public *)
11 (* License, with the special exception on linking described in file *)
14 (***********************************************************************)
17 Time-stamp: <Last modified on 2013-03-10 23:05:56 CET by Kim Nguyen>
20 include Hcons.Make (struct
22 let hash s = Hashtbl.hash s
23 let equal s1 s2 = s1 = s2
26 let print pp s = Format.fprintf pp "%s" s.node
31 let document = of_string "#document"
32 let text = of_string "#text"
33 let comment = of_string "#comment"
34 let nil = of_string "#"
36 let attribute t = of_string ( "@" ^ (to_string t))
37 let processing_instruction t = of_string ( "?" ^ (to_string t))
40 let s = to_string t in
41 let lens = String.length s in
44 if s.[0] == '@' || s.[0] == '?' then
45 of_string (String.sub s 1 (lens-1))