Fixed: [XPath * stopped working in 7.3](https://github.com/clicon/clixon/issues/594)
This commit is contained in:
parent
ed226a990c
commit
302762f5af
3 changed files with 25 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ Planned: April 2025
|
|||
|
||||
### Corrected Bugs
|
||||
|
||||
* Fixed: [XPath * stopped working in 7.3](https://github.com/clicon/clixon/issues/594)
|
||||
* Fixed: [Templates with nc:operation "merge" causes bad diffs to be shows](https://github.com/clicon/clixon-controller/issues/187)
|
||||
|
||||
## 7.3.0
|
||||
|
|
|
|||
|
|
@ -142,6 +142,9 @@ nodetest_eval_namespace(cxobj *x,
|
|||
char *ns1 = NULL; /* xml namespace */
|
||||
char *ns2 = NULL; /* xpath namespace */
|
||||
|
||||
/* Namespaces is s0, name is s1 */
|
||||
if (strcmp(xs->xs_s1, "*")==0)
|
||||
goto ok;
|
||||
/* XML x -> prefix1 + name1 */
|
||||
prefix1 = xml_prefix(x);
|
||||
name1 = xml_name(x);
|
||||
|
|
@ -169,9 +172,7 @@ nodetest_eval_namespace(cxobj *x,
|
|||
}
|
||||
else if (strcmp(ns1, ns2) != 0)
|
||||
goto fail;
|
||||
#ifdef XPATH_NS_ACCEPT_UNRESOLVED
|
||||
ok:
|
||||
#endif
|
||||
retval = 1;
|
||||
done: /* retval set in preceding statement */
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -143,6 +143,12 @@ module clixon-example {
|
|||
type string;
|
||||
}
|
||||
}
|
||||
container options {
|
||||
leaf max-number {
|
||||
type uint32;
|
||||
default 50000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
|
@ -556,7 +562,7 @@ EOF
|
|||
new "given value show key"
|
||||
expectpart "$($clixon_util_xpath -D $DBG -f $dir/1.xml -n ex:urn:example:clixon -y $fyang < $dir/1.xpath)" 0 "<name>x</name>"
|
||||
|
||||
|
||||
# See https://github.com/clicon/clixon/issues/594
|
||||
cat <<EOF > $dir/1.xpath
|
||||
/table/parameter[value='42']/value
|
||||
EOF
|
||||
|
|
@ -564,6 +570,20 @@ EOF
|
|||
new "given value show value"
|
||||
expectpart "$($clixon_util_xpath -D $DBG -f $dir/1.xml -n ex:urn:example:clixon -y $fyang < $dir/1.xpath)" 0 "<value>42</value>"
|
||||
|
||||
cat <<EOF > $dir/1.xml
|
||||
<table xmlns="urn:example:clixon">
|
||||
<options>
|
||||
<max-number>50000</max-number>
|
||||
</options>
|
||||
</table>
|
||||
EOF
|
||||
|
||||
new "xpath issue ok"
|
||||
expectpart "$($clixon_util_xpath -D $DBG -f $dir/1.xml -n ex:urn:example:clixon -y $fyang -p "/ex:table/options/*")" 0 "<max-number>50000</max-number>"
|
||||
|
||||
new "xpath issue fail"
|
||||
expectpart "$($clixon_util_xpath -D $DBG -f $dir/1.xml -n null:urn:ietf:params:xml:ns:netconf:base:1.0 -n ex:urn:example:clixon -y $fyang -p "/ex:table/ex:options/*")" 0 "<max-number>50000</max-number>"
|
||||
|
||||
rm -rf $dir
|
||||
|
||||
new "endtest"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue