Add a specific prefix for QNames that represent attributes.
[tatoo.git] / src / tree / naive.ml
index 1086b1e..8654c45 100644 (file)
@@ -14,7 +14,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-02-07 09:59:37 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-02-14 16:14:00 CET by Kim Nguyen>
 *)
 open Utils
 
@@ -108,6 +108,7 @@ struct
   let text_string = QName.to_string QName.text
   let attr_map_string = QName.to_string QName.attribute_map
 
+  let att_pref = QName.node QName.attribute_prefix
   let rec start_element_handler parser_ ctx tag attr_list =
     do_text parser_ ctx;
     let parent = top ctx in
@@ -130,7 +131,7 @@ struct
       end_element_handler parser_ ctx attr_map_string
 
   and do_attribute parser_ ctx (att, value) =
-    let att_tag = " " ^ att in
+    let att_tag = att_pref ^ att in
     start_element_handler parser_ ctx att_tag [];
     start_element_handler parser_ ctx text_string [];
     let n = top ctx in n.data <- value;