Subject: Re: [netmod] Accessible subtree for When

From: Balazs Lengyel <[email-masked]>
Date: Thu, 24 Sep 2015 11:08:36 +0200

On 2015-09-23 19:34, Martin Bjorklund wrote:
> Balazs Lengyel <[email-masked]> wrote:
>> Hello Martin,
>> The RFC 6002bis-07writes:
>>
>> If the "when" statement is a child of any other data definition
>>        statement, the accessible tree is tentatively altered during the
>>        processing of the XPath expression by replacing all instances (if
>>        any) of the data node for which the "when" statement is defined
>>        with a single dummy node with the same name, but with no value and
>>        no children.  The context node is this dummy node.
>>
>> This to me means that the XPath expression can not reference any data nodes below
>> the when expression. True?
>>
>> This seems reasonable and needed. However if the when is a child of a uses,
>> choice, case or augment I don't see a similar rule. So the following would be
>> allowed:
>>
>>      augment "/if:interfaces/if:ifEntry" {
>>         when "num = 5";
>>         leaf num { type uint8; }
>>     }
>> This would be crazy as setting num to 5 would delete num itself. So I would
>> rather see a rule like:
>>
>> "When Xpath expressions MUST NOT reference data below the data definition
>> statement containing when."
> I think it would be better to say that these nodes do not exist in the
> XPath evaluation.  That gives deterministic behaviour.  The "MUST NOT
> reference" is hard to detect in a compiler...
>
>
> /martin
I am OK with that, just please make it generic for all cases of when, 
including cases when the when statement is a child of a uses,
choice, case or augment.
regards Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
ECN: 831 7320
Mobile: +36-70-330-7909              email: [email-masked]