applying default values

18 views
Skip to first unread message

ingwhe...@gmail.com

unread,
May 12, 2015, 5:36:54 PM5/12/15
to libne...@googlegroups.com
Hello,

I understand that libnetconf supports RFC 6243 regarding the handling of default values. However, I'm trouble with my model.

I looked further at ncdflt_default_values() and noticed the line below. I'm wondering if the xpath means that it can only handle default values for the type of model that is rooted at one container? (What happens to a the default values if a model's top node is a list?)

if ((defaults = xmlXPathEvalExpression(BAD_CAST "/yin:module/yin:container//yin:default", model_ctxt)) != NULL) {


Thanks,
Helen

Michal Vasko

unread,
May 13, 2015, 3:28:34 AM5/13/15
to libne...@googlegroups.com, ingwhe...@gmail.com
Hi Helen,

libnetconf can generally handle (load) only models that have all the configuration data in a single container. This is even a recommendation in an RFC. Why would you want to create a model with list as the root?

Regards,
Michal

ingwhe...@gmail.com

unread,
May 13, 2015, 5:26:14 PM5/13/15
to libne...@googlegroups.com, ingwhe...@gmail.com
I was performing validations with a toy model, so I don't have a specific use case in mind.

However, could you please confirm that the line I highlighted intends to only handle default values for a model that is rooted at one container?

Thanks,
Helen

Michal Vasko

unread,
May 14, 2015, 2:45:54 AM5/14/15
to libne...@googlegroups.com, ingwhe...@gmail.com
Hi Helen,

yes, only the default values in models with a single top configuration container are processed. At the same time, however, it can easily be changed to handle default values in any models, there just wasn't any reason to change it.

Regards,
Michal
Reply all
Reply to author
Forward
0 new messages