title: Testing for an XML attribute
body: <p>I have a piece of XML like so:</p>
  
  <pre><code>&lt;root&gt;
      &lt;foo src=""/&gt;
      &lt;foo src="bar"/&gt;
      &lt;foo /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I want to know which <strong>elements have a src attribute</strong>, which are empty and which have values.</p>
  
  <p>The furthest I have come is with</p>
  
  <pre><code>$ xmlstarlet sel -t -m '//foo' -v @src -n foo.xml 
  
  bar
  </code></pre>
  
  <p>Though that doesn't tell me the third foo is missing the attribute.</p>