Subject: [YANG] extension naming scope

From: Andy Bierman <[email-masked]>
Date: Sat, 09 Feb 2008 14:17:17 -0800

Hi,

I think the extension naming scope needs to be removed, and extensions
need to be in the same scope as rpc, notification, and all objects.
When converted to YIN, an extension element is in the same XML namespace
as the object instances defined in the same module.

Andy
_______________________________________________
YANG mailing list
[email-masked]
http://www.ietf.org/mailman/listinfo/yang

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 10 Feb 2008 22:05:08 +0100 (CET)

> as the object instances defined in the same module.

I don't think this is a problem.  The same thing is done in XSD, where
e.g. simpleTypes and elements have different naming scopes.  In XSD,
there can be a simpleType named 'foo' and an element named 'foo' and a
group named 'foo' at the same time.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Sun, 10 Feb 2008 13:23:36 -0800

> group named 'foo' at the same time.

I disagree.

   leaf foo { type int16; }

   extension foo {
     argument bar {
       yin-element false;
     }
   }

These are both defined in the same XML namespace.

   <foo>17</foo>

   <foo bar="some string"/>

The <element generated for the extension is in the same namespace
as the one generated for the leaf.

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 10 Feb 2008 22:52:18 +0100 (CET)

Andy Bierman <[email-masked]> wrote:
> Well, how about this one?
> 
> module x {
>      ...
>      prefix x;
>      ...
> 
>      leaf foo {
>        type int16;
>        x:foo "some string";
>      }
> 
>      x:foo "another string";
> 
>      extension foo {
>        argument bar {
>          yin-element false;
>        }
>      }
> }

I'm sorry, I don't see the problem.  leaf foo and extension foo are
different entities.  The YIN translations looks like this:

$ ./pyang.py x.yang -f yin
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:ietf:params:xml:ns:yin:1"
        name="x">
  <prefix value="x"/>
  <namespace uri="x"/>
  <leaf name="foo">
    <type name="int16"/>
    <x:foo bar="some string"/>
  </leaf>
  <x:foo bar="another string"/>
  <extension name="foo">
    <argument name="bar">
      <yin-element value="false"/>
    </argument>
  </extension>
</module>

/martin

---

From: Andy Bierman <[email-masked]>
Date: Sun, 10 Feb 2008 13:43:49 -0800

Martin Bjorklund wrote:
> The YIN version of this is:
> 
>   <leaf name="foo">
>     <type name="int16"/>
>   </leaf>
>   <extension name="foo">
>     <argument name="bar">
> Maybe you didn't mean YIN, but XSD?
> 

module x {
     ...
     prefix x;
     ...

     leaf foo {
       type int16;
       x:foo "some string";
     }

     x:foo "another string";

     extension foo {
       argument bar {
         yin-element false;
       }
     }
}

Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Sun, 10 Feb 2008 22:31:04 +0100 (CET)

<leaf name="foo">
    <type name="int16"/>
  </leaf>
  <extension name="foo">
    <argument name="bar">

/martin

---

From: Andy Bierman <[email-masked]>
Date: Sun, 10 Feb 2008 15:41:07 -0800

> different entities.  The YIN translations looks like this:

okay -- if you imported x into the YIN document,
then it would be correct.  I forget everything
including the values in in the YIN namespace.

Andy