Closed gwieser1234 closed 3 years ago
Hi @gwieser1234
Indeed, the example is incorrect, I will fix the README.
HI Robin, thank you that fixed it. Its working now.
Hi Robin,
I am facing the same issue with libyang-python.
When i use
ctx.parse_data_mem(xml_tree, "xml",strict=True)
i receive this error
<nc:error-info>failed to parse data tree: Mandatory node "content-id" instance does not exist.</nc:error-info>
The RPC that i am trying contains this data,
<rpc>
<edit-config>
<target>
<running/>
</target>
<config>
<ManagedElement xmlns="urn:3gpp:sa5:_3gpp-common-managed-element">
<id>O1/mns/ManagedElement-Single/123456</id>
<GNBDUFunction xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-gnbdufunction">
<id>O1/mns/GnbDuFunction-Single/123456:5</id>
<NRCellDU xmlns="urn:3gpp:sa5:_3gpp-nr-nrm-nrcelldu">
<id>O1/mns/NrCellDu-Single/123456:011</id>
<attributes>
<nRPCI>17</nRPCI>
<arfcnDL>140001</arfcnDL>
<arfcnUL>140002</arfcnUL>
<ssbFrequency>703</ssbFrequency>
</attributes>
</NRCellDU>
</GNBDUFunction>
</ManagedElement>
</config>
</edit-config>
</rpc>
I believe get_yanglib_data
is needed here but i don't understand completely how to get around this error
https://netopeer.liberouter.org/doc/libyang/master/html/group__dataparseroptions.html
please do not resurect closed issues.
Actually, i had exactly same error so i thought it might be related and not a new issue. So, from the link are you suggesting me to use this flag LYD_PARSE_SUBTREE? Because i have tried all others and it leads to same issue or it doesn't validate the tree with the PARSE_ONLY flag.
The issue was reported with libyang 1 which is completely different.
I think rpc input cannot be validated without the complete datastore at hand (which you don't have in your case). So PARSE_ONLY
makes a lot of sense. Maybe you should ask on the libyang project itself how to parse rpc input data. The python bindings don't do anything fancy besides wrapping the C API.
Thanks Robin. I'll try the libyang project
Hi,
I am trying to build a data tree based on the example that you have provided. I can load the schema, but I was not able to create a data tree. I am getting an error: "libyang.util.LibyangError: validation failed: Missing required element "content-id" in "yang-library".
Any pointer is much appreciated.