Hi Rob, I have forgotten to mention that I have fixed it by modifying the leafref path the exact same way you proposed, it works fine that way.
Regards, Michal On Friday, January 26, 2018 10:55 CET, Robert Wilton <[email protected]> wrote: > Hi Michal, > > Thanks for raising this. > > On 26/01/2018 09:14, Michal Vaško wrote: > > Hello, > > > > we have tried implementing the YANG module > > [email protected] from draft-ietf-netconf-rfc7895 and have > > encountered a problem. I am not completely certain that the issue is with > > the model and not our XPath evaluator, but based on the definitions I have > > found I believe the model is wrong. > > > > module: ietf-yang-library > > +--ro yang-library > > +--ro module-set* [name] > > +--ro module* [name] > > +--ro name yang:yang-identifier > > +--ro deviation* [module] > > +--ro module -> ../../name > > > > In the tree diagram (I have removed irrelevant parts) it can be seen that > > there is a "deviation" leafref that should point from one "module" list > > instance to another identifying the deviation module. So, the supposed > > evaluation should take the following steps: we start with leaf "module" we > > take ".." path so we get the "deviation" list. Then we take another ".." > > and we end up with all the "module" list instances. Finally, we try to find > > "name" leaf in all these instances of the "module" list. > > > > However, our evaluator and some I have found online (all behaving according > > to XPath definition, I think) proceed differently. At the point of going > > one step up (parent node) into what es expected to be all the "module" list > > instances, the context node actually becomes only the *specific module list > > instance* we have started from, so when looking for the "name" leaf only > > the name of this list instance is taken into consideration. Needless to > > say, the evaluation never finds a matching "name" leaf because > > "module/name" and "module/deviation/module" should never match in one > > "module" list instance and so the validation always fails. > It looks like the leafref should be "../../../module/name". > > Does that fix the issue for you? > > Thanks, > Rob > > > > Kind regards, > > Michal Vasko > > > > _______________________________________________ > > Netconf mailing list > > [email protected] > > https://www.ietf.org/mailman/listinfo/netconf > > . > > > _______________________________________________ netmod mailing list [email protected] https://www.ietf.org/mailman/listinfo/netmod
