I'd like to use xpath from xmllint to fetch a hostname and a serial number.
Here is the XML
<hosts>
<host name="blah001" serial="ABC001">
<moreinfo />
</host>
<host name="blah002" serial="ABC002">
<moreinfo />
</host>
..
</hosts>
I can fetch all serials with host name blah*:
/ > cat //hosts/host[starts-with(@name,"blah")]/@serial
-------
serial="ABC001"
-------
serial="ABC002"
But I also want to see which hostname had that serial. Is that possible?