Fix the handling of attributes:
[tatoo.git] / src / xpath / xpath_internal_parser.mly
index de63cdf..fe38f67 100644 (file)
@@ -15,7 +15,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-09 16:56:45 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-09 19:24:28 CET by Kim Nguyen>
 *)
 
   open Ast
@@ -84,7 +84,16 @@ step:
 ;
 
 axis_test:
-  AXIS COLONCOLON test  { $1, $3 }
+  AXIS COLONCOLON test  { let a, t = $1, $3 in
+                          if a == Attribute && Utils.QNameSet.is_finite t then 
+                            (a, Utils.QNameSet.fold
+                              (fun t a ->
+                                Utils.QNameSet.add
+                                  (Utils.QName.add_attribute_prefix t) a)
+                              t Utils.QNameSet.empty)
+                          else
+                            (a, t)
+                        }
 | test                  { Child, $1 }
 | AXIS            {
   let _ = Format.flush_str_formatter () in