# Why anyxml childs are validated if inserted in the CDB?

**URL:** https://dmap-community.ductus.global/t/why-anyxml-childs-are-validated-if-inserted-in-the-cdb/455
**Category:** CDB and CDB API
**Created:** [April 15, 2016, 8:03am UTC](https://dmap-community.ductus.global/t/why-anyxml-childs-are-validated-if-inserted-in-the-cdb/455 "2016-04-15T08:03:13Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mattedallo](https://avatars.discourse-cdn.com/v4/letter/m/ad7895/32.png) [@mattedallo](https://dmap-community.ductus.global/u/mattedallo)
#### Post date: [April 15, 2016, 8:03am UTC](https://dmap-community.ductus.global/t/why-anyxml-childs-are-validated-if-inserted-in-the-cdb/455/1 "2016-04-15T08:03:13Z")

</div>

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=127.0.0.1 --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?

Thanks.

---

<div class="post-metadata">

### Author: ![jlawitzke](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/jlawitzke/32/54_2.png) [@jlawitzke](https://dmap-community.ductus.global/u/jlawitzke)
#### Post date: [April 15, 2016, 12:46pm UTC](https://dmap-community.ductus.global/t/why-anyxml-childs-are-validated-if-inserted-in-the-cdb/455/2 "2016-04-15T12:46:56Z")

</div>

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.
