# Example for using leaf-list with cli-diff-dependency and must statement

**URL:** <https://dmap-community.ductus.global/t/example-for-using-leaf-list-with-cli-diff-dependency-and-must-statement/2773>\
**Category:** YANG\
**Created:** [November 14, 2019, 6:44am UTC](https://dmap-community.ductus.global/t/example-for-using-leaf-list-with-cli-diff-dependency-and-must-statement/2773 "2019-11-14T06:44:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![arun88](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@arun88](https://dmap-community.ductus.global/u/arun88)\
**Post date:** [November 14, 2019, 6:44am UTC](https://dmap-community.ductus.global/t/example-for-using-leaf-list-with-cli-diff-dependency-and-must-statement/2773/1 "2019-11-14T06:44:09Z")

</div>

Hi there,  
I have a model that describes a leaf-list as below:

leaf-list param {  
type uint32;  
}  
As is the case with leaf-list, this can be a list of values (e.g, 1,2,3) for the same leaf name. How do I use cli-diff-dependency and “must” such that I validate each and every value provided to this leaf-list and see if a node named, say, base\_param defined elsewhere in the model exists with that value in the config already? If the user types 1,2 and 3 as value for param, I want to put in a “must” statement to see if I have base\_param with value 1 AND base\_param with value 2 AND base\_param with value 3 defined in the config prior to this leaf-list config.

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [November 17, 2019, 3:48pm UTC](https://dmap-community.ductus.global/t/example-for-using-leaf-list-with-cli-diff-dependency-and-must-statement/2773/2 "2019-11-17T15:48:14Z")

</div>

Have you taken a look at the XPath documentation resources?

- The primary manual for ConfD is the YANG and NETCONF RFC pointing to W3C standard. The ConfD UG complements the YANG and NETCONF RFCs. See:  
[https://tools.ietf.org/html/rfc7950#ref-XPATH](https://tools.ietf.org/html/rfc7950#ref-XPATH)  
[https://tools.ietf.org/html/rfc6241#section-8.9.1](https://tools.ietf.org/html/rfc6241#section-8.9.1)
- See also ConfD UG under “NETCONF Server” “Capabilities” “:xpath”
- Including the link to the xpath 1.0 standard in those documents (for example “4.1 Node Set Functions” can be handy sometimes)  
[https://www.w3.org/TR/1999/REC-xpath-19991116/](https://www.w3.org/TR/1999/REC-xpath-19991116/)
- Then there are ConfD YANG extensions regarding xpath in the tailf\_yang\_extensions man page section “XPATH FUNCTIONS”
