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.

Kind regards,
Michal Vasko

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to