Re: [netmod] leafref and identityref

Martin Bjorklund <mbj@tail-f.com> Mon, 21 October 2019 12:02 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C4B6D120110 for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 05:02:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b4e0rdOp0dvo for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 05:02:20 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id D3D801200EB for <netmod@ietf.org>; Mon, 21 Oct 2019 05:02:19 -0700 (PDT)
Received: from localhost (unknown [173.38.220.41]) by mail.tail-f.com (Postfix) with ESMTPSA id C02C71AE018A; Mon, 21 Oct 2019 14:02:18 +0200 (CEST)
Date: Mon, 21 Oct 2019 14:01:50 +0200
Message-Id: <20191021.140150.1807416568931644257.mbj@tail-f.com>
To: lhotka@nic.cz
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <6af41ca9659453dfe9f573c6827877e70cd27a7e.camel@nic.cz>
References: <8736fmtk3d.fsf@nic.cz> <20191021.134014.40553165389352172.mbj@tail-f.com> <6af41ca9659453dfe9f573c6827877e70cd27a7e.camel@nic.cz>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/VTr-8gEiQg-TBTXrFWwGp3K6Suc>
Subject: Re: [netmod] leafref and identityref
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 21 Oct 2019 12:02:22 -0000

Ladislav Lhotka <lhotka@nic.cz> wrote:
> On Mon, 2019-10-21 at 13:40 +0200, Martin Bjorklund wrote:
> > Hi,
> > 
> > Ladislav Lhotka <lhotka@nic.cz> wrote:
> > > Hi,
> > > 
> > > consider the following situation:
> > > 
> > > module A {
> > >   ...
> > >   prefix a
> > >   identity X;
> > >   leaf foo {
> > >     type identityref {
> > >       base X;
> > >     }
> > >   }
> > > }
> > > 
> > > module B {
> > >   ...
> > >   import A {
> > >     prefix a;
> > >   }
> > >   leaf fooref {
> > >     type leafref {
> > >       path "/a:foo";
> > >     }
> > >   }
> > > }
> > > 
> > > What is now a correct lexical form of fooref's value? Could it be just
> > > 'X', or is the prefix required, i.e. 'a:X'?
> > > 
> > > This is not very clear from RFC 7950 (sections 9.9.4 and 9.10.3). I am
> > > inclined to require the prefix.
> > 
> > 9.10.3 says:
> > 
> >    If the prefix is not
> >    present, the namespace of the identityref is the default namespace
> >    in effect on the element that contains the identityref value.
> > 
> > 
> > so the interpretation of a missing prefix in "fooref" is that the
> > identity is defined in module B.
> > 
> > (a missing prefix in "foo" means that the identity is defined in
> > module A)
> 
> To be more specific, here is an example instance:
> 
> <foo xmlns="...namespace of A...">X</foo>
> <fooref xmlns="...namespace of B...">X</fooref>
> 
> It can be argued that this is correct because (sec. 9.9.4):
> 
>    A leafref value is lexically represented the same way as the leaf it
>    references represents its value.
> 
> That is, the same lexical representation is assumed, which is exactly what we
> have in the example.

It doesn't say that the lexical value is exactly the same, but
"represented the same way" - so when the lexical representation is
context dependent we have this situation.

> It seems that we agree that it is incorrect, but then sec. 9.9.4 should be
> clarified.




/martin