X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tag.ml;h=f9c02756bfb81831861ea8a026c143ce7c5e59fa;hb=70ff0bfc463882ecf233f1b1a7ac4a8007fa4cc2;hp=c500dab730c4d94b795468cc88f61aa92da6a8b7;hpb=09870a49122b3d7048422818dbb0a038513b4d14;p=SXSI%2Fxpathcomp.git diff --git a/tag.ml b/tag.ml index c500dab..f9c0275 100644 --- a/tag.ml +++ b/tag.ml @@ -17,8 +17,11 @@ external tag_name : pool -> t -> string = "caml_xml_tree_tag_name" let nullt = null_tag () (* Defined in XMLTree.cpp *) -let pcdata = 1 -let attribute = 0 +let document_node = 0 +let attribute = 1 +let pcdata = 2 +let attribute_data= 3 + let pool = Weak.create 1 @@ -31,6 +34,8 @@ let get_pool () = match Weak.get pool 0 with let tag s = match s with | "<$>" -> pcdata | "<@>" -> attribute + | "" -> document_node + | "<@$>" -> attribute_data | _ -> register_tag (get_pool()) s let compare = (-) @@ -41,6 +46,7 @@ let hash x = x let to_string t = if t == pcdata then "<$>" + else if t == attribute_data then "<@$>" else if t == attribute then "<@>" else if t == nullt then "" else tag_name (get_pool()) t