Fix a bug in the handling of processing-instruction() test.
authorKim Nguyễn <kn@lri.fr>
Wed, 13 Mar 2013 11:41:46 +0000 (12:41 +0100)
committerKim Nguyễn <kn@lri.fr>
Wed, 13 Mar 2013 11:41:46 +0000 (12:41 +0100)
src/xpath/xpath_internal_parser.mly
tests/alphabet.xml.queries

index 72a07fb..a40eea9 100644 (file)
@@ -15,7 +15,7 @@
 (***********************************************************************)
 
 (*
-  Time-stamp: <Last modified on 2013-03-13 12:11:04 CET by Kim Nguyen>
+  Time-stamp: <Last modified on 2013-03-13 12:38:54 CET by Kim Nguyen>
 *)
 
   open Ast
@@ -136,10 +136,11 @@ test:
 | COMMENT             { Utils.QNameSet.singleton(Utils.QName.comment),
                         NodeKind.Comment
                       }
-| PI                  { Utils.QNameSet.singleton(
-                              Utils.QName.processing_instruction (
-                                Utils.QName.of_string $1)
-                         ), NodeKind.ProcessingInstruction
+| PI                  { (if $1 = "" then star
+                         else Utils.QNameSet.singleton(
+                           Utils.QName.processing_instruction (
+                             Utils.QName.of_string $1)
+                         )), NodeKind.ProcessingInstruction
                       }
 | TAG                 { Utils.QNameSet.singleton(Utils.QName.of_string $1),
                         NodeKind.Element
index 740d084..6d44231 100644 (file)
@@ -24,8 +24,8 @@ P11 //*[self::L]
 P12 //*[@id]
 T1 //L/text()
 T2 //L/comment()
-T3 //L/processing-instruction()
-T4 //L/processing-instruction("myPI")
+T3 //L/processing-instruction()
+T4 //L/processing-instruction("myPI")
 T5 //L/node()
 T6 //L/N
 T7 //L/*