Have such a XML file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model-response-list xmlns="http://www.ca.com/spectrum/restful/schema/response" total-models="922" throttle="922" error="EndOfResults">
<model-responses>
<model mh="0x1058905">
<attribute id="0x1006e">prod-vpn-gw-v01.e-x.com</attribute>
</model>
<model mh="0x1058907">
<attribute id="0x1006e">prod-storage-san-z01-ssh.e-x.com</attribute>
</model>
<model mh="0x1058900">
<attribute id="0x1006e">test-vpn-gw-v01</attribute>
</model>
</model-responses>
</model-response-list>
I need to print a list:
0x1058905 prod-vpn-gw-v01.e-x.com
0x1058907 prod-storage-san-z01-ssh.e-x.com
0x1058900 test-vpn-gw-v01
I tried with:
xmllint --xpath "//*[local-name()='model']/*[local-name()='attribute']/text()" devices.xml
but its only for the name, really no idea how to use it with an and in it to get also the 0x... mh value.
Can some one help? Thank You.