You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am facing an issue regarding how to parse a simple RPC reply string. Namely, the string literal I am trying to parse is <ok/> (a basic rpc-reply).
I am updating some code that was previously written using libyang 1, and this string was previously parsed using lyxml_parse_mem without problems. Since the lyxml_* API is removed in libyang 2 I have tried parsing this string using lyd_parse_data, lyd_parse_data_mem and lyd_parse_op. However, I get errors regarding a missing XML namespace (rightfully so, since there is no xmlns tag in the string) and If I try to add an XML namespace the error message simply says that the node I am trying to parse is missing from the corresponding module. All of this is done with the same context as before, which was working fine using lyxml_parse_mem.
My question is whether there is a way to parse a string like this one (or even a more complex rpc-reply) with libyang to be able to traverse the XML tree (possibly in the form of lyd_nodes)? I have tried using the LYD_PARSE_OPAQ parsing option, but the lyd_node being output from the several parsing methods is NULL, so I can't cast them to lyd_node_opaq.
Could I get some guidance regarding whether if I can achieve the same functionality using libyang 2?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi,
I am facing an issue regarding how to parse a simple RPC reply string. Namely, the string literal I am trying to parse is
<ok/>
(a basic rpc-reply).I am updating some code that was previously written using libyang 1, and this string was previously parsed using
lyxml_parse_mem
without problems. Since thelyxml_*
API is removed in libyang 2 I have tried parsing this string usinglyd_parse_data
,lyd_parse_data_mem
andlyd_parse_op
. However, I get errors regarding a missing XML namespace (rightfully so, since there is no xmlns tag in the string) and If I try to add an XML namespace the error message simply says that the node I am trying to parse is missing from the corresponding module. All of this is done with the same context as before, which was working fine usinglyxml_parse_mem
.My question is whether there is a way to parse a string like this one (or even a more complex rpc-reply) with libyang to be able to traverse the XML tree (possibly in the form of
lyd_node
s)? I have tried using theLYD_PARSE_OPAQ
parsing option, but thelyd_node
being output from the several parsing methods is NULL, so I can't cast them tolyd_node_opaq
.Could I get some guidance regarding whether if I can achieve the same functionality using libyang 2?
Thanks in advance!
The text was updated successfully, but these errors were encountered: