Subject: [netmod] WGLC comments about anyxml

From: David Reid <[email-masked]>
Date: Thu, 14 May 2009 15:34:40 -0400

A few questions and comments about anyxml:

section 3.1: can anyxml be mandatory?

section 4.2.2 says "YANG defines four types of nodes for data modeling". Is
anyxml a 5th type of node for data modeling or is anyxml a different kind
of beast?

section 6.2.1: anyxml is not included anywhere. I assume it should be listed 
with leafs, leaf-lists, etc.

sections 7.5.6 and 7.8.4: should anyxml be added as a possible child node?

section 7.10 states that the "anyxml" statement defines an interior node in 
the schema tree. A note about how it affects the data tree might also be
useful, much like some of the other parts of section 7.

-David Reid

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 15 May 2009 10:08:13 +0200

> A few questions and comments about anyxml:

Yes, I pointed this out in my review, too. Anyxml has been forgotten in
a few places.

Lada

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 18 May 2009 13:21:00 +0200 (CEST)

Hi,

> section 3.1: can anyxml be mandatory?

Yes, fixed.

> anyxml a 5th type of node for data modeling or is anyxml a different kind

Technically speaking I guess it is a 5th type of node, but I would
prefer to not mention it in this section.  Phil, do you have any
comments?

> with leafs, leaf-lists, etc.

Yes, fixed.

> sections 7.5.6 and 7.8.4: should anyxml be added as a possible child node?

Yes, fixed.

> useful, much like some of the other parts of section 7.

I suggest a simple sentence:

  An anyxml node exists in zero or one instances in the data tree.

Should we say something about its value and child nodes?  If so, can
we say that it's value is the unknown chunk of XML, and it has no
child nodes.

/martin

---

From: David Reid <[email-masked]>
Date: Mon, 18 May 2009 08:52:50 -0400

> prefer to not mention it in this section.  

I don't think we want to encourage the use of anyxml, so not mentioning it 
here is fine with me. Part of the reason for my question was just to make sure
I was understanding anyxml correctly.

>   An anyxml node exists in zero or one instances in the data tree.

Sounds good.

> we say that it's value is the unknown chunk of XML, and it has no

I think that would be helpful.

-David Reid

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 18 May 2009 15:00:17 +0200

> prefer to not mention it in this section.  Phil, do you have any

An alternative would be to define "anyxml" as "any XML content" rather
than a special container. So what is now written as

anyxml foo;

would be

container foo {
    anyxml;
}

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E 8C0C

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 18 May 2009 15:05:31 +0200 (CEST)

> than a special container. So what is now written as

I don't see how this would help the description of 'anyxml'.

This change would open for some questions:

Is this legal:

  container foo {
      leaf bar { type int32; }
      anyxml;
  }

If it is, is this a legal <foo>:

  <foo>
     <bar>hello</bar>
  </foo>

and so on...

/martin

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 18 May 2009 15:18:44 +0200

> I don't see how this would help the description of 'anyxml'.

anyxml would no more be among YANG structural building blocks, just an
anonymous (and optional) XML blob. In particular, it will not influence
whether container foo is or isn't mandatory.

Lada

> This change would open for some questions:

It could be.

> If it is, is this a legal <foo>:

Yes, IMO.

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E 8C0C

---

From: David Reid <[email-masked]>
Date: Mon, 18 May 2009 15:13:22 -0400

> than a special container. So what is now written as

Could we change anyxml to be a type? So the example above would become

leaf foo {
    type anyxml;
}

-David Reid

---

From: "Joel M. Halpern" <[email-masked]>
Date: Mon, 18 May 2009 15:29:46 -0400

It seems that having a specific wrapper, in which any xml is permitted, 
is a good idea.
Otherwise, it appears that any XML envelop in which anyxml is permitted 
would be unable to ever generate any errors.

Yours,
Joel

---

From: Andy Bierman <[email-masked]>
Date: Mon, 18 May 2009 12:54:46 -0700

> Could we change anyxml to be a type? So the example above would become

It started out that way.
The problem is that anyxml is not a leaf.
Let's leave anyxml alone. e.g.:

   anyxml foo {
     when "...";
     if-feature "bar";   // X N
     must "...";  // X N
     config false;
     mandatory false;
     status current;
     description "...";
     reference "...";
   }

> -David Reid

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 18 May 2009 22:25:49 +0200

> The problem is that anyxml is not a leaf.

Why is it a problem? The contents of current anyxml needn't be a leaf
either.

> Let's leave anyxml alone. e.g.:

I am not against it, but then anyxml has to be added in a few places
as the fifth possible building block.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E 8C0C

---

From: David Reid <[email-masked]>
Date: Tue, 19 May 2009 13:23:47 -0400

> The problem is that anyxml is not a leaf.

How would anyxml typically be used? Why would it not work to make it a leaf?

-David Reid

---

From: Andy Bierman <[email-masked]>
Date: Tue, 19 May 2009 10:40:45 -0700

> How would anyxml typically be used? Why would it not work to make it a leaf?

The <filter> element in NETCONF is an example of anyxml.

There are 3 forms of anyxml accepted:

  1) empty   <foo/>

  2) leaf    <foo>string</foo>

  3) complex  <foo>
                <bar>string</bar>
                <baz>
                  <taz/>
                </baz>
              </foo>

Due to form (3), leaf is not appropriate.

Andy