title: XSLT - how to change the value of any attribute whose value contains a given substring
body: <p>Given the following xml:</p>
  
  <pre><code>&lt;inventory&gt;
    &lt;item name="..." sku="123"/&gt;
    &lt;item name="..." sku="not available"/&gt;
    &lt;catalog vendor="..."&gt;
        &lt;product id="--not available--"/&gt;
        &lt;product id="345"/&gt;
    &lt;/catalog
  &lt;/inventory&gt;
  </code></pre>
  
  <p>I would like to replace any attribute value (anywhere) that has "not available" in it with <code>'000'</code>.</p>
  
  <p>I've tried different combinations in XSLT (it is not my forte), and I'm able to replace them when I put the specific XPath expression for each attribute. Unfortunately, the XML documents I might be dealing with (well formed mind you) might have different structure and attribute naming conventions. </p>
  
  <p>All that matter at is to scan specific attribute values (or value patterns) and replace them with a problem-specific default. I'm finding myself to the point of just hack a solution in Python (load doc, iterate the DOM and modify any attribute in any node that matches the criteria.)</p>
  
  <p>But I would really like to learn the solution for this in XSLT (whether it is replacing attribute values that match a pattern, or just straight string comparisons), if one exists. Professional curiosity if you will.</p>
  
  <p>Any help would be appreciated. Any recommendation on a source or book that explains these XLST/XPath  intricacies would be great as well (I've only found very simple examples, nothing as arbitrary as this.)</p>