From e19136462d2b66532cbed3490d3b5e249f15a7a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kim=20Nguy=E1=BB=85n?= Date: Wed, 13 Mar 2013 12:41:46 +0100 Subject: [PATCH] Fix a bug in the handling of processing-instruction() test. --- src/xpath/xpath_internal_parser.mly | 11 ++++++----- tests/alphabet.xml.queries | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/xpath/xpath_internal_parser.mly b/src/xpath/xpath_internal_parser.mly index 72a07fb..a40eea9 100644 --- a/src/xpath/xpath_internal_parser.mly +++ b/src/xpath/xpath_internal_parser.mly @@ -15,7 +15,7 @@ (***********************************************************************) (* - Time-stamp: + Time-stamp: *) 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 diff --git a/tests/alphabet.xml.queries b/tests/alphabet.xml.queries index 740d084..6d44231 100644 --- a/tests/alphabet.xml.queries +++ b/tests/alphabet.xml.queries @@ -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/* -- 2.17.1