X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2FqName.ml;h=9b5832efc05cdcb38abe2fd992862bc4adce634f;hp=5d419439a62065a4b734a2cd35b78bade3c1087d;hb=9a127b83fbb1171ebd36e6f42780093412a5e91a;hpb=cba2938d929fd5119b1491686ddc224d5af618c6 diff --git a/src/qName.ml b/src/qName.ml index 5d41943..9b5832e 100644 --- a/src/qName.ml +++ b/src/qName.ml @@ -26,8 +26,18 @@ let to_string = node let document = of_string "#document" let text = of_string "#text" -let cdata_section = of_string "#cdata-section" let comment = of_string "#comment" -let document_fragment = of_string "#document-fragment" -let attribute_map = of_string "#attribute-map" let nil = of_string "#" + +let attribute t = of_string ( "@" ^ (to_string t)) +let processing_instruction t = of_string ( "?" ^ (to_string t)) + +let remove_prefix t = + let s = to_string t in + let lens = String.length s in + if lens == 0 then t + else + if s.[0] == '@' || s.[0] == '?' then + of_string (String.sub s 1 (lens-1)) + else + t