Passing input to xmllint as string not as file

Viewed 170

I need to call xmllint from python script and pass schema and input as string variables not as files. Is it possible?? if yes what is the format??

1 Answers

Xmllint accepts only one of the 2 via stdin

Passing commands to --shell option

(echo "cat //tag1"; echo "cd /root/tag2"; echo "cat") | xmllint --shell test.xml

Passing document via stdin

cat test.xml | xmllint --xpath '//tag1' -
Related