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 (***********************************************************************)
16 include Hcons.Make (struct
18 let hash s = Hashtbl.hash s
19 let equal s1 s2 = s1 = s2
22 let print pp s = Format.fprintf pp "%s" s.node
27 let document = of_string "#document"
28 let text = of_string "#text"
29 let comment = of_string "#comment"
30 let nil = of_string "#"
32 let attribute t = of_string ( "@" ^ (to_string t))
33 let processing_instruction t = of_string ( "?" ^ (to_string t))
36 let s = to_string t in
37 let lens = String.length s in
40 if s.[0] == '@' || s.[0] == '?' then
41 of_string (String.sub s 1 (lens-1))