Open cavanaug opened 1 month ago
That sounds like the basic use case for XPath but I am not aware if such tool exists.
It should not be hard to build something like that. Basically, see the line 55 in index.js: nodes = selector(pattern, root)
. That selects specific XML nodes that match the xpath patterns. Maybe those nodes and all their ancestors could then be reinserted to another tree. The resulting tree would then contain only the matched nodes and their ancestors.
Im looking for something that takes an xml document and list of xpaths to keep and thus delete everything else.