Re: [netmod] leafref and identityref

Ladislav Lhotka <lhotka@nic.cz> Mon, 21 October 2019 12:59 UTC

Return-Path: <lhotka@nic.cz>
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 4DA3012011E for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 05:59:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.998
X-Spam-Level:
X-Spam-Status: No, score=-6.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 kLbLmDYGoEjj for <netmod@ietfa.amsl.com>; Mon, 21 Oct 2019 05:59:24 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CEF10120830 for <netmod@ietf.org>; Mon, 21 Oct 2019 05:59:23 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a88f:7eff:fed2:45f8]) by mail.nic.cz (Postfix) with ESMTPSA id 12ECE140E3D; Mon, 21 Oct 2019 14:59:21 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1571662761; bh=mc//SeIn1/xR8O57rs7zVl7R4Sq++V6RUFETkhI1pDM=; h=From:To:Date; b=Mn5TGUT/LKQYF+owPZ5usMz1h/xxXXm6w9y0A3hs2dgAPvEl7+/idTHITsi/8jDkf PL9uDhfD1y6y2/3E9qssdVFwPNqEUOH3kYHOguBjK8D+seh67Juz/D+fKk8BAWMDTk e74vu1SPT1soIhiPJDvxXPVZSWtHq8dGu44fTlOA=
Message-ID: <59c5b3e6727422664c285b670a64940c6f9af29a.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: netmod@ietf.org
Date: Mon, 21 Oct 2019 14:59:20 +0200
In-Reply-To: <20191021.140150.1807416568931644257.mbj@tail-f.com>
References: <8736fmtk3d.fsf@nic.cz> <20191021.134014.40553165389352172.mbj@tail-f.com> <6af41ca9659453dfe9f573c6827877e70cd27a7e.camel@nic.cz> <20191021.140150.1807416568931644257.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/wyFaU8yafeJ1ean78f7EFT4ORCY>
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:59:26 -0000

On Mon, 2019-10-21 at 14:01 +0200, Martin Bjorklund wrote:
> 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.

OK, but still: foo represents its value using the default namespace on <foo>,
which is "...namespace of A...". That's why

<foo xmlns="...namespace of A...">X</foo>

is correct. And if the fooref value is LEXICALLY represented the same way, then
it has to be "X" as well (this is what lexical space value means in XML).

What we probably mean is something like

   The rules for a leafref value are obtained by pretending that the leaf has 
   the same type as the referenced leaf.

Lada  

> 
> > It seems that we agree that it is incorrect, but then sec. 9.9.4 should be
> > clarified.
> 
> 
> 
> 
> /martin
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67