Why anyxml childs are validated if inserted in the CDB?

Hi All,

I was trying to populate the CDB through NETCONF edit-conf RPC.
In the yang model I have defined an anyxml element called sample as follows:

container trial{ anyxml sample { description "Represent the action to perform"; } }
I have created an xml file (write.xml) to pass to the netconf-console python script (NETCONF client).
The file contains the following:
<trial xmlns="http://prova" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <sample nc:operation="create"> <ciao>ciao1</ciao> </sample > </trial>
when I issue the NETCONF edit-conf RPC through
python netconf-console --proto=tcp --port=2023 --host= --user=admin --password=admin --edit-config “write.xml”

I get the following error:

<?xml version="1.0" encoding="UTF-8"?> protocol unknown-element error /rpc/edit-config/config/pr:trial/pr:sample ciao `

If instead I change the write.xml as follows (removing the tag ) everything goes well:
<trial xmlns="http://prova" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <sample nc:operation="create"> ciao1 </sample > </trial>
At this point I don’t see any different to anyxml and type string.
In case I would like to save a tree of xml tags in the CDB could someone tell me how can I do it?


ConfD does not support the use of anyxml. In general, anyxml has too much chance to be misused and abused and result in the loss of the benefits of a structured modeling language.

Section 3.2 of the User Guide:

3.2. YANG in ConfD

In ConfD , YANG is not only used for NETCONF data. On the contrary, YANG is used to describe the data model as a whole and used by all northbound interfaces.

A YANG module can be directly transformed into a final schema (.fxs) file that can be loaded into ConfD. Currently all features of the YANG language except the anyxml statement are supported.