[sysrepo-devel] libyang XPath changes

Michal Vaško mvasko at cesnet.cz
Tue Jul 4 12:53:37 UTC 2017


Hello,

today I created a pull request #889 that adjust sysrepo to recently found libyang XPath bugs. I (and it seems also everyone else working on libyang/sysrepo) misunderstood how unprefixed nodes are resolved. In short, it does not matter at all what a node's parent is, an unprefixed node uses the context module prefix.

Unfortunately, this change concerns a significant part of both libyang and sysrepo so it is likely you will encounter some problems connected to these changes. For example, even for a simple subscription, you must use instead "/ietf-interfaces-interfaces/interface/ietf-ip:ipv4/mtu" the XPath "/ietf-interfaces-interfaces/interface/ietf-ip:ipv4/ietf-ip:mtu". The first node must still be prefixed because it is used to find the starting module and node and hence becomes the context node/module. That means, that whenever you are later referencing context module nodes (nodes from ietf-interfaces in this example), you can skip the prefix. However, if you are referencing nodes form another module you must ALWAYS use the prefix (nodes from ietf-ip).

Now, with the mentioned pull request sysrepo devel should compile and work with current devel libyang. But, I am still looking for affected addressing in libyang, so further fixes of libyang will likely follow. Whether they will again affect sysrepo I cannot say. If they do, I will try to keep sysrepo and libyang compatible and commit changes in both simultaneously.

Kind regards,
Michal


More information about the sysrepo-devel mailing list