In a shell script (Linux, bash, #!/bin/sh) I have a variable containing XML data like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<interface>
<objects retrieved="0" total="0"/>
</interface>
Some error handling is already done when getting this data, so focus on the actual question please. And the question is: easy/effective way of reading the "objects" element's attribute data (named "retrieved"). It can be 0 or 1. (and nothing else). I guess I have two options: regular expressions and XML-parsing with some external program. But which one should I choose? Thanks in advance.