-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding namespaces to XML data trees #1104
Comments
It should include key prefixes, which need to be printed properly. Fixes #1104
Hi, Regards, |
Okay I tried it again, and it's working, the namespace thingy gets added. Thank you! The key needs to have the module name specified instead of the prefix ("example-schema" instead of "aha"), but the prefix gets added correctly. I'm not sure if this is intentional, but I like this more - it's less work for me (I don't care about prefixes). |
Hi, Regards, |
Let's bring in a fix for CESNET/libyang#1104 (and then hopefully be done with this update dance for a few days :) ). This, of course, also required a follow-up fix in the Netopeer2, so let's update that one as well. Change-Id: Id0e3701c23270abfaa0c0a1425161b121c4fde9e
Hello,
I'm using libyang to print data trees for NETCONF edit-config. This is kind of a follow up to CESNET/netopeer2#636
I have this schema with a user-ordered list:
And I want to move
/example-schema:players[name='John']
after/example-schema:players[name='Adam']
. According to the YANG 1.1 RFC (https://tools.ietf.org/html/rfc7950), I should insert an attributeyang:insert
with the valueafter
, and attributeyang:key
with the value[aha:name='Adam']
. I use this code to create the tree:This code prints this:
Looking at the example in https://tools.ietf.org/html/rfc7950#page-93, I can see that the key name inside the
yang:key
attribute should be prefixed with the prefix of my schema (which is "aha"). But, in the example I see one more namespace defined, which seems to be connected to this prefix somehow. So, maybe the XML I want should look like this?My question is whether the namespace should be defined (as it is in the RFC example), or if it isn't mandatory. And if it is mandatory, then is it possible to tell libyang to insert it?
Thanks for the answer.
The text was updated successfully, but these errors were encountered: