Subject: [Netconf] disallow xmlns prefixes in RESTCONF?

From: Kent Watsen <[email-masked]>
Date: Tue, 17 Feb 2015 23:57:16 +0000

Just submitted RESTCONF issue #20
(https://github.com/netconf-wg/restconf/issues/20):

NETCONF is too permissive. Rather than allow wild variations including:

    <y:foo xmlns="x" xmlns:y="y" xmlns:z="z">
      <z:bar>
        <z:baz/>
      </z:bar>
    </y:foo>

Maybe only allow default namespaces (e.g., no prefixes), so the above can
only be encoded as:

    <foo xmlns="y">
      <bar xmlns="z">
        <baz/>
      </bar>
    </foo>

Thoughts?

Thanks,
Kent      // looking for a fire-retardant...

---

From: Phil Shafer <[email-masked]>
Date: Tue, 17 Feb 2015 19:05:31 -0500

>NETCONF is too permissive. Rather than allow wild variations including:

This new encoding isn't XML and isn't standard.  XML gives the
encoder the flexibility to choose between alternative representations
of identical data.  There is no canonical form.

Thanks,
 Phil

---

From: Kent Watsen <[email-masked]>
Date: Wed, 18 Feb 2015 00:38:22 +0000

>This new encoding isn't XML and isn't standard.

How so?

>XML gives the

True, and hence the "problem"

K.

---

From: Phil Shafer <[email-masked]>
Date: Tue, 17 Feb 2015 19:47:35 -0500

>>This new encoding isn't XML and isn't standard.

You are trying to make a subset of XML.  Subsets by definition
aren't the full thing.  A subset of XML isn't XML.  That means when
you make an XML library call to emit XML, it will make XML that
doesn't follow the rules of your subset.  You need distinct custom
encoding functions, which diminishes the value of following the
standard.

Thanks,
 Phil

---

From: Andy Bierman <[email-masked]>
Date: Tue, 17 Feb 2015 16:52:41 -0800

>>This new encoding isn't XML and isn't standard.

By creating an ad-hoc subset of XML just for NETCONF.

> True, and hence the "problem"

I agree with Phil that we cannot make prefixes invalid in NETCONF.
I don't see the problem. Processing xmlns attributes is still required
either way.

> K.

Andy

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

---

From: Kent Watsen <[email-masked]>
Date: Wed, 18 Feb 2015 04:10:41 +0000

>encoding functions, which diminishes the value of following the

OK, good, at first I thought you were trying to say the example wasn't
valid XML, as it most certainly is.

As for correctness, I'm pretty sure it can be proven that any XML document
can be converted to the form where all namespaces are declared locally to
the element where they are used (for attributes, which do not inherit the
default namespace, the prefix can also be set in the local element).
These are just optional encoding strategies and this one seems to be best
practice that happens to align nicely with the JSON-encoding strategy.
Yes, it's a subset, so what?   Is it any different than 6020 using a
subset of XPath for leafref and instance-identifier statements?

FWIW, I realize that this is a long shot, hence my fire-retardent quip at
the start  ;)

Kent

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 18 Feb 2015 08:45:45 +0100 (CET)

Andy Bierman <[email-masked]> wrote:
> I don't see the problem.

+1

Kent, you didn't describe what the perceived "problem" is, you just
presented a solution...

/martin

---

From: Jan Lindblad <[email-masked]>
Date: Wed, 18 Feb 2015 09:51:43 +0100

Kent,

> default namespace, the prefix can also be set in the local element).

Not true. Counterexample:

   <y:foo xmlns="x" xmlns:y="y" xmlns:z=“z” y:attr=“1” z:attr=“2">
     <z:bar>
       <z:baz/>
     </z:bar>
   </y:foo>

Best Regards,
/jan

---

From: Kent Watsen <[email-masked]>
Date: Wed, 18 Feb 2015 14:55:41 +0000

From: Jan Lindblad <[email-masked]<mailto:[email-masked]>>
Date: Wednesday, February 18, 2015 at 3:51 AM
To: Kent Watsen <[email-masked]<mailto:[email-masked]>>
Cc: Phil Shafer <[email-masked]<mailto:[email-masked]>>, "[email-masked]<mailto:[email-masked]>" <[email-masked]<mailto:[email-masked]>>
Subject: Re: [Netconf] disallow xmlns prefixes in RESTCONF?

   <y:foo xmlns="x" xmlns:y="y" xmlns:z="z" y:attr="1" z:attr="2">
     <z:bar>
       <z:baz/>
     </z:bar>
   </y:foo>

---

From: Kent Watsen <[email-masked]>
Date: Wed, 18 Feb 2015 15:01:56 +0000

[Sorry for the previous empty message - leave it to Outlook to have the
"Send" button next to the button to convert a message to plain text]

>   <y:foo xmlns="x" xmlns:y="y" xmlns:z=³z² y:attr=³1² z:attr=³2">
>     <z:bar>
>       <z:baz/>
>     </z:bar>
>   </y:foo>

Easy peasy:

    <foo xmlns="y" xmlns:y="y" xmlns:z=³z² y:attr=³1² z:attr=³2">
      <bar xmlns="z">
        <baz/>
      </bar>
    </foo>

But I grant you that this is using prefixes (per my last comment above),
contrary to the title, and it gets into the ugly, which is partially what
I'm hoping to avoid with this consideration...

Cheers,
Kent

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 23 Feb 2015 11:19:40 +0100

> of identical data.  There is no canonical form.

Actually, there is one:

http://www.w3.org/TR/xml-c14n2

However, it understandably doesn't go as far as Kent's proposal.

I agree with the others that RESTCONF implementations supporting XML
have to accept all legal namespace encodings.

Lada

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Kent Watsen <[email-masked]>
Date: Mon, 23 Feb 2015 17:08:46 +0000

>have to accept all legal namespace encodings.

OK, it seems that no one feels like this is a good idea, so I closed the
issue as dead.

Thanks,
Kent