Subject: [netmod] yang-09, YIN comments

From: Andy Bierman <[email-masked]>
Date: Sun, 06 Dec 2009 15:12:19 -0800

Hi,

I think sec. 11 needs some minor changes:

sec 11.1, para 5:

OLD:

   The argument of a YANG statement is encoded in YIN either as an XML
   attribute or a subelement of the keyword element.

NEW:

   The argument of a YANG statement is encoded in YIN either as an
   unqualified XML attribute or a subelement of the keyword element.
   ^^^^^^^^^^^

also:

   o  If the argument is encoded as an attribute, this attribute has no
      namespace.

Not sure if 'no namespace' is as clear as 'unqualified attribute'.

------------------------------------------
sec 11.1, para 6:

   Substatements of a YANG statement are encoded as (additional)
   children of the keyword element and their relative order MUST be the
   same as the order of substatements in YANG.

This is only true if yin-element=true for the associated keyword.
XML attributes are unordered and tools such as libxml2 do
not preserve attribute order.

--------------------------------------------

OLD:

sec 11, para 3:

   The mapping between YANG and YIN does not modify the information
   content of the model.  Comments and whitespace are not preserved.

sec 11.1, para 7:

   Comments in YANG MAY be mapped to XML comments.

Suggest this text be combined into sec 11, para 3, and fixed:

NEW:

sec 11, para 3:

   The mapping between YANG and YIN does not modify the information
   content of the model.  Whitespace is not preserved.
   Comments in YANG MAY be mapped to XML comments.

----------------------------------------------

Andy

---

From: Phil Shafer <[email-masked]>
Date: Sun, 6 Dec 2009 21:49:48 -0500

>Not sure if 'no namespace' is as clear as 'unqualified attribute'.

I don't think "unqualified attribute" was a clear meaning.  It's not
in the XML or XML Namespace TRs, but the definition for "qualified attribute"
is:

    http://www.w3.org/TR/xml-names/#concepts

    Definition: A qualified name is a name subject to namespace interpretation.

So an unqualified attribute would assumably be a name which is not
subject to namespace interpretation, which is not a good thing.

In addition:

    In documents conforming to this specification, element and
    attribute names appear as qualified names. Syntactically, they
    are either prefixed names or unprefixed names.

So every attribute name in a compliant document is a qname.  Either
way, we should avoid "unqualified attribute" unless we can find a
clear definition for it.

>   Comments in YANG MAY be mapped to XML comments.

Does this imply that comments are preserved?  Do XML comments in
YIN get mapped to YANG comments?  IMHO, stick with old sec 11, para 3,
and drop the old sec 11.1, para 7.  If we're trying to say they
aren't preserved, then say it and no more.

Thanks,
 Phil

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 07 Dec 2009 08:21:51 +0100 (CET)

No the text is correct.  yin-element only refers to how the *argument*
to the YANG keyword is encoded.  Each YANG statement is mapped to a
YIN XML element.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Mon, 07 Dec 2009 06:43:43 -0800

> to the YANG keyword is encoded.  Each YANG statement is mapped to a

oops --- never mind

Andy

---

From: Andy Bierman <[email-masked]>
Date: Mon, 07 Dec 2009 06:49:27 -0800

> subject to namespace interpretation, which is not a good thing.

So we want to support this:

  <leaf xmlns="yin-ns" xmlns:xxx="" xxx:name="foo"> ....

instead of:

  <leaf xmlns="yin-ns" name="foo">

The attribute is supposed to be in 'no namespace' according
to the YANG text

> aren't preserved, then say it and no more.

The current text is wrong.
1 sentence says comments are ignored
and another says they MAY get converted.
I think even whitespace MAY be converted somehow.
It is not required, and the client cannot expect it,
but it is certainly not an error if the tool
does convert either whitespace or comments.

Andy

---

From: Phil Shafer <[email-masked]>
Date: Mon, 7 Dec 2009 09:49:51 -0500

>The attribute is supposed to be in 'no namespace' according

This is fine, I'm just saying adding the term "unqualified attribute"
is not a good thing.

>does convert either whitespace or comments.

The YANG->YIN->YANG mapping does not preserve comments or whitespace.
Any features a particular toolset adds over the standard mapping
(even stuff like indentation) are outside the standard.  If your
tool can roundtrip comments, that's fine, but it's not part of the
standard as written.  I think just saying "does not preserve" is
fine.

Thanks,
 Phil

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 07 Dec 2009 18:47:25 +0100

>    unqualified XML attribute or a subelement of the keyword element.

I am against the change, 'no namespace' must be sufficiently clear to
anybody with at least a faint idea about XML namespaces.

Lada

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

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 07 Dec 2009 19:05:51 +0100

>   <leaf xmlns="yin-ns" xmlns:xxx="" xxx:name="foo"> ....

I believe this is not allowed. Only the attribute value in a default
namespace declaration may be empty.

> The attribute is supposed to be in 'no namespace' according

This attribute is in no namespace according to the rules of XML
namespaces.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C