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

Re: [YANG] import statement



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 {
         ...
         }
       }
     }
   }

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

Lada

> 
>  
>    module foo {
>      grouping bar {
>        container baz { ... }
>      }
>    }
> 
>    module x { 
>      container y {
>        uses foo:bar;      // adds nodes from the bar grouping into my module
>        augment baz {      // augment the new nodes with stuff
>          ...
>        }
>      }
>    }
> 
> 
> In this example the relative augment could be replaced by a slightly
> more verbose top-level augment, but in the following case it's not as
> easy:
> 
>    module z {
>      grouping zz {
>        uses foo:bar;
>        augment baz {
>          ...
>        }
>      }
>    }
> 
> 
> 
> /martin
> _______________________________________________
> YANG mailing list
> YANG at ietf.org
> https://www.ietf.org/mailman/listinfo/yang
-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

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