Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-1170

netconf-client-mdsal emits useless namespace in filter

XMLWordPrintable

      When we emit a filter we end up doing this:

      <filter xmlns:ns0="urn:ietf:params:xml:ns:netconf:base:1.0" ns0:type="subtree" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
          <top xmlns="http://example.com/schema/1.2/config">
              <users>
              </users>
          </top>
      </filter>
      

      The problem here is that we emit a namespace declaration to host the 'type' attribute, which is wrong. The interpretation here is that attributes inhering the default namespace, but that is not true: attributes do not inherit the the namespace of the element in which they are declared.

      In this particular case "type" should just be a plain attribute, without any prefix:

      <filter type="subtree" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
          <top xmlns="http://example.com/schema/1.2/config">
              <users>
              </users>
          </top>
      </filter>
      

      and without the ns declaration when we already have it in an ancestor element.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: