I have the following HTML code:
Try this patch, which provides 2 options:
--xpath
: same as old --xpath
, with nodes separated by \n
.
--xpath0
: same as old --xpath
, with nodes separated by \0
.
Test input (a.html
):
Test command 1:
# xmllint --xpath '//textarea[@name="command"]/text()' --html a.html
Test output 1:
1
2
Test command 2:
# xmllint --xpath0 '//textarea[@name="command"]/text()' --html a.html | xargs -0 -n1
Test output 2:
1
2