[NETCONF-1170] netconf-client-mdsal emits useless namespace in filter Created: 01/Oct/23  Updated: 11/Oct/23  Resolved: 11/Oct/23

Status: Resolved
Project: netconf
Component/s: netconf-client-mdsal
Affects Version/s: 3.0.9, 5.0.7, 4.0.8, 6.0.4
Fix Version/s: 7.0.0, 5.0.8, 6.0.5

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

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.


Generated at Wed Feb 07 20:16:50 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.