On 16/12/2021 12:27, Michal Vaško wrote:
On 14/12/2021 14:04, Ladislav Lhotka wrote:
[snip]
The existing rules in RFC 7950 seem unclear/contradictory. This is in sec. 7.12 on "grouping": Identifiers appearing inside the grouping are resolved relative to the scope in which the grouping is defined, not where it is used. Prefix mappings, type names, grouping names, and extension usage are evaluated in the hierarchy where the "grouping" statement appears. And this is then in sec. 7.13 on "uses": The identifiers defined in the grouping are not bound to a namespace until the contents of the grouping are added to the schema tree via a "uses" statement that does not appear inside a "grouping" statement, at which point they are bound to the namespace of the current module.Just my .02EUR, in OpenDaylight we deal with this particular case in two steps: 1. the argument to unique is interpreted in scope of mod_a, hence "mb:b c" interprets the same as "mb:b ma:c", just as it would in any other declaration site 2. in the particular case of "deviate add", the statement is then copied verbatim to deviation target site i.e. this works similar to how an augment would work -- and hence the quoted example works as one would expect from just a cursory glance at the model without giving it a second thought :)Thanks, we will have to come up with our own solution as well. If I understood properly, you are technically adding the prefix when it is missing. That should be fine for "unique" but generally impossible to do for "must", for example. We have tried similar solutions but were not reliable enough and it seems there is no reliable solution even in theory based on this discussion, unfortunately.
That's true, but then 'must' takes an XPath, and the rules for handling that are unambiguous (as per section 6.4.1). In this particular case:
- unprefixed names would propagate to the deviated list unprefixed would be bound to the list's namespace - prefixed names would be bound at the declaration site, i.e. under deviate, and would be propagated as-is to the deviated list
Regards, Robert
OpenPGP_signature
Description: OpenPGP digital signature
_______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod