William Ivory <[email protected]> wrote:
> Hi,
> 
> I'd appreciate clarification on whether a YANG path in an XPATH
> statement in a must or when statement must point to a valid YANG path
> or not.  You might wonder why we'd have an invalid path (as opposed to
> one that's simply not configured right now) but it is occasionally
> helpful when sharing groupings.  (Possibly we should remodel the YANG
> but that's another matter!).
> 
> As a simple example, is the following allowed?
> 
> Container foo {
>         Leaf bar {
>                 Type string;
>                 Must "not(../nonExistentSiblingNode)";
>         }
> }

Yes this is allowed.  Many YANG compilers give warnings for this kind
of expression, but it is legal.

> I don't see that this should be any different to a must statement path
> pointing to an unconfigured node, returning an empty nodeset in both
> cases.
> 
> The reason I ask is that we are seeing a NETCONF client
> differentiating between unconfigured (ok) and non-existent (error)
> cases.  It would be useful to know one way or the other, ideally with
> a pointer to the relevant part of the spec that makes this clear.

It follows from how XPath works, and the fact that there is no text in
RFC 7950 (or 6020) that limits XPath to something non-standard.


/martin

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

Reply via email to