Replies: 4 comments
-
Alright, this can be added and hopefully I have come up with a reasonable algorithm. My only question is what parameters do you need? The required ones are only |
Beta Was this translation helpful? Give feedback.
-
For our current mark/sweep we use We use JSON prefix style (module names) in our xpath strings (these are actually from the user e.g., a CLI command) so that's why we don't need So I think we'd use (tree, xpath, vars), but maybe others might want the full (tree, xpath, format, vars)? |
Beta Was this translation helpful? Give feedback.
-
Okay, the function is implemented and should even be quite efficient. If the need for more parameters arises in future, a new variant can be added. |
Beta Was this translation helpful? Give feedback.
-
Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently lyd_find_xpath* returns a set of nodes. These nodes are references to the tree that is passed in (either from the
ctx
or directly in variant 3 and 4).I'd really like to use this function to actually trim the passed in tree, as for me the entire tree represent the results (e.g., I'm passing them back to a client in XML format so they are from the root)
I do not actually need the
LY_SET
of all the matching leaf nodes, but rather the tree w/o any non-matching nodes in it. Additionally this could be operating on a large set of data where the matches might count in the millions so it's very inefficient to allocate and fill the unneeded LY_SET.Would it be possible to be provided with an analogous API functions that do this? e.g.,
name-wise trim, filter, whatever seems best :)
Beta Was this translation helpful? Give feedback.
All reactions