clicon / clixon

YANG-based toolchain including NETCONF and RESTCONF interfaces and an interactive CLI
http://www.clicon.org/
Other
212 stars 71 forks source link

fetch data using xpath_first with xpath fail #423

Closed kelin-Monster closed 1 year ago

kelin-Monster commented 1 year ago

container instances { list instance { key name;

    leaf name {
        type string;
    }

    container config {
        leaf type {
            type string;
        }
        leaf enabled {
            type string;
            default true;
        }
        leaf value {
            type uint32;
        }
    }
}

}

First insert following two data set to db: { "instance": [ { "name": "default", "config": { "type": "add", "enabled": true, "value": 1 } } ] } { "instance": [ { "name": "name1", "config": { "type": "del", "enabled": true, "value": 2 } } ] }

Then try to fetch and filter data using xpath_first with xpath

xmldb_get(h, nsc, NULL, "/instances", &xt); xpath_first(xt, nsc, "./instances/instance[name='%s']", "default");

but no data is return, I wonder whether this is a problem.

olofhagsand commented 1 year ago

did this turn out to be a non-issue?