[erlang-questions] ct_netconfc.erl: is this the expected behavior or is it a bug?
Martin Bjorklund
mbj@REDACTED
Tue Mar 11 14:49:55 CET 2014
Hi,
Siri Hansen <erlangsiri@REDACTED> wrote:
> Would this also work ?
>
> <?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <rpc message-id=\"1\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">
> <edit-config>
> <target>
> <running/>
> </target>
> <config>
> <ElementA>
> <elementAId>1</elementAId>
> <elementB>
> <elementB>1</elementB>
> <elementC operation=\"delete\">
> <elementCId>6</elementCId>
> </elementC>
> </elementB>
> </ElementA>
> </config>
> </edit-config>
> </rpc>
>
>
> i.e. without the 'xc' prefix (the netconf base namespace is the default
> anyway).
This is actually not how default namespaces work. The default
namespace does not apply to XML attributes.
> It's probably up to your netconf server if it can handle that or
> not.
Some NETCONF servers are lax and will accept an unqualified
"operation" attribute.
> Ideally it should be something like:
>
> <?xml version=\"1.0\" encoding=\"UTF-8\"?>
> <rpc message-id=\"1\" xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\">
> <edit-config>
> <target>
> <running/>
> </target>
> <config>
> <ElementA xmlns=\"mynamespace\"
> xmlns:xc=\"urn:ietf:params:xml:ns:netconf:base:1.0\">
> <elementAId>1</elementAId>
> <elementB>
> <elementB>1</elementB>
> <elementC xc:operation=\"delete\">
> <elementCId>6</elementCId>
> </elementC>
> </elementB>
> </ElementA>
> </config>
> </edit-config>
> </rpc>
>
> where "mynamespace" defines your own config data.
This is the only example so far that is correct. It is important that
the "ElementA" has a namespace declaration; otherwise it refers to
"ElementA" in the namespace "urn:ietf:params:xml:ns:netconf:base:1.0",
which clearly is wrong.
/martin
More information about the erlang-questions
mailing list