On Mon, 2019-10-21 at 14:01 +0200, Martin Bjorklund wrote:
> Ladislav Lhotka <[email protected]> wrote:
> > On Mon, 2019-10-21 at 13:40 +0200, Martin Bjorklund wrote:
> > > Hi,
> > > 
> > > Ladislav Lhotka <[email protected]> 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

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to