Replies: 4 comments
-
Fine, docs updated. |
Beta Was this translation helpful? Give feedback.
-
For others who land here, the new text is: "* @param[out] new_node Optional last node created (in case of a list, it is the list instance, not any of the key nodes)." |
Beta Was this translation helpful? Give feedback.
-
Are there other cases where the actual last node isn't the target (e.g., when creating a presence container with children that have default values)? If it's the case that the returned node is always the "target of the xpath" or "the node the xpath describes" or something like that, and not "the last node created", then maybe there's a better way to say it than "last node created" and then a bunch of exceptions? In particular as a user of this API, I specifically want the node that I'm asking for with the xpath, I don't care how libyang is going about constructing the result. Right now my code calls |
Beta Was this translation helpful? Give feedback.
-
I was thinking about rewording it already so fine, changed. |
Beta Was this translation helpful? Give feedback.
-
I want to get back the node that a path refers to when using one of the
lyd_new_path*
functions. I believe that normally this is actuallylyd_new_path2
as it returns the "last node created" as opposed ot the "first node created" which if a bunch of parents are created to get to a leaf or presence container or list_entry woudl be the top-most container node not the target.So next the question is will the "last node created" actually be the target node? What happens if I am creating a list entry. The path will have the key as a predicate, technically I think the "last node created" is probably going to be the key leaf node and not the target of the path (the parent list node of that key leaf)?
i.e., say I do
lyd_new_path2()
on/foo/bar[name="baz"]
. Will I get back the specificbar
list node, or will I get back thebaz
key leaf node?It would be good if the docs/API could make this more clear too.
Thanks,
Chris.
Beta Was this translation helpful? Give feedback.
All reactions