Closed kelin-Monster closed 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.
did this turn out to be a non-issue?
container instances { list instance { key name;
}
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.