[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [YANG] import statement



Ladislav Lhotka wrote:
> Martin Bjorklund píše v So 03. 05. 2008 v 21:10 +0200:
>> Ladislav Lhotka <lhotka at cesnet.cz> wrote:
>>> Andy Bierman píše v So 03. 05. 2008 v 10:13 -0700:
>>>> It's a bit tricky.
>>>> Augment puts nodes from the augmenting namespace and
>>>> puts it 'someplace else', which could be the same namespace.
>>>>
>>>> The uses-stmt takes nodes from 'somewhere else' and puts them 'here',
>>>> in the namespace for 'here'.
>>> That's all right, but I still think one can imagine the augment
>>> statement to be replaced by the content of its target node (augmented as
>>> specified) and said content keeps its original namespace. If it is not
>>> so, then I am seriously confused and don't really know why augment can
>>> appear in different places in the schema tree (under module, container
>>> and list).
>> "augment" just extends some other data model, identified by the target
>> node.  This target node expression can be absolute or relative
>> (descendant form).  When augment appears under container or list, the
>> descendant form must be used.  It will extend the current data model
>> in the same module.  The use case is this:
> 
> Then augment performs two fundamentally different things - it is not
> very clear from sect. 7.15. With the descendant form, it would be IMO
> better to pack the augment statement with the uses statement where the
> augmented node appears, like this:
> 
>    module x { 
>      container y {
>        uses foo:bar {
>        	 augment baz {
>          ...
>          }
>        }
>      }
>    }


Not sure if this has any semantic impact.
In my code, it doesn't really make any difference
if 'augment baz' was inside the 'uses foo:bar' or not.
It would be extra work to make sure it was one way or the other.

I think of the uses-stmt as containing the refinements
for the grouping.  I suppose it makes sense to have it
contain both the refinements and extensions.

> 
> With the absolute form, can the target node be e.g., a container inside
> a grouping?

no.  you cannot augment a grouping (from outside the grouping).

> 
> Lada
> 

Andy

_______________________________________________
YANG mailing list
YANG at ietf.org
https://www.ietf.org/mailman/listinfo/yang