1

xmllint display values of more than 1 attributes in single execution

view story
linux-howto

http://unix.stackexchange.com – I am using xmllint to parse xml file which has several tags and each tag has several attributes. Sample structure as shown below: <root> <child attr1="abc" attr2="def" attr3="ghi" /> ... ... </root> I need to fetch the values from the attributes attr1,attr2 and attr3. So far, I have tried the following which is giving the data of one attribute perfectly echo 'cat //root/child/@attr1' | xmllint --shell data.xml This output attr1="abc" So, my question is, how can we specify more than one attributes in the string to get the required output as attr1="abc" at (HowTos)