GNOME Bugzilla – Bug 740827
xmllint feature request: display Xpath query output with an output line separator
Last modified: 2020-06-25 01:10:48 UTC
Hi, I wonder why unlike the xmlstarlet shell tool, xmllint from libxml2 don't display Xpath querys results with newlines. I think it would be a great feature to have a switch to choose our own output separator instead of making modification for legacy retro compatibility purposes. It will be very handy to feed shell array, like this : result=( $(xmllint --xpath '/a/@href' file) ) There's AFAIK no way today to do so in a proper way. Thanks, Gilles Quenot.
Workaround : https://github.com/sputnick-dev/xmllint/blob/master/xmllint
Fixed some bugs in the wrapper, now seems to work well
Solved in v2.9.9. https://gitlab.gnome.org/GNOME/libxml2/commit/da35eeae5b92b88d8ebdb64b4b327ac1c2cf1bce https://gitlab.gnome.org/GNOME/libxml2/-/merge_requests/8