Is there is a way to build the XML tree ( filter tree) from yang models to pass as paramter to getdata
Hi ,
i am new to libyang and libnetconf library.
my requirement is to build the XML filter (XML subtree) from given yang module and provide that as input to nc_rpc_getdata . I have gone through the available examples, but unable to find suitable example.
My requirement description as below:
user will request to fetch the data from server by providing the leaf reference name ( element name) and Yang module . my app has to build the XML filter tree and has to fetch the data from server by passing XML tree filter to nc_rpc_getdata .
Could you please any one suggest, suitable APIs that has to be used or suitable example that i can refer.
Thanks In advance for the help.
Well, you will have to do most of the work yourself. I would start by finding the appropriate struct lysc_node in struct lys_module, preferably using some API function such as lys_find_path. Once you have it, manually build the XML for the node and its parents.