Skip to content

Commit

Permalink
Fix part 2 for [Xpath API do not support filter data by wildcard](#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Mar 15, 2022
1 parent a973eaa commit 03f667e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/src/clixon_xpath_parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
#include "clixon_xpath_ctx.h"
#include "clixon_xpath.h"
#include "clixon_xpath_function.h"

#include "clixon_xpath_eval.h"
#include "clixon_xpath_parse.h"

/* Best debugging is to enable PARSE_DEBUG below and add -d to the LEX compile statement in the Makefile
Expand Down Expand Up @@ -178,7 +178,7 @@ xpath_parse_exit(clixon_xpath_yacc *xpy)
* @param[in] i0 step-> axis_type
* @param[in] numstr original string xs_double: numeric value
* @param[in] s0 String 0 set if XP_PRIME_STR, XP_PRIME_FN, XP_NODE[_FN] PATHEXPRE prefix
* @param[in] s1 String 1 set if XP_NODE NAME
* @param[in] s1 String 1 set if XP_NODE NAME (or "*")
* @param[in] c0 Child 0
* @param[in] c1 Child 1
*/
Expand Down Expand Up @@ -441,7 +441,7 @@ axisspec : AXISNAME { _PARSE_DEBUG1("axisspec-> AXISNAME(%d) ::", $1); $$=$1;
| { _PARSE_DEBUG("axisspec-> "); $$=A_CHILD;}
;

nodetest : '*' { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, NULL, NULL, NULL); _PARSE_DEBUG("nodetest-> *"); }
nodetest : ADDOP { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, strdup(clicon_int2str(xpopmap,$1)), NULL, NULL); _PARSE_DEBUG("nodetest-> *"); }
| NAME { $$=xp_new(XP_NODE,A_NAN,NULL, NULL, $1, NULL, NULL); _PARSE_DEBUG1("nodetest-> name(%s)",$1); }
| NAME ':' NAME { $$=xp_new(XP_NODE,A_NAN,NULL, $1, $3, NULL, NULL);_PARSE_DEBUG2("nodetest-> name(%s) : name(%s)", $1, $3); }
| NAME ':' '*' { $$=xp_new(XP_NODE,A_NAN,NULL, $1, NULL, NULL, NULL);_PARSE_DEBUG1("nodetest-> name(%s) : *", $1); }
Expand Down
2 changes: 0 additions & 2 deletions test/test_xpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ cat <<EOF > $xml4
</root>
EOF



new "xpath /"
expecteof "$clixon_util_xpath -f $xml -p /" 0 "" "^nodeset:0:<aaa><bbb x=\"hello\"><ccc>42</ccc></bbb><bbb x=\"bye\"><ccc>99</ccc></bbb><ddd><ccc>22</ccc></ddd></aaa>$"

Expand Down
2 changes: 2 additions & 0 deletions util/clixon_util_xpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,5 +385,7 @@ main(int argc,
xml_free(x0);
if (fp)
fclose(fp);
if (h)
clicon_handle_exit(h);
return retval;
}

0 comments on commit 03f667e

Please sign in to comment.